SELECT r.law_field, CAST(COUNT(1) AS CHAR) AS cnt FROM enforcement_registration r WHERE enforcement_time IS NOT null and 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 law_field is not null
<!--SELECT r.law_field, CAST(COUNT(1) AS CHAR) AS cnt FROM enforcement_registration r
WHERE enforcement_time IS NOT null
and 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 law_field is not null-->
select
r.bureau_dept_id,
case r.bureau_dept_id
when '20210922213242905-1183-F9897C287' then '01'
when '20210922213242781-25B8-DF4A0AB32' then '02'
when '20210922213015633-2458-5A5E07C0C' then '03'
when '20210922213015704-F9CB-3AFDBC097' then '04'
when '20210922213015633-2459-6D7CB4903' then '05'
when '20210922212956790-EDA0-123260206' then '06'
when '20210922213220191-2F55-3493B378E' then '07'
when '20221024170151446-F82B-F4F56D018' then '08'
when '20210922213219489-1142-3C752622D' then '09'
else ''
end as law_field,
CAST(count(1) AS CHAR) AS cnt
from
enforcement_registration r
<where>
and r.is_submit = 1
and r.is_delete =0
and enforcement_time IS NOT null
and r.bureau_dept_name is not null
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.bureau_dept_id in (
'20210922213242905-1183-F9897C287',
'20210922213242781-25B8-DF4A0AB32',
'20210922213015633-2458-5A5E07C0C',
'20210922213015704-F9CB-3AFDBC097',
'20210922213015633-2459-6D7CB4903',
'20210922212956790-EDA0-123260206',
'20210922213220191-2F55-3493B378E',
'20221024170151446-F82B-F4F56D018',
'20210922213219489-1142-3C752622D'
)
<iftest="beginTime != null and beginTime != ''"> and r.enforcement_time >= #{beginTime} </if>
<iftest="beginTime != null and beginTime != ''"> and r.enforcement_time >= #{beginTime} </if>
<iftest="endTime != null and endTime != ''"> and r.enforcement_time < #{endTime} </if>
<iftest="endTime != null and endTime != ''"> and r.enforcement_time <= #{endTime} </if>
<iftest="zone == 1">and r.zone = 1</if>
<iftest="zone == 1">and r.zone = 1</if>
<iftest="filterDepts != null and filterDepts.size() > 0">
<iftest="filterDepts != null and filterDepts.size() > 0">
and r.bureau_dept_id in <foreachcollection="filterDepts"item="bureau_dept_id"open="("separator=","close=")"> #{bureau_dept_id} </foreach>
and r.bureau_dept_id in <foreachcollection="filterDepts"item="bureau_dept_id"open="("separator=","close=")"> #{bureau_dept_id} </foreach>
</if>
</if>
<iftest="params.dataScope != null and params.dataScope != ''"> ${params.dataScope} </if>
<iftest="params.dataScope != null and params.dataScope != ''"> ${params.dataScope} </if>