|
|
@ -595,15 +595,18 @@ |
|
|
<if test="bo.params.endTime != null and bo.params.endTime != ''"> |
|
|
<if test="bo.params.endTime != null and bo.params.endTime != ''"> |
|
|
AND er.enforcement_time <= #{bo.params.endTime} |
|
|
AND er.enforcement_time <= #{bo.params.endTime} |
|
|
</if> |
|
|
</if> |
|
|
<if test="(bo.userId != null and bo.userId != '') and (bo.bureauDeptId == null or bo.bureauDeptId == '')"> |
|
|
<!-- <if test="(bo.userId != null and bo.userId != '') and (bo.lawEnforcementId == null or bo.lawEnforcementId == '')"> |
|
|
AND (er.law_enforcer_id = #{bo.userId} OR er.user_id = #{bo.userId} OR FIND_IN_SET(#{bo.userId}, er.law_enforcer_id_two)) |
|
|
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.userId != null and bo.userId != ''"> |
|
|
|
|
|
and (law_enforcer_id = #{bo.userId} or user_id = #{bo.userId} or FIND_IN_SET(#{bo.userId}, law_enforcer_id_two)) |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
AND er.bureau_dept_id = #{bo.bureauDeptId} |
|
|
AND er.bureau_dept_id = #{bo.bureauDeptId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="bo.lawEnforcementId != null and bo.lawEnforcementId != ''"> |
|
|
<!-- <if test="bo.lawEnforcementId != null and bo.lawEnforcementId != ''"> |
|
|
AND er.law_enforcement_id = #{bo.lawEnforcementId} |
|
|
AND er.law_enforcement_id = #{bo.lawEnforcementId} |
|
|
</if> |
|
|
</if>--> |
|
|
</where> |
|
|
</where> |
|
|
) t |
|
|
) t |
|
|
<where> |
|
|
<where> |
|
|
@ -617,6 +620,185 @@ |
|
|
AND t.num >= #{bo.num} |
|
|
AND t.num >= #{bo.num} |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
|
|
|
ORDER BY t.num DESC, t.enforcement_time DESC |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEnforcementRegistrationListInfo" parameterType="com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo" resultType="com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo"> |
|
|
|
|
|
SELECT * FROM ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
er.id, |
|
|
|
|
|
er.law_enforcement, |
|
|
|
|
|
er.law_enforcement_id, |
|
|
|
|
|
er.enforce, |
|
|
|
|
|
er.enterprise_id, |
|
|
|
|
|
er.enterprise_name, |
|
|
|
|
|
er.enterprise_number, |
|
|
|
|
|
er.enforcement_time, |
|
|
|
|
|
er.create_time, |
|
|
|
|
|
er.create_by, |
|
|
|
|
|
er.law_enforcer, |
|
|
|
|
|
er.law_enforcer_id, |
|
|
|
|
|
er.law_enforcer_tel, |
|
|
|
|
|
er.law_enforcer_two, |
|
|
|
|
|
er.law_enforcer_id_two, |
|
|
|
|
|
er.law_enforcer_tel_two, |
|
|
|
|
|
er.subsidiaryer, |
|
|
|
|
|
er.subsidiaryer_id, |
|
|
|
|
|
er.subsidiaryer_tel, |
|
|
|
|
|
er.law_enforcement_item, |
|
|
|
|
|
er.law_enforcement_item_text, |
|
|
|
|
|
er.law_enforcement_basis, |
|
|
|
|
|
er.law_enforcement_basis_text, |
|
|
|
|
|
er.remark, |
|
|
|
|
|
er.reslut, |
|
|
|
|
|
er.user_id, |
|
|
|
|
|
er.dept_id, |
|
|
|
|
|
er.is_delete, |
|
|
|
|
|
er.status, |
|
|
|
|
|
er.law_enforcement_code, |
|
|
|
|
|
er.is_complaint, |
|
|
|
|
|
er.is_submit, |
|
|
|
|
|
er.unite_check, |
|
|
|
|
|
er.check_css, |
|
|
|
|
|
er.enforce_reason, |
|
|
|
|
|
er.law_field, |
|
|
|
|
|
er.check_category, |
|
|
|
|
|
er.bureau_dept_id, |
|
|
|
|
|
er.bureau_dept_name, |
|
|
|
|
|
er.is_evaluate, |
|
|
|
|
|
er.law_id, |
|
|
|
|
|
er.law_text, |
|
|
|
|
|
COALESCE(ent_count.cnt, 0) as num |
|
|
|
|
|
FROM enforcement_registration er |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT enterprise_number, COUNT(*) as cnt |
|
|
|
|
|
FROM enforcement_registration |
|
|
|
|
|
WHERE is_submit = 1 |
|
|
|
|
|
<if test="bo.isDelete != null"> |
|
|
|
|
|
AND is_delete = #{bo.isDelete} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 1"> |
|
|
|
|
|
AND enforcement_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 2"> |
|
|
|
|
|
AND enforcement_time >= CONCAT(YEAR(CURDATE()), '-', LPAD(QUARTER(CURDATE())*3-2, 2, '0'), '-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 3"> |
|
|
|
|
|
AND enforcement_time >= CONCAT(YEAR(CURDATE()), '-01-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.beginTime != null and bo.beginTime != ''"> |
|
|
|
|
|
AND enforcement_time >= #{bo.beginTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.endTime != null and bo.endTime != ''"> |
|
|
|
|
|
AND enforcement_time <= #{bo.endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
|
|
|
AND bureau_dept_id = #{bo.bureauDeptId} |
|
|
|
|
|
</if> |
|
|
|
|
|
GROUP BY enterprise_number |
|
|
|
|
|
) ent_count ON er.enterprise_number = ent_count.enterprise_number |
|
|
|
|
|
<where> |
|
|
|
|
|
<!--er.is_submit = 1--> |
|
|
|
|
|
<if test="bo.enterpriseId != null and bo.enterpriseId != ''"> |
|
|
|
|
|
AND er.enterprise_id = #{bo.enterpriseId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.enterpriseName != null and bo.enterpriseName != ''"> |
|
|
|
|
|
AND er.enterprise_name LIKE CONCAT('%', #{bo.enterpriseName}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.enterpriseNumber != null and bo.enterpriseNumber != ''"> |
|
|
|
|
|
AND er.enterprise_number = #{bo.enterpriseNumber} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.isDelete != null"> |
|
|
|
|
|
AND er.is_delete = #{bo.isDelete} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.status != null"> |
|
|
|
|
|
AND er.status = #{bo.status} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.unionNo != null and bo.unionNo != ''"> |
|
|
|
|
|
AND er.union_no = #{bo.unionNo} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.hasUnion != null"> |
|
|
|
|
|
AND er.has_union = #{bo.hasUnion} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.isRealUnion != null"> |
|
|
|
|
|
AND er.is_real_union = #{bo.isRealUnion} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.hasAuto != null"> |
|
|
|
|
|
AND er.has_auto = #{bo.hasAuto} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.searchValue != null and bo.searchValue != ''"> |
|
|
|
|
|
AND ( |
|
|
|
|
|
er.enterprise_name LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.enterprise_number LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.enterprise_address LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement_code LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.bureau_dept_name LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcer LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcer_two LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement_item_text LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement_basis LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR DATE_FORMAT(er.enforcement_time, '%Y-%m-%d') LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.check_css LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.check_category LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.enforce_reason LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.remark LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement_basis_text LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_text LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.enforce LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
OR er.law_enforcement_item LIKE CONCAT('%', #{bo.searchValue}, '%') |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateSearch != null and bo.dateSearch != ''"> |
|
|
|
|
|
AND er.enforcement_time >= CONCAT(#{bo.dateSearch}, '-01') |
|
|
|
|
|
AND er.enforcement_time < DATE_ADD(CONCAT(#{bo.dateSearch}, '-01'), INTERVAL 1 MONTH) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 1"> |
|
|
|
|
|
AND er.enforcement_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.dateType != null and bo.dateType == 2"> |
|
|
|
|
|
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.lawEnforcementId == null or bo.lawEnforcementId == '')"> |
|
|
|
|
|
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.userId != null and bo.userId != ''"> |
|
|
|
|
|
and (law_enforcer_id = #{bo.userId} or user_id = #{bo.userId} or FIND_IN_SET(#{bo.userId}, law_enforcer_id_two)) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.bureauDeptId != null and bo.bureauDeptId != ''"> |
|
|
|
|
|
AND er.bureau_dept_id = #{bo.bureauDeptId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<!-- <if test="bo.lawEnforcementId != null and bo.lawEnforcementId != ''"> |
|
|
|
|
|
AND er.law_enforcement_id = #{bo.lawEnforcementId} |
|
|
|
|
|
</if>--> |
|
|
|
|
|
</where> |
|
|
|
|
|
) t |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="bo.numLeft != null and bo.numLeft != ''"> |
|
|
|
|
|
AND t.num >= #{bo.numLeft} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.numRight != null and bo.numRight != ''"> |
|
|
|
|
|
AND t.num <= #{bo.numRight} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bo.num != null and bo.num != ''"> |
|
|
|
|
|
AND t.num >= #{bo.num} |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
ORDER BY t.create_time DESC |
|
|
ORDER BY t.create_time DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|