Browse Source

监督端-联合查询查询条件修改

test
niujiyi 3 weeks ago
parent
commit
4dc0462dcf
  1. 76
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/report/EnforcementRegistrationReportMapper.xml

76
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/report/EnforcementRegistrationReportMapper.xml

@ -141,6 +141,82 @@
AND r2.check_category IS NOT NULL
AND r2.bureau_dept_id IS NOT NULL
AND (r2.status = 0 OR r2.status IS NULL)
<if test="bo.bureauDeptName != null and bo.bureauDeptName != ''">
AND r2.bureau_dept_name LIKE CONCAT('%', #{bo.bureauDeptName}, '%')
</if>
<if test="bo.lawEnforcer != null and bo.lawEnforcer != ''">
AND (law_enforcer LIKE CONCAT('%', #{bo.lawEnforcer}, '%')
ORr. law_enforcer_two LIKE CONCAT('%', #{bo.lawEnforcer}, '%'))
</if>
<if test="bo.enterpriseName != null and bo.enterpriseName != ''">
AND r2.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%')
</if>
<if test="bo.lawEnforcementItemText != null and bo.lawEnforcementItemText != ''">
AND r2.law_enforcement_item_text LIKE CONCAT('%', #{bo.lawEnforcementItemText}, '%')
</if>
<if test="bo.hasUnion != null">
AND r2.has_union = #{bo.hasUnion}
</if>
<if test="bo.hasAuto != null">
AND r2.has_auto = #{bo.hasAuto}
</if>
<if test="bo.entrustDeptName != null and bo.entrustDeptName != ''">
AND r2.entrust_dept_name LIKE CONCAT('%', #{bo.entrustDeptName}, '%')
</if>
<if test="bo.lawEnforceCategory != null and bo.lawEnforceCategory != ''">
AND r2.law_enforce_category = #{bo.lawEnforceCategory}
</if>
<if test="bo.isComplaint != null">
AND r2.is_complaint = #{bo.isComplaint}
</if>
<if test="bo.enforce != null and bo.enforce != ''">
AND r2.enforce = #{bo.enforce}
</if>
<if test="bo.checkCss != null and bo.checkCss != ''">
AND r2.check_css = #{bo.checkCss}
</if>
<if test="bo.district != null and bo.district != ''">
AND (r2.enterprise_address LIKE CONCAT('深圳市', SUBSTRING_INDEX(#{bo.district}, '区', 1), '区%')
OR r2.enterprise_address LIKE CONCAT('深圳市', SUBSTRING_INDEX(#{bo.district}, '区', 1), '新区%'))
</if>
<if test="bo.street != null and bo.street != ''">
AND (r2.enterprise_address LIKE CONCAT('深圳市', SUBSTRING_INDEX(#{bo.district}, '区', 1), '区', #{bo.street}, '%')
OR r2.enterprise_address LIKE CONCAT('深圳市', SUBSTRING_INDEX(#{bo.district}, '区', 1), '新区', #{bo.street}, '%'))
</if>
<if test="bo.checkCategory != null and bo.checkCategory != ''">
AND r2.check_category = #{bo.checkCategory}
</if>
<!-- dateType: 1=本月, 2=本季度, 3=本年 -->
<if test="bo.dateType != null and bo.dateType == 1">
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<if test="bo.dateType != null and bo.dateType == 2">
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m') &gt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01'
WHEN QUARTER(CURDATE()) IN (2) THEN '04'
WHEN QUARTER(CURDATE()) IN (3) THEN '07'
ELSE '10' END)
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m') &lt;= CONCAT(YEAR(CURDATE()), '-',
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '03'
WHEN QUARTER(CURDATE()) IN (2) THEN '06'
WHEN QUARTER(CURDATE()) IN (3) THEN '09'
ELSE '12' END)
</if>
<if test="bo.dateType != null and bo.dateType == 3">
AND DATE_FORMAT(r2.enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
<if test="bo.dateSearch != null and bo.dateSearch != ''">
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m') = #{bo.dateSearch}
</if>
<if test="bo.beginTime != null and bo.beginTime != ''">
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m-%d') &gt;= #{bo.beginTime}
</if>
<if test="bo.endTime != null and bo.endTime != ''">
AND DATE_FORMAT(r2.enforcement_time, '%Y-%m-%d') &lt;= #{bo.endTime}
</if>
<if test="dataFilter != null and dataFilter != ''">
${dataFilter}
</if>
GROUP BY r2.union_no
HAVING COUNT(1) > 1
) t

Loading…
Cancel
Save