and (e.enterprise_number not like "92440300MACQUM2M9C"
or e.enterprise_number is null)
and e.bureau_dept_name is not null
and e.law_enforcement_id is not null
and e.enterprise_name is not null
and e.enterprise_number is not null
and e.law_enforcer is not null
and e.law_enforcer_two is not null
and e.is_complaint is not null
and e.check_category is not null
and e.bureau_dept_id is not null
<iftest="qy != null and qy != ''">
and (i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
<iftest="jd != null and jd != ''">
and (i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or i.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%'))
</if>
</if>
<iftest="enterpriseName != null and enterpriseName != ''">
AND e.enterprise_name like concat(concat('%',#{enterpriseName}),'%')
</if>
<iftest="bureauDeptName != null and bureauDeptName != ''">
AND e.bureau_dept_name like concat(concat('%',#{bureauDeptName}),'%')
</if>
<iftest="lawEnforcer != null and lawEnforcer != ''">
AND (e.law_enforcer like concat(concat('%',#{lawEnforcer}),'%')
or
e.law_enforcer_two like concat(concat('%',#{lawEnforcer}),'%'))
</if>
<iftest="lawEnforcementItemText != null and lawEnforcementItemText != ''">
AND e.law_enforcement_item_text like concat(concat('%',#{lawEnforcementItemText}),'%')
</if>
<iftest="year != null and year != ''">
AND YEAR(e.create_time) = #{year}
</if>
<iftest="quarter != null and quarter != '' ">
AND QUARTER(e.create_time) = #{quarter}
</if>
<iftest="month != null and month != '' ">
AND DATE_FORMAT(e.create_time, '%m') = #{month}
</if>
<iftest="startTime != null and startTime != ''"><!-- 开始时间检索 -->
and DATE_FORMAT(e.create_time,'%Y-%m-%d') >= STR_TO_DATE(#{startTime},'%Y-%m-%d')