<iftest="lawEnforcement != null and lawEnforcement != ''"> and law_enforcement like concat('%', #{lawEnforcement}, '%')</if>
<iftest="bureauDeptName != null and bureauDeptName != ''"> and bureau_dept_name like concat('%', #{bureauDeptName}, '%')</if>
<iftest="lawEnforcementId != null and lawEnforcementId != ''"> and law_enforcement_id = #{lawEnforcementId}</if>
<iftest="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
<iftest="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<iftest="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<iftest="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if>
<iftest="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer like concat('%',#{lawEnforcer} ,'%') or law_enforcer_two like concat('%',#{lawEnforcer} ,'%')</if>
<iftest="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if>
<iftest="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<iftest="lawEnforcerIdTwo != null and lawEnforcerIdTwo != ''"> and law_enforcer_id_two = #{lawEnforcerIdTwo}</if>
<iftest="lawEnforcerTelTwo != null and lawEnforcerTelTwo != ''"> and law_enforcer_tel_two = #{lawEnforcerTelTwo}</if>
<iftest="subsidiaryer != null and subsidiaryer != ''"> and subsidiaryer = #{subsidiaryer}</if>
<iftest="subsidiaryerId != null and subsidiaryerId != ''"> and subsidiaryer_id = #{subsidiaryerId}</if>
<iftest="subsidiaryerTel != null and subsidiaryerTel != ''"> and subsidiaryer_tel = #{subsidiaryerTel}</if>
<iftest="lawEnforcementItem != null and lawEnforcementItem != ''"> and law_enforcement_item = #{lawEnforcementItem}</if>
<iftest="lawEnforcementItemText != null and lawEnforcementItemText != ''"> and law_enforcement_item_text like concat('%', #{lawEnforcementItemText,jdbcType=VARCHAR}, '%')</if>
<iftest="lawEnforcementBasis != null and lawEnforcementBasis != ''"> and law_enforcement_basis = #{lawEnforcementBasis}</if>
<iftest="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if>
<iftest="reslut != null "> and reslut = #{reslut}</if>
<iftest="isSubmit != null "> and is_submit = #{isSubmit}</if>
<iftest="userId != null "> and user_id = #{userId}</if>
<iftest="deptId != null "> and dept_id = #{deptId}</if>
<iftest="isDelete != null "> and is_delete = #{isDelete}</if>
<iftest="isComplaint != null "> and is_complaint = #{isComplaint}</if>
<iftest="status != null "> and status = #{status}</if>
<iftest="lawEnforcementCode != null and lawEnforcementCode != ''"> and law_enforcement_code = #{lawEnforcementCode}</if>
<iftest="uniteCheck != null and uniteCheck != ''"> and unite_check = #{uniteCheck}</if>
<iftest="checkCategory != null and checkCategory != ''"> and check_category = #{checkCategory}</if>
<iftest="checkCss != null and checkCss != ''"> and check_css = #{checkCss}</if>
<iftest="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<iftest="hasUnion != null"> and has_union = #{hasUnion}</if>
<iftest="hasAuto != null"> and has_auto = #{hasAuto}</if>
<iftest="searchValue != null and searchValue != ''">
and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%')
or law_enforcement like concat(concat('%',#{searchValue}),'%')
or law_enforcer like concat(concat('%',#{searchValue}),'%')
or law_enforcer_two like concat(concat('%',#{searchValue}),'%')
or enterprise_name like concat(concat('%',#{searchValue}),'%')
)
</if>
<iftest="dateType != null and dateType == 1">
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
</if>
<iftest="dateType != null and dateType == 2">
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= 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(enforcement_time, '%Y-%m') <= 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>
<iftest="dateType != null and dateType == 3">
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
</if>
<iftest="dateSearch != null and dateSearch != ''">
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{dateSearch}
</if>
<iftest="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') >= #{beginTime}
</if>
<iftest="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') <= #{endTime}
</if>
<iftest="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and enforcement_time >= #{params.beginTime}
</if>
<iftest="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->