|
|
@ -438,136 +438,156 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEnforcementRegistrationList" parameterType="com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
|
|
<select id="selectEnforcementRegistrationList" parameterType="com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
|
|
select |
|
|
SELECT * FROM ( |
|
|
* |
|
|
SELECT |
|
|
from |
|
|
er.id, |
|
|
( |
|
|
er.law_enforcement, |
|
|
select |
|
|
er.law_enforcement_id, |
|
|
id, |
|
|
er.enforce, |
|
|
law_enforcement, |
|
|
er.enterprise_id, |
|
|
law_enforcement_id, |
|
|
er.enterprise_name, |
|
|
enforce, |
|
|
er.enterprise_number, |
|
|
enterprise_id, |
|
|
er.enforcement_time, |
|
|
enterprise_name, |
|
|
er.create_time, |
|
|
enterprise_number, |
|
|
er.create_by, |
|
|
enforcement_time, |
|
|
er.law_enforcer, |
|
|
create_time, |
|
|
er.law_enforcer_id, |
|
|
create_by, |
|
|
er.law_enforcer_tel, |
|
|
law_enforcer, |
|
|
er.law_enforcer_two, |
|
|
law_enforcer_id, |
|
|
er.law_enforcer_id_two, |
|
|
law_enforcer_tel, |
|
|
er.law_enforcer_tel_two, |
|
|
law_enforcer_two, |
|
|
er.subsidiaryer, |
|
|
law_enforcer_id_two, |
|
|
er.subsidiaryer_id, |
|
|
law_enforcer_tel_two, |
|
|
er.subsidiaryer_tel, |
|
|
subsidiaryer, |
|
|
er.law_enforcement_item, |
|
|
subsidiaryer_id, |
|
|
er.law_enforcement_item_text, |
|
|
subsidiaryer_tel, |
|
|
er.law_enforcement_basis, |
|
|
law_enforcement_item, |
|
|
er.law_enforcement_basis_text, |
|
|
law_enforcement_item_text, |
|
|
er.remark, |
|
|
law_enforcement_basis, |
|
|
er.reslut, |
|
|
law_enforcement_basis_text, |
|
|
er.user_id, |
|
|
remark, |
|
|
er.dept_id, |
|
|
reslut, |
|
|
er.is_delete, |
|
|
user_id, |
|
|
er.status, |
|
|
dept_id, |
|
|
er.law_enforcement_code, |
|
|
is_delete, |
|
|
er.is_complaint, |
|
|
status, |
|
|
er.is_submit, |
|
|
law_enforcement_code, |
|
|
er.unite_check, |
|
|
is_complaint, |
|
|
er.check_css, |
|
|
is_submit, |
|
|
er.enforce_reason, |
|
|
unite_check, |
|
|
er.law_field, |
|
|
check_css, |
|
|
er.check_category, |
|
|
enforce_reason, |
|
|
er.bureau_dept_id, |
|
|
law_field, |
|
|
er.bureau_dept_name, |
|
|
check_category, |
|
|
er.is_evaluate, |
|
|
bureau_dept_id, |
|
|
er.law_id, |
|
|
bureau_dept_name, |
|
|
er.law_text, |
|
|
is_evaluate, |
|
|
COALESCE(ent_count.cnt, 0) as num |
|
|
law_id, |
|
|
FROM enforcement_registration er |
|
|
law_text, |
|
|
LEFT JOIN ( |
|
|
count(enterprise_number) as num |
|
|
SELECT enterprise_number, COUNT(*) as cnt |
|
|
from |
|
|
FROM enforcement_registration |
|
|
enforcement_registration |
|
|
WHERE is_submit = 1 |
|
|
<where> |
|
|
<if test="bo.isDelete != null"> |
|
|
and is_submit=1 |
|
|
AND is_delete = #{bo.isDelete} |
|
|
<if test="bo.enterpriseId != null and bo.enterpriseId != ''"> and enterprise_id = #{bo.enterpriseId}</if> |
|
|
</if> |
|
|
<if test="bo.enterpriseName != null and bo.enterpriseName != ''"> and enterprise_name like concat('%', #{bo.enterpriseName}, '%')</if> |
|
|
<if test="bo.dateType != null and bo.dateType == 1"> |
|
|
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''"> and enterprise_number = #{bo.enterpriseNumber}</if> |
|
|
AND enforcement_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') |
|
|
<if test="bo.isDelete != null "> and is_delete = #{bo.isDelete}</if> |
|
|
</if> |
|
|
<if test="bo.status != null "> and status = #{bo.status}</if> |
|
|
<if test="bo.dateType != null and bo.dateType == 2"> |
|
|
<if test="bo.unionNo != null and bo.unionNo != ''"> and union_no = #{bo.unionNo}</if> |
|
|
AND enforcement_time >= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01') |
|
|
<if test="bo.hasUnion != null"> and has_union = #{bo.hasUnion}</if> |
|
|
</if> |
|
|
<if test="bo.isRealUnion != null"> and is_real_union = #{bo.isRealUnion}</if> |
|
|
<if test="bo.dateType != null and bo.dateType == 3"> |
|
|
<if test="bo.hasAuto != null"> and has_auto = #{bo.hasAuto}</if> |
|
|
AND enforcement_time >= CONCAT(YEAR(CURDATE()), '-01-01') |
|
|
<if test="bo.searchValue != null and bo.searchValue != ''"> |
|
|
</if> |
|
|
and ( enterprise_name like concat('%',#{bo.searchValue},'%'))</if> |
|
|
<if test="bo.beginTime != null and bo.beginTime != ''"> |
|
|
<if test="bo.dateSearch != null and bo.dateSearch != ''"> |
|
|
AND enforcement_time >= #{bo.beginTime} |
|
|
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch} |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.endTime != null and bo.endTime != ''"> |
|
|
<if test="bo.dateType != null and bo.dateType == 1"> |
|
|
AND enforcement_time <= #{bo.endTime} |
|
|
and DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
<if test="bo.dateType != null and bo.dateType == 2"> |
|
|
AND bureau_dept_id = #{bo.bureauDeptId} |
|
|
AND DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', |
|
|
</if> |
|
|
CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' |
|
|
GROUP BY enterprise_number |
|
|
WHEN QUARTER(CURDATE()) IN (2) THEN '04' |
|
|
) ent_count ON er.enterprise_number = ent_count.enterprise_number |
|
|
WHEN QUARTER(CURDATE()) IN (3) THEN '07' |
|
|
<where> |
|
|
ELSE '10' END) |
|
|
er.is_submit = 1 |
|
|
and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', |
|
|
<if test="bo.enterpriseId != null and bo.enterpriseId != ''"> |
|
|
CASE |
|
|
AND er.enterprise_id = #{bo.enterpriseId} |
|
|
WHEN QUARTER(CURDATE()) IN (1) THEN '03' |
|
|
</if> |
|
|
WHEN QUARTER(CURDATE()) IN (2) THEN '06' |
|
|
<if test="bo.enterpriseName != null and bo.enterpriseName != ''"> |
|
|
WHEN QUARTER(CURDATE()) IN (3) THEN '09' |
|
|
AND er.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%') |
|
|
ELSE '12' |
|
|
</if> |
|
|
END) |
|
|
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''"> |
|
|
</if> |
|
|
AND er.enterprise_number = #{bo.enterpriseNumber} |
|
|
<if test="bo.dateType != null and bo.dateType == 3"> |
|
|
</if> |
|
|
and DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y') |
|
|
<if test="bo.isDelete != null"> |
|
|
</if> |
|
|
AND er.is_delete = #{bo.isDelete} |
|
|
<if test="bo.dateSearch != null and bo.dateSearch != ''"> |
|
|
</if> |
|
|
and DATE_FORMAT(enforcement_time, '%Y-%m') = #{bo.dateSearch} |
|
|
<if test="bo.status != null"> |
|
|
</if> |
|
|
AND er.status = #{bo.status} |
|
|
<if test="bo.beginTime != null and bo.beginTime != ''"><!-- 开始时间检索 --> |
|
|
</if> |
|
|
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') >= #{bo.beginTime} |
|
|
<if test="bo.unionNo != null and bo.unionNo != ''"> |
|
|
</if> |
|
|
AND er.union_no = #{bo.unionNo} |
|
|
<if test="bo.endTime != null and bo.endTime != ''"><!-- 结束时间检索 --> |
|
|
</if> |
|
|
and DATE_FORMAT(enforcement_time,'%Y-%m-%d') <= #{bo.endTime} |
|
|
<if test="bo.hasUnion != null"> |
|
|
</if> |
|
|
AND er.has_union = #{bo.hasUnion} |
|
|
<if test="bo.params.beginTime != null and bo.params.beginTime != ''"><!-- 开始时间检索 --> |
|
|
</if> |
|
|
and enforcement_time >= #{bo.params.beginTime} |
|
|
<if test="bo.isRealUnion != null"> |
|
|
</if> |
|
|
AND er.is_real_union = #{bo.isRealUnion} |
|
|
<if test="bo.params.endTime != null and bo.params.endTime != ''"><!-- 结束时间检索 --> |
|
|
</if> |
|
|
and enforcement_time <= #{bo.params.endTime} |
|
|
<if test="bo.hasAuto != null"> |
|
|
</if> |
|
|
AND er.has_auto = #{bo.hasAuto} |
|
|
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')"> |
|
|
</if> |
|
|
and (law_enforcer_id = #{bo.userId} or user_id = #{bo.userId} or law_enforcer_id = #{bo.userId} or FIND_IN_SET(#{bo.userId}, law_enforcer_id_two)) |
|
|
<if test="bo.searchValue != null and bo.searchValue != ''"> |
|
|
</if> |
|
|
AND er.enterprise_name LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
</if> |
|
|
and bureau_dept_id = #{bo.bureauDeptId} |
|
|
<if test="bo.dateSearch != null and bo.dateSearch != ''"> |
|
|
</if> |
|
|
AND er.enforcement_time >= CONCAT(#{bo.dateSearch}, '-01') |
|
|
<!-- 注释掉数据权限过滤,避免 token 冻结导致的认证错误 --> |
|
|
AND er.enforcement_time < DATE_ADD(CONCAT(#{bo.dateSearch}, '-01'), INTERVAL 1 MONTH) |
|
|
<!-- <if test="bo.params.dataScope != null and bo.params.dataScope != ''"> |
|
|
</if> |
|
|
<!- - 数据范围过滤 - -> |
|
|
<if test="bo.dateType != null and bo.dateType == 1"> |
|
|
${bo.params.dataScope} |
|
|
AND er.enforcement_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') |
|
|
</if> --> |
|
|
</if> |
|
|
</where> |
|
|
<if test="bo.dateType != null and bo.dateType == 2"> |
|
|
GROUP BY enterprise_number order by enforcement_time desc) t |
|
|
AND er.enforcement_time >= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 3"> |
|
|
|
|
|
AND er.enforcement_time >= CONCAT(YEAR(CURDATE()), '-01-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.beginTime != null and bo.beginTime != ''"> |
|
|
|
|
|
AND er.enforcement_time >= #{bo.beginTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.endTime != null and bo.endTime != ''"> |
|
|
|
|
|
AND er.enforcement_time <= #{bo.endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.params.beginTime != null and bo.params.beginTime != ''"> |
|
|
|
|
|
AND er.enforcement_time >= #{bo.params.beginTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.params.endTime != null and bo.params.endTime != ''"> |
|
|
|
|
|
AND er.enforcement_time <= #{bo.params.endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')"> |
|
|
|
|
|
AND (er.law_enforcer_id = #{bo.userId} OR er.user_id = #{bo.userId} OR FIND_IN_SET(#{bo.userId}, er.law_enforcer_id_two)) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
|
|
|
AND er.bureau_dept_id = #{bo.bureauDeptId} |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
|
|
|
) t |
|
|
<where> |
|
|
<where> |
|
|
<if test="bo.numLeft != null and bo.numLeft != ''"> |
|
|
<if test="bo.numLeft != null and bo.numLeft != ''"> |
|
|
and t.num >= #{bo.numLeft} |
|
|
AND t.num >= #{bo.numLeft} |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.numRight != null and bo.numRight != ''"> |
|
|
<if test="bo.numRight != null and bo.numRight != ''"> |
|
|
and t.num <= #{bo.numRight} |
|
|
AND t.num <= #{bo.numRight} |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.num != null and bo.num != ''"> |
|
|
<if test="bo.num != null and bo.num != ''"> |
|
|
and t.num >= #{bo.num} |
|
|
AND t.num >= #{bo.num} |
|
|
</if> |
|
|
</if> |
|
|
<!-- <if test="bo.deptId != null and bo.warnType!=null and bo.warnType ==0" > |
|
|
|
|
|
and t.bureau_dept_id = #{bo.deptId} |
|
|
|
|
|
</if>--> |
|
|
|
|
|
<!-- 数据范围过滤 --> |
|
|
|
|
|
</where> |
|
|
</where> |
|
|
order by t.num desc |
|
|
ORDER BY t.num DESC, t.enforcement_time DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 统计当前用户作为执法人员的执法登记总数 --> |
|
|
<!-- 统计当前用户作为执法人员的执法登记总数 --> |
|
|
|