@ -136,6 +136,9 @@
<if test= "params.zone != null and params.zone != ''" >
and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
@ -185,6 +188,9 @@
<if test= "params.zone != null and params.zone != ''" >
and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
@ -234,6 +240,9 @@
<if test= "params.zone != null and params.zone != ''" >
and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
@ -277,8 +286,10 @@
<if test= "params.zone != null and params.zone != ''" >
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and n.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -316,6 +327,9 @@
<if test= "params.zone != null and params.zone != ''" >
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and n.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
@ -355,6 +369,9 @@
<if test= "params.zone != null and params.zone != ''" >
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and n.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
@ -398,8 +415,10 @@
<if test= "params.zone != null and params.zone != ''" >
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and c.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -439,8 +458,10 @@
<if test= "params.zone != null and params.zone != ''" >
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and c.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -480,8 +501,10 @@
<if test= "params.zone != null and params.zone != ''" >
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and c.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -520,7 +543,9 @@
and w.enterprise_number is not null
and warn_type = 1
<if test= "userId != null and userId != '' " > and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and w.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -557,7 +582,9 @@
and w.enterprise_number is not null
and warn_type = 1
<if test= "userId != null and userId != '' " > and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and w.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -594,7 +621,9 @@
and w.enterprise_number is not null
and warn_type = 1
<if test= "userId != null and userId != '' " > and( w.law_enforcer_id=#{userId} or w.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and w.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and w.enforcement_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -633,7 +662,6 @@
and e.company_org_type is not null
and e.enterprise_address is not null
<if test= "userId != null and userId != '' " > and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and e.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -666,7 +694,6 @@
and e.company_org_type is not null
and e.enterprise_address is not null
<if test= "userId != null and userId != '' " > and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and e.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -703,7 +730,6 @@
and e.company_org_type is not null
and e.enterprise_address is not null
<if test= "userId != null and userId != '' " > and( e.law_enforcer_id=#{userId} or e.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and e.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -752,7 +778,9 @@
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and r.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -792,7 +820,9 @@
and c.enforce_type is not null
and c.enterprise_number is not null
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and c.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -840,7 +870,9 @@
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and r.bureau_dept_id=#{bureauDeptId}</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -890,10 +922,12 @@
<if test= "params.zone != null and params.zone != ''" >
and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and r.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))
@ -942,6 +976,9 @@
<if test= "params.zone != null and params.zone != ''" >
and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "uniteCheck == '0'.toString()" > and r.unite_check is not null</if>
<if test= "uniteCheck == '1'.toString()" > and r.unite_check is null</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
@ -974,6 +1011,7 @@
${params.dataScope}
</if>
</where>
group by enterprise_number
</select>
<!-- 投诉类型 -->
<select id= "staisticalEnforce_type" parameterType= "SixAnalysisParams" resultType= "map" >
@ -986,8 +1024,10 @@
<if test= "params.zone != null and params.zone != ''" >
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test= "deptId != null and deptId != ''" >
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test= "bureauDeptId != null and bureauDeptId != '' " > and c.bureau_dept_id=#{bureauDeptId}</if>
<if test= "qy != null and qy != ''" >
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%'))