| | |
| | | <!-- 根据条件查询产品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} |