From 7c2c6a5e5b3d9f96aef3c67573aa62bbd9a3aa7f Mon Sep 17 00:00:00 2001 From: p-honggang.li <p-honggang.li@pcitc.com> Date: 星期四, 11 九月 2025 10:48:18 +0800 Subject: [PATCH] 修改产品类型,单位工程条偶见查询问题 --- src/main/resources/mapper/ReportResultSubmissionMapper.xml | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/resources/mapper/ReportResultSubmissionMapper.xml b/src/main/resources/mapper/ReportResultSubmissionMapper.xml index 447d8ef..9e1f1a9 100644 --- a/src/main/resources/mapper/ReportResultSubmissionMapper.xml +++ b/src/main/resources/mapper/ReportResultSubmissionMapper.xml @@ -5,16 +5,25 @@ <!-- 鏍规嵁鏉′欢鏌ヨ浜у搧ID鍒楄〃 --> <select id="selectProductIdsByConditions" resultType="java.lang.String"> SELECT id - FROM tb_report_result_submission + FROM tb_report_product_submission WHERE deleted = '0' <if test="industryId != null and industryId != ''"> - AND industrial_chain_id = #{industryId} + AND #{industryId} = ANY ( STRING_TO_ARRAY( industrial_chain_id, ',' ) ) </if> - <if test="unitProjectId != null and unitProjectId != ''"> - AND important_area_id = #{unitProjectId} + <if test="unitProjectId != null and unitProjectId.size() > 0"> + AND + <foreach collection="unitProjectId" item="importantAreaId" open="(" separator="OR" close=")"> + #{importantAreaId} = ANY ( STRING_TO_ARRAY( important_area_id, ',' ) ) + </foreach> + </if> + <if test="importantDistrictId != null and importantDistrictId.size() > 0"> + AND + <foreach collection="importantDistrictId" item="importantDistrictId" open="(" separator="OR" close=")"> + #{importantDistrictId} = ANY ( STRING_TO_ARRAY( important_district_id, ',' ) ) + </foreach> </if> <if test="productTypeId != null and productTypeId != ''"> - AND type_id = #{productTypeId} + AND technology_type_id = #{productTypeId} </if> <if test="productSubTypeId != null and productSubTypeId != ''"> AND type_child_id = #{productSubTypeId} -- Gitblit v1.8.0