@ -84,7 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<iftest="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if>
<iftest="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer like concat('%',#{lawEnforcer} ,'%') or law_enforcer_two like concat('%',#{lawEnforcer} ,'%')</if>
<iftest="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if>
<iftest="lawEnforcerId != null and lawEnforcerId != ''">
<iftest="dataScopeId == null or dataScopeId == ''">
and law_enforcer_id = #{lawEnforcerId}
</if>
</if>
<iftest="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<iftest="lawEnforcerIdTwo != null and lawEnforcerIdTwo != ''"> and law_enforcer_id_two = #{lawEnforcerIdTwo}</if>
<iftest="lawEnforcerTelTwo != null and lawEnforcerTelTwo != ''"> and law_enforcer_tel_two = #{lawEnforcerTelTwo}</if>
@ -97,7 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if>
<iftest="reslut != null "> and reslut = #{reslut}</if>
<iftest="isSubmit != null "> and is_submit = #{isSubmit}</if>
<iftest="userId != null "> and user_id = #{userId}</if>
<iftest="userId != null">
<iftest="dataScopeId == null or dataScopeId == ''">
and user_id = #{userId}
</if>
</if>
<iftest="deptId != null "> and dept_id = #{deptId}</if>
<iftest="isDelete != null "> and is_delete = #{isDelete}</if>
<iftest="isComplaint != null "> and is_complaint = #{isComplaint}</if>
@ -155,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and enforcement_time <= #{params.endTime}
</if>
<iftest="dataScopeId != null and dataScopeId != ''">
and (law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
and (law_enforcer_id = #{dataScopeId} or user_id = #{dataScopeId} or law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
</if>
</where>
order by enforcement_time desc
@ -175,7 +183,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<iftest="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if>
<iftest="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer like concat('%',#{lawEnforcer} ,'%') or law_enforcer_two like concat('%',#{lawEnforcer} ,'%')</if>
<iftest="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if>
<iftest="lawEnforcerId != null and lawEnforcerId != ''">
<iftest="dataScopeId == null or dataScopeId == ''">
and law_enforcer_id = #{lawEnforcerId}
</if>
</if>
<iftest="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<iftest="lawEnforcerIdTwo != null and lawEnforcerIdTwo != ''"> and law_enforcer_id_two = #{lawEnforcerIdTwo}</if>
<iftest="lawEnforcerTelTwo != null and lawEnforcerTelTwo != ''"> and law_enforcer_tel_two = #{lawEnforcerTelTwo}</if>
@ -188,7 +200,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<iftest="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if>
<iftest="reslut != null "> and reslut = #{reslut}</if>
<iftest="isSubmit != null "> and is_submit = #{isSubmit}</if>
<iftest="userId != null "> and user_id = #{userId}</if>
<iftest="userId != null ">
<iftest="dataScopeId == null or dataScopeId == ''">
and user_id = #{userId}
</if>
</if>
<iftest="deptId != null "> and dept_id = #{deptId}</if>
<iftest="isDelete != null "> and is_delete = #{isDelete}</if>
<iftest="isComplaint != null "> and is_complaint = #{isComplaint}</if>
@ -246,7 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and enforcement_time <= #{params.endTime}
</if>
<iftest="dataScopeId != null and dataScopeId != ''">
and (law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
and (law_enforcer_id = #{dataScopeId} or user_id = #{dataScopeId} or law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
@ -112,9 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
enterprise_information ei
LEFT JOIN (
SELECT
*
enterprise_number, qr_code_url
FROM
( SELECT * FROM qr_code_generate_history WHERE `status` = 0 ORDER BY generate_time DESC LIMIT 1000000000 ) t
( SELECT enterprise_number, qr_code_url, generate_time FROM qr_code_generate_history WHERE `status` = 0 ORDER BY generate_time DESC LIMIT 1000000000 ) t
GROUP BY
t.enterprise_number
ORDER BY
@ -130,6 +130,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
ORDER BY ei.create_time DESC
<iftest="params.pageNum != null and params.pageSize != null"><!-- 开始时间检索 -->
<iftest="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
</if>
from enforcement_registration r
where 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
<iftest="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<iftest="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>
<iftest="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<iftest="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<iftest="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<iftest="beginTime != null and beginTime != ''">
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)
</if>
<iftest="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')
select count(1) as num from enterprise_law_enforcement n
<where>
and n.enterprise_number is not null
<iftest="params.zone != null and params.zone != ''">
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<iftest="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>
<iftest="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<iftest="beginTime != null and beginTime != ''">
and DATE_FORMAT(n.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)
</if>
<iftest="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')
select count(1) as num from complaint_statistics c
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<iftest="params.zone != null and params.zone != ''">
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<iftest="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>
<iftest="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<iftest="beginTime != null and beginTime != ''">
and DATE_FORMAT(c.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)
</if>
<iftest="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')
<iftest="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<iftest="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>
<iftest="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<iftest="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<iftest="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<iftest="beginTime != null and beginTime != ''">
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)
</if>
<iftest="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')