|
|
|
@ -52,6 +52,9 @@ |
|
|
|
<if test="code !=null and code!=''"> |
|
|
|
and t3.code = #{code} |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null and enterpriseNumber !=''"> |
|
|
|
and t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -70,6 +73,12 @@ |
|
|
|
<if test="dayTime !=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{dayTime},'%Y-%m-%d') |
|
|
|
</if> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') = DATE_FORMAT(#{monthTime},'%Y-%m-%d') |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null and enterpriseNumber !=''"> |
|
|
|
and t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if> |
|
|
|
<if test="code !=null and code!=''"> |
|
|
|
and t3.code = #{code} |
|
|
|
</if> |
|
|
|
@ -299,6 +308,12 @@ |
|
|
|
<if test="code !=null and code!=''"> |
|
|
|
and t3.code = #{code} |
|
|
|
</if> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time,'%Y-%m') = DATE_FORMAT(#{monthTime},'%Y-%m') |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null and enterpriseNumber !=''"> |
|
|
|
and t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if>" |
|
|
|
</where> |
|
|
|
GROUP BY t1.union_no |
|
|
|
HAVING COUNT(1) > 1 |
|
|
|
@ -804,4 +819,594 @@ |
|
|
|
t3.code , |
|
|
|
t3.name |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取行政检查案件数(月) --> |
|
|
|
<select id="getCheckCaseCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
count(1) xzjcajs |
|
|
|
from |
|
|
|
sxt_jcdzb107522 t1 |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.INSPECTION_END_DATE,'%Y-%m')= DATE_FORMAT(#{monthTime},'%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取行政处罚案件数 (月) --> |
|
|
|
<select id="getPenaltyCaseCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
count(1) as xzcfajs |
|
|
|
from |
|
|
|
sxt_xzcfajjbxx026705 t1 |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取行政强制案件数 (月) --> |
|
|
|
<select id="getCompulsoryCaseCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
count(1) as xzcfajs |
|
|
|
from |
|
|
|
sxt_xzcfajjbxx026705 t1 |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取各区行政检查数,案件数(月) --> |
|
|
|
<select id="getAreaEnfRegistrationAndCaseCount" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
t1.name , |
|
|
|
IFNULL(t2.zfajs, 0) as zfajs, |
|
|
|
IFNULL(t3.xzzfs, 0) as xzzfs |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t1.name, |
|
|
|
sum(t1.sl) zfajs |
|
|
|
from |
|
|
|
( |
|
|
|
select |
|
|
|
t1.district_name as name, |
|
|
|
count(t1.case_code) as sl |
|
|
|
from |
|
|
|
( |
|
|
|
select |
|
|
|
t.case_code, |
|
|
|
case |
|
|
|
when t.inspection_addr_code = '罗湖区' or left(t.inspection_addr_code, 6) = '440303' then '罗湖区' |
|
|
|
when t.inspection_addr_code = '福田区' or left(t.inspection_addr_code, 6) = '440304' then '福田区' |
|
|
|
when t.inspection_addr_code = '南山区' or left(t.inspection_addr_code, 6) = '440305' then '南山区' |
|
|
|
when t.inspection_addr_code = '宝安区' or left(t.inspection_addr_code, 6) = '440306' then '宝安区' |
|
|
|
when t.inspection_addr_code = '龙岗区' or left(t.inspection_addr_code, 6) = '440307' then '龙岗区' |
|
|
|
when t.inspection_addr_code = '盐田区' or left(t.inspection_addr_code, 6) = '440308' then '盐田区' |
|
|
|
when t.inspection_addr_code = '龙华区' or left(t.inspection_addr_code, 6) = '440309' then '龙华区' |
|
|
|
when t.inspection_addr_code = '坪山区' or left(t.inspection_addr_code, 6) = '440310' then '坪山区' |
|
|
|
when t.inspection_addr_code = '光明区' or left(t.inspection_addr_code, 6) = '440311' then '光明区' |
|
|
|
when t.inspection_addr_code = '深圳市' or left(t.inspection_addr_code, 6) = '440300' then '深圳市' |
|
|
|
when t.inspection_addr_code = '深汕特别合作区' or left(t.inspection_addr_code, 6) = '441521' then '深汕特别合作区' |
|
|
|
when t.inspection_addr_code = '大鹏新区' then '大鹏新区' |
|
|
|
else '未知区域' |
|
|
|
end as district_name |
|
|
|
from |
|
|
|
sxt_jcdzb107522 t |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t.INSPECTION_END_DATE, '%Y-%m')= DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
) t1 |
|
|
|
group by |
|
|
|
t1.district_name |
|
|
|
union all |
|
|
|
select |
|
|
|
t1.name, |
|
|
|
count(t3.c201001) as sl |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.code = t2.area_node |
|
|
|
left join sxt_xzcfajjbxx026705 t3 on |
|
|
|
t2.dept_name = t3.C201003 |
|
|
|
<where> |
|
|
|
t1.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.name |
|
|
|
union all |
|
|
|
select |
|
|
|
t1.name, |
|
|
|
count(t3.c301003) as sl |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.code = t2.area_node |
|
|
|
left join sxt_xzqzjbxx173774 t3 on |
|
|
|
t2.dept_name = t3.c301004 |
|
|
|
<where> |
|
|
|
t1.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.add_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.name) t1 |
|
|
|
group by |
|
|
|
t1.name )t2 |
|
|
|
on |
|
|
|
t1.name = t2.name |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t3.name, |
|
|
|
count(1) as xzzfs |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.bureau_dept_id = t2.dept_id |
|
|
|
left join dashboard_area_info t3 on |
|
|
|
t2.area_node = t3.code |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_name is not null |
|
|
|
and t1.enterprise_number is not null |
|
|
|
and t3.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.name ) t3 |
|
|
|
on |
|
|
|
t1.name = t3.name |
|
|
|
where |
|
|
|
t1.`level` = 3 |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取各区行政检查数,案件数明细(月) --> |
|
|
|
<select id="getAreaEnfRegistrationAndCaseCountDetails" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
t1.name, |
|
|
|
IFNULL(t5.xzzfs, 0) as xzzfs, |
|
|
|
IFNULL(t2.xzjcajs, 0) as xzjcajs, |
|
|
|
IFNULL(t3.xzcfajs, 0) as xzcfajs, |
|
|
|
IFNULL(t4.xzqzajs, 0) as xzqzajs |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t1.district_name as name, |
|
|
|
count(t1.case_code) as xzjcajs |
|
|
|
from |
|
|
|
( |
|
|
|
select |
|
|
|
t.case_code, |
|
|
|
case |
|
|
|
when t.inspection_addr_code = '罗湖区' or left(t.inspection_addr_code, 6) = '440303' then '罗湖区' |
|
|
|
when t.inspection_addr_code = '福田区' or left(t.inspection_addr_code, 6) = '440304' then '福田区' |
|
|
|
when t.inspection_addr_code = '南山区' or left(t.inspection_addr_code, 6) = '440305' then '南山区' |
|
|
|
when t.inspection_addr_code = '宝安区' or left(t.inspection_addr_code, 6) = '440306' then '宝安区' |
|
|
|
when t.inspection_addr_code = '龙岗区' or left(t.inspection_addr_code, 6) = '440307' then '龙岗区' |
|
|
|
when t.inspection_addr_code = '盐田区' or left(t.inspection_addr_code, 6) = '440308' then '盐田区' |
|
|
|
when t.inspection_addr_code = '龙华区' or left(t.inspection_addr_code, 6) = '440309' then '龙华区' |
|
|
|
when t.inspection_addr_code = '坪山区' or left(t.inspection_addr_code, 6) = '440310' then '坪山区' |
|
|
|
when t.inspection_addr_code = '光明区' or left(t.inspection_addr_code, 6) = '440311' then '光明区' |
|
|
|
when t.inspection_addr_code = '深圳市' or left(t.inspection_addr_code, 6) = '440300' then '深圳市' |
|
|
|
when t.inspection_addr_code = '深汕特别合作区' or left(t.inspection_addr_code, 6) = '441521' then '深汕特别合作区' |
|
|
|
when t.inspection_addr_code = '大鹏新区' then '大鹏新区' |
|
|
|
else '未知区域' |
|
|
|
end as district_name |
|
|
|
from |
|
|
|
sxt_jcdzb107522 t |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t.INSPECTION_END_DATE, '%Y-%m')= DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
) t1 |
|
|
|
group by |
|
|
|
t1.district_name |
|
|
|
) t2 on t1.name=t2.name |
|
|
|
left join |
|
|
|
(select |
|
|
|
t1.name, |
|
|
|
count(t3.c201001) as xzcfajs |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.code = t2.area_node |
|
|
|
left join sxt_xzcfajjbxx026705 t3 on |
|
|
|
t2.dept_name = t3.C201003 |
|
|
|
<where> |
|
|
|
t1.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.name) t3 on t1.name=t3.name |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t1.name, |
|
|
|
count(t3.c301003) as xzqzajs |
|
|
|
from |
|
|
|
dashboard_area_info t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.code = t2.area_node |
|
|
|
left join sxt_xzqzjbxx173774 t3 on |
|
|
|
t2.dept_name = t3.c301004 |
|
|
|
<where> |
|
|
|
t1.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.add_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.name) t4 on t1.name =t4.name |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t3.name, |
|
|
|
count(1) as xzzfs |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.bureau_dept_id = t2.dept_id |
|
|
|
left join dashboard_area_info t3 on |
|
|
|
t2.area_node = t3.code |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_name is not null |
|
|
|
and t1.enterprise_number is not null |
|
|
|
and t3.`level` = 3 |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m') = DATE_FORMAT(#{monthTime},'%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.name ) t5 |
|
|
|
on t1.name = t5.name |
|
|
|
where t1.level=3 |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 获取领域行政执法数,行政执法案件数(月) --> |
|
|
|
<select id="getFieldEnfRegistrationAndCaseCount" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
distinct |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
IFNULL(t2.zfajs, 0) as zfajs, |
|
|
|
IFNULL(t3.xzzfs, 0) as xzzfs |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join ( |
|
|
|
select |
|
|
|
t1.code , |
|
|
|
t1.name , |
|
|
|
SUM(T1.sl) as zfajs |
|
|
|
from |
|
|
|
( |
|
|
|
<!-- 行政检查--> |
|
|
|
select |
|
|
|
t3.domain_id as code, |
|
|
|
t3.domain_name as name, |
|
|
|
count(t1.CASE_CODE) as sl |
|
|
|
from |
|
|
|
sxt_jcdzb107522 t1 |
|
|
|
inner join sys_dept t2 on |
|
|
|
t1.SUB_NAME = t2.dept_name |
|
|
|
inner join dashboard_domain_dept t3 on |
|
|
|
t2.dept_id = t3.dept_id |
|
|
|
<where> |
|
|
|
<if test="monthTime !=null"> |
|
|
|
and DATE_FORMAT(t1.INSPECTION_END_DATE, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.domain_id , |
|
|
|
t3.domain_name |
|
|
|
union all |
|
|
|
<!-- 行政处罚--> |
|
|
|
select |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
count(t3.c201001) as sl |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.dept_id = t2.dept_id |
|
|
|
left join sxt_xzcfajjbxx026705 t3 on |
|
|
|
t2.dept_name = t3.C201003 |
|
|
|
<where> |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.domain_id , |
|
|
|
t1.domain_name |
|
|
|
union all |
|
|
|
<!-- 行政强制--> |
|
|
|
select |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
count(t3.c301003) as sl |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.dept_id = t2.dept_id |
|
|
|
left join sxt_xzqzjbxx173774 t3 on |
|
|
|
t2.dept_name = t3.c301004 |
|
|
|
<where> |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.add_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.domain_id , |
|
|
|
t1.domain_name) t1 |
|
|
|
group by |
|
|
|
t1.code , |
|
|
|
t1.name )t2 |
|
|
|
on |
|
|
|
t1.domain_id = t2.code |
|
|
|
left join ( |
|
|
|
<!-- 行政执法--> |
|
|
|
select |
|
|
|
t3.domain_id as code, |
|
|
|
t3.domain_name as name, |
|
|
|
count(1) as xzzfs |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
inner join sys_dept t2 on |
|
|
|
t1.bureau_dept_id = t2.dept_id |
|
|
|
inner join dashboard_domain_dept t3 on |
|
|
|
t2.dept_id = t3.dept_id |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_name is not null |
|
|
|
and t1.enterprise_number is not null |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.domain_id , |
|
|
|
t3.domain_name) t3 |
|
|
|
on |
|
|
|
t1.domain_id = t3.code |
|
|
|
</select> |
|
|
|
<!-- 获取领域行政执法数,行政执法案件数明细(月) --> |
|
|
|
<select id="getFieldEnfRegistrationAndCaseCountDetails" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
distinct |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
IFNULL(t2.xzjcajs, 0) as xzjcajs, |
|
|
|
IFNULL(t3.xzcfajs, 0) as xzcfajs, |
|
|
|
IFNULL(t4.xzqzajs, 0) as xzqzajs, |
|
|
|
IFNULL(t5.xzzfs, 0) as xzzfs |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join ( |
|
|
|
<!--行政检查--> |
|
|
|
select |
|
|
|
t3.domain_id as code, |
|
|
|
t3.domain_name as name, |
|
|
|
count(t1.CASE_CODE) as xzjcajs |
|
|
|
from |
|
|
|
sxt_jcdzb107522 t1 |
|
|
|
inner join sys_dept t2 on |
|
|
|
t1.SUB_NAME = t2.dept_name |
|
|
|
inner join dashboard_domain_dept t3 on |
|
|
|
t2.dept_id = t3.dept_id |
|
|
|
<where> |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.INSPECTION_END_DATE, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.domain_id , |
|
|
|
t3.domain_name) t2 |
|
|
|
on |
|
|
|
t1.domain_id = t2.code |
|
|
|
left join ( |
|
|
|
<!-- 行政处罚--> |
|
|
|
select |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
count(t3.c201001) as xzcfajs |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.dept_id = t2.dept_id |
|
|
|
left join sxt_xzcfajjbxx026705 t3 on |
|
|
|
t2.dept_name = t3.C201003 |
|
|
|
<where> |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.c201010, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.domain_id , |
|
|
|
t1.domain_name) t3 |
|
|
|
on |
|
|
|
t1.domain_id = t3.code |
|
|
|
left join ( |
|
|
|
<!-- 行政强制--> |
|
|
|
select |
|
|
|
t1.domain_id as code, |
|
|
|
t1.domain_name as name, |
|
|
|
count(t3.c301003) as xzqzajs |
|
|
|
from |
|
|
|
dashboard_domain_dept t1 |
|
|
|
left join sys_dept t2 on |
|
|
|
t1.dept_id = t2.dept_id |
|
|
|
left join sxt_xzqzjbxx173774 t3 on |
|
|
|
t2.dept_name = t3.c301004 |
|
|
|
<where> |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t3.add_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.domain_id , |
|
|
|
t1.domain_name) t4 |
|
|
|
on |
|
|
|
t1.domain_id = t4.code |
|
|
|
left join ( |
|
|
|
<!-- 行政执法--> |
|
|
|
select |
|
|
|
t3.domain_id as code, |
|
|
|
t3.domain_name as name, |
|
|
|
count(1) as xzzfs |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
inner join sys_dept t2 on |
|
|
|
t1.bureau_dept_id = t2.dept_id |
|
|
|
inner join dashboard_domain_dept t3 on |
|
|
|
t2.dept_id = t3.dept_id |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_name is not null |
|
|
|
and t1.enterprise_number is not null |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t3.domain_id , |
|
|
|
t3.domain_name) t5 |
|
|
|
on |
|
|
|
t1.domain_id = t5.code |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取重点企业数(月) --> |
|
|
|
<select id="getKeyEnterprises" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
select |
|
|
|
t2.enterprise_number as enterpriseNumber, |
|
|
|
t2.enterprise_name as enterpriseName, |
|
|
|
t1.enterprise_address as enterpriseAddress, |
|
|
|
t2.xzzfs |
|
|
|
from |
|
|
|
enterprise_information t1 |
|
|
|
inner join ( |
|
|
|
select |
|
|
|
t1.enterprise_number , |
|
|
|
t1.enterprise_name, |
|
|
|
count(1)as xzzfs |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_number is not null |
|
|
|
and t1.enterprise_name is not null |
|
|
|
<if test="monthTime!=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
group by |
|
|
|
t1.enterprise_number , |
|
|
|
t1.enterprise_name |
|
|
|
order by |
|
|
|
xzzfs desc |
|
|
|
limit 100) t2 |
|
|
|
on |
|
|
|
t1.enterprise_number = t2.enterprise_number |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--获取重点企业行政执法明细(日) --> |
|
|
|
<select id="getKeyEnterpriseEnfRegDetails" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo" > |
|
|
|
select |
|
|
|
t1.enterprise_number as enterpriseNumber, |
|
|
|
t1.enterprise_name as enterpriseName, |
|
|
|
t1.law_enforcement as lawEnforcement, |
|
|
|
t1.law_enforcer as lawEnforcer, |
|
|
|
t1.law_enforcer_two as lawEnforcerTwo, |
|
|
|
t1.law_enforcement_item_text as lawEnforcementItemText, |
|
|
|
t1.enforcement_time as enforcementTime |
|
|
|
from |
|
|
|
enforcement_registration t1 |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
and t1.is_submit = 1 |
|
|
|
and t1.enterprise_number is not null |
|
|
|
and t1.enterprise_name is not null |
|
|
|
<if test="dayTime !=null"> |
|
|
|
and DATE_FORMAT(t1.enforcement_time, '%Y-%m-%d') = DATE_FORMAT(#{dayTime}, '%Y-%m-%d') |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null"> |
|
|
|
and t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取涉企登记趋势(月) --> |
|
|
|
<select id="getEnfRegistrationTrend" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo"> |
|
|
|
SELECT |
|
|
|
enterprise_number as enterpriseNumber, |
|
|
|
enterprise_name as enterpriseName, |
|
|
|
stat_month as statMonth, |
|
|
|
SUM(xzzfs) AS xzzfs, |
|
|
|
SUM(lhzfs) AS lhzfs, |
|
|
|
SUM(fxzzfs) AS fxzzfs |
|
|
|
FROM ( |
|
|
|
SELECT |
|
|
|
t1.enterprise_number, |
|
|
|
t1.enterprise_name, |
|
|
|
DATE_FORMAT(t1.enforcement_time , '%Y-%m') AS stat_month, |
|
|
|
1 AS xzzfs, |
|
|
|
IF(t1.has_union = 1 AND t1.union_no IS NOT NULL, 1, 0) AS lhzfs, |
|
|
|
0 AS fxzzfs |
|
|
|
FROM |
|
|
|
enforcement_registration t1 |
|
|
|
<where> |
|
|
|
t1.is_delete = 0 |
|
|
|
AND t1.is_submit = 1 |
|
|
|
AND t1.enterprise_number IS NOT NULL |
|
|
|
AND t1.enterprise_name IS NOT NULL |
|
|
|
<if test="monthTime !=null"> |
|
|
|
AND DATE_FORMAT(t1.enforcement_time , '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null"> |
|
|
|
AND t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
t1.enterprise_number, |
|
|
|
t1.enterprise_name, |
|
|
|
DATE_FORMAT(t1.enforcement_time , '%Y-%m') AS stat_month, |
|
|
|
0 AS xzzfs, |
|
|
|
0 AS lhzfs, |
|
|
|
1 AS fxzzfs |
|
|
|
FROM |
|
|
|
non_enforcement_registration t1 |
|
|
|
<where> |
|
|
|
t1.has_delete = 0 |
|
|
|
<if test="monthTime !=null"> |
|
|
|
AND DATE_FORMAT(t1.enforcement_time , '%Y-%m') = DATE_FORMAT(#{monthTime}, '%Y-%m') |
|
|
|
</if> |
|
|
|
<if test="enterpriseNumber !=null"> |
|
|
|
AND t1.enterprise_number = #{enterpriseNumber} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
) temp |
|
|
|
GROUP BY enterprise_number, enterprise_name, stat_month |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|
|