@ -1138,6 +1138,7 @@
group by t.satisfaction_level
group by t.satisfaction_level
</select>
</select>
<!-- 所有行政检查数量 -->
<!-- 所有行政检查数量 -->
<select id= "analysis_enterprises_all" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_enterprises_all" parameterType= "SixAnalysisParams" resultType= "integer" >
SELECT count(1) FROM enforcement_registration r
SELECT count(1) FROM enforcement_registration r
@ -1151,14 +1152,17 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<!-- <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= "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 != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_enterprises_all_rr" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_enterprises_all_rr" parameterType= "SixAnalysisParams" resultType= "integer" >
SELECT count(1) FROM enforcement_registration r
SELECT count(1) FROM enforcement_registration r
@ -1184,6 +1188,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_enterprises_all_yoy" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_enterprises_all_yoy" parameterType= "SixAnalysisParams" resultType= "integer" >
SELECT count(1) FROM enforcement_registration r
SELECT count(1) FROM enforcement_registration r
@ -1209,6 +1217,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<!-- 所有非行政检查数量 -->
<!-- 所有非行政检查数量 -->
@ -1219,13 +1231,17 @@
and r.enterprise_number is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
<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= "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 != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<!-- 联合检查数量统计 -->
<!-- 联合检查数量统计 -->
@ -1244,7 +1260,7 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
and ( r.union_no IS NOT NULL and r.union_no != '')
and r.union_no IS NOT NULL and r.union_no != ''
<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= "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 != ''" >
<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})
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})
@ -1252,8 +1268,12 @@
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
GROUP BY union_no
GROUP BY union_no
HAVING COUNT(1) > 1
HAVING COUNT(1) > 1
) AS t
) AS t
</select>
</select>
<select id= "analysis_enterprises_union_rr" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprises_union_rr" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1283,8 +1303,12 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
GROUP BY union_no
GROUP BY union_no
HAVING COUNT(1) > 1
HAVING COUNT(1) > 1
) AS t
) AS t
</select>
</select>
<select id= "analysis_enterprises_union_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprises_union_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1314,16 +1338,72 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
GROUP BY union_no
GROUP BY union_no
HAVING COUNT(1) > 1
HAVING COUNT(1) > 1
) AS t
) AS t
</select>
</select>
<!-- 单条检查数量统计 -->
<!-- 单条检查数量统计 -->
<select id= "analysis_enterprises_single" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_enterprises_single" parameterType= "SixAnalysisParams" resultType= "integer" >
SELECT count(1)
select
FROM enforcement_registration r
(select count(1) from enforcement_registration r
WHERE r.bureau_dept_name is not null
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no is null or r.union_no = '')
<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= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
)+(
select count(1) as _count from (select 1 from enforcement_registration r
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.union_no is not null and r.union_no != ''
<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= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
GROUP BY r.union_no HAVING COUNT(1) < 2) as t
)
</select>
<select id= "analysis_enterprises_single_rr" parameterType= "SixAnalysisParams" resultType= "double" >
select
(select count(1) from enforcement_registration r
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_name is not null
@ -1333,19 +1413,25 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
and r.has_union = 1
and (r.union_no is null or r.union_no = '')
<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= "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 != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" >
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</select>
</if>
<select id= "analysis_enterprises_single_rr" parameterType= "SixAnalysisParams" resultType= "double" >
<if test= "endTime != null and endTime != ''" >
SELECT count(1)
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
FROM enforcement_registration r
</if>
WHERE r.bureau_dept_name is not null
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
)+(
select count(1) as _count from (select 1 from enforcement_registration r
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_name is not null
@ -1355,8 +1441,8 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
and r.has_union = 1
and r.union_no is not null and r.union_no != ''
<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= "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 != ''" >
<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})
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>
@ -1367,14 +1453,17 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</if>
GROUP BY union_no
<if test= "params.dataScope != null and params.dataScope != ''" >
HAVING COUNT(1) > 1
<!-- 数据范围过滤 -->
) AS t;
${params.dataScope}
</if>
GROUP BY r.union_no HAVING COUNT(1) < 2) as t
)
</select>
</select>
<select id= "analysis_enterprises_single_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprises_single_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
SELECT count(1)
select
FROM enforcement_registration r
(select count(1) from enforcement_registration r
WHERE r.bureau_dept_name is not null
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_name is not null
@ -1384,8 +1473,8 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
and r.has_union = 1
and (r.union_no is null or r.union_no = '')
<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= "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 != ''" >
<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})
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>
@ -1396,9 +1485,40 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
GROUP BY union_no
<if test= "params.dataScope != null and params.dataScope != ''" >
HAVING COUNT(1) > 1
<!-- 数据范围过滤 -->
) AS t;
${params.dataScope}
</if>
)+(
select count(1) as _count from (select 1 from enforcement_registration r
where r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.union_no is not null and r.union_no != ''
<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= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" >
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
GROUP BY r.union_no HAVING COUNT(1) < 2) as t
)
</select>
</select>
<select id= "analysis_non_enterprisesIns" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_non_enterprisesIns" parameterType= "SixAnalysisParams" resultType= "integer" >
@ -1420,6 +1540,10 @@
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_enterprisesIns_all" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_enterprisesIns_all" parameterType= "SixAnalysisParams" resultType= "integer" >
select
select
@ -1444,6 +1568,10 @@
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<!-- 检查预告 -->
<!-- 检查预告 -->
<select id= "analysis_insNotice" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_insNotice" parameterType= "SixAnalysisParams" resultType= "integer" >
@ -1460,6 +1588,10 @@
<if test= "isReg != null" > and is_reg=#{isReg} </if>
<if test= "isReg != null" > and is_reg=#{isReg} </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<select id= "analysis_insNotice_rr" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_insNotice_rr" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1479,6 +1611,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(n.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(n.enforcement_time,'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<select id= "analysis_insNotice_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_insNotice_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1498,6 +1634,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<!-- 涉企投诉 -->
<!-- 涉企投诉 -->
@ -1507,15 +1647,19 @@
and (c.rid is not null or c.complaint_department_id is not null)
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enforce_type is not null
and c.enterprise_number is not null
and c.enterprise_number is not null
<if test= "params.zone != null and params.zone != ''" >
<!-- <if test="params.zone != null and params.zone != ''"> -- >
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
<!-- and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone}) -->
</if >
<!-- </if> -- >
<if test= "deptId != null and deptId != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<select id= "analysis_enterprisesComplaint_rr" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprisesComplaint_rr" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1537,6 +1681,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(c.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(c.enforcement_time,'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<select id= "analysis_enterprisesComplaint_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprisesComplaint_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
@ -1558,6 +1706,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
</select>
</select>
<!-- 被查企业 -->
<!-- 被查企业 -->
@ -1584,6 +1736,10 @@
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_enterprises_rr" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprises_rr" parameterType= "SixAnalysisParams" resultType= "double" >
select
select
@ -1612,6 +1768,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_enterprises_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
<select id= "analysis_enterprises_yoy" parameterType= "SixAnalysisParams" resultType= "double" >
select
select
@ -1640,6 +1800,10 @@
<if test= "endTime != null and endTime != ''" >
<if test= "endTime != null and endTime != ''" >
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<select id= "analysis_non_enterprises" parameterType= "SixAnalysisParams" resultType= "integer" >
<select id= "analysis_non_enterprises" parameterType= "SixAnalysisParams" resultType= "integer" >
select
select
@ -1653,13 +1817,17 @@
and r.law_enforcer_id_other is not null
and r.law_enforcer_id_other is not null
and r.law_enforcement_type is not null
and r.law_enforcement_type is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
<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= "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 != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
</select>
<!-- 企业总数 -->
<!-- 企业总数 -->
@ -1698,15 +1866,19 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
<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= "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 != ''" >
<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})
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>
<if test= "uniteCheck == '1'.toString()" > and (r.union_no is not null and r.union_no != '')</if>
<if test= "uniteCheck == '1'.toString()" > and (r.union_no is not null and r.union_no != '')</if>
<if test= "uniteCheck == '0'.toString()" > and (r.union_no is null or r.union_no = '')</if>
<if test= "uniteCheck == '0'.toString()" > and (r.union_no is null or r.union_no = '')</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
</select>
</select>
@ -1723,13 +1895,17 @@
and r.law_enforcer_id_other is not null
and r.law_enforcer_id_other is not null
and r.law_enforcement_type is not null
and r.law_enforcement_type is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
<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= "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 != ''" >
<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})
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>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
</select>
</select>
<!-- 企业 -->
<!-- 企业 -->
@ -1748,15 +1924,19 @@
and r.is_complaint is not null
and r.is_complaint is not null
and r.check_category is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.bureau_dept_id is not null
<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= "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 != ''" >
<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})
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>
<if test= "uniteCheck == '1'.toString()" > and (r.union_no is not null and r.union_no != '')</if>
<if test= "uniteCheck == '1'.toString()" > and (r.union_no is not null and r.union_no != '')</if>
<if test= "uniteCheck == '0'.toString()" > and (r.union_no is null or r.union_no = '')</if>
<if test= "uniteCheck == '0'.toString()" > and (r.union_no is null or r.union_no = '')</if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if >
<!-- <if test= "userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if> -- >
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
</select>
</select>
@ -1767,6 +1947,14 @@
left join non_enforcement_registration nr on nr.law_enforcement_type = sdd.dict_value
left join non_enforcement_registration nr on nr.law_enforcement_type = sdd.dict_value
<where >
<where >
and sdd.dict_type = 'no_check_category'
and sdd.dict_type = 'no_check_category'
and nr.bureau_dept_name is not null
and nr.dept_id is not null
and nr.enterprise_name is not null
and nr.enterprise_number is not null
and nr.law_enforcer_id is not null
and nr.law_enforcer_id_other is not null
and nr.law_enforcement_type is not null
and nr.bureau_dept_id is not null
<if test= "params.zone != null and params.zone != ''" > and nr.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test= "params.zone != null and params.zone != ''" > and nr.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
and nr.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
and nr.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
@ -1776,8 +1964,12 @@
<if test= "userId != null and userId != '' " > and( nr.law_enforcer_id=#{userId} or nr.law_enforcer_id_two=#{userId}) </if>
<if test= "userId != null and userId != '' " > and( nr.law_enforcer_id=#{userId} or nr.law_enforcer_id_two=#{userId}) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
group by sdd.dict_value
group by nr.law_enforcement_type order by sdd.dict_sort asc
</select>
</select>
<!-- 行政检查类型统计 -->
<!-- 行政检查类型统计 -->
@ -1786,8 +1978,17 @@
left join enforcement_registration r on r.check_category = sdd.dict_value
left join enforcement_registration r on r.check_category = sdd.dict_value
<where >
<where >
and sdd.dict_type = 'check_category'
and sdd.dict_type = 'check_category'
and r.bureau_dept_name is not null
and r.is_submit = 1
and r.is_submit = 1
<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>
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<!-- <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 != ''" >
<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})
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>
@ -1796,7 +1997,11 @@
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test= "userId != null and userId != '' " > and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "beginTime != null and beginTime != ''" > and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "endTime != null and endTime != ''" > and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
<if test= "params.dataScope != null and params.dataScope != ''" >
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
</where>
group by sdd.dict_value
group by r.check_category
</select>
</select>
</mapper>
</mapper>