|
|
|
|
@ -6,23 +6,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
<select id="queryDepartNegative" resultType="com.biutag.supervision.pojo.model.DepartNegativeModel"> |
|
|
|
|
SELECT |
|
|
|
|
d.*, |
|
|
|
|
count( DISTINCT nb.blameIdCode ) verify_police_size, |
|
|
|
|
count( n.id ) verify_size |
|
|
|
|
FROM |
|
|
|
|
( |
|
|
|
|
SELECT |
|
|
|
|
d.id depart_id, |
|
|
|
|
d1.short_name parent_depart_name, |
|
|
|
|
d.short_name depart_name, |
|
|
|
|
sum( CASE WHEN p.person_type = '1' THEN 1 ELSE 0 END ) police_size, |
|
|
|
|
sum( CASE WHEN p.person_type = '3' OR p.person_type = '5' THEN 1 ELSE 0 END ) aux_size, |
|
|
|
|
count( DISTINCT nb.blameIdCode ) verify_police_size, |
|
|
|
|
count( n.id ) verify_size |
|
|
|
|
FROM |
|
|
|
|
sum( CASE WHEN p.person_type = '3' OR p.person_type = '5' THEN 1 ELSE 0 END ) aux_size |
|
|
|
|
FROM |
|
|
|
|
sup_depart d |
|
|
|
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id |
|
|
|
|
LEFT JOIN sup_police p ON p.org_id = d.id |
|
|
|
|
LEFT JOIN negative n ON n.involveDepartId = d.id |
|
|
|
|
AND n.checkStatus IN ( '1', '2' ) |
|
|
|
|
AND n.crtTime BETWEEN #{beginTime} AND #{endTime} |
|
|
|
|
LEFT JOIN negative_blame nb ON n.id = nb.negativeId |
|
|
|
|
WHERE |
|
|
|
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id |
|
|
|
|
LEFT JOIN sup_police p ON p.org_id = d.id |
|
|
|
|
WHERE |
|
|
|
|
d.LEVEL = 3 |
|
|
|
|
GROUP BY |
|
|
|
|
d.id, |
|
|
|
|
d1.short_name, |
|
|
|
|
d.short_name |
|
|
|
|
) d |
|
|
|
|
LEFT JOIN negative n ON n.involveDepartId = d.depart_id |
|
|
|
|
AND n.checkStatus IN ( '1', '2' ) |
|
|
|
|
AND n.crtTime BETWEEN #{beginTime} AND #{endTime} |
|
|
|
|
LEFT JOIN negative_blame nb ON n.id = nb.negativeId |
|
|
|
|
WHERE |
|
|
|
|
1 = 1 |
|
|
|
|
<if test="departName != null and departName != ''"> |
|
|
|
|
AND d.short_name like concat('%', #{departName}, '%') |
|
|
|
|
</if> |
|
|
|
|
@ -30,14 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
AND d.id = #{departId} |
|
|
|
|
</if> |
|
|
|
|
GROUP BY |
|
|
|
|
d1.short_name, |
|
|
|
|
d.short_name |
|
|
|
|
d.depart_id, |
|
|
|
|
d.parent_depart_name, |
|
|
|
|
d.depart_name |
|
|
|
|
ORDER BY |
|
|
|
|
verify_police_size desc, d1.order_no |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="getNegativePoliceSize" > |
|
|
|
|
|
|
|
|
|
verify_size DESC |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectPoliceTop10" resultType="com.biutag.supervision.pojo.dto.common.BarItem"> |
|
|
|
|
@ -59,4 +67,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
LIMIT 10 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="selectProblemType" resultType="com.biutag.supervision.pojo.dto.common.BarItem"> |
|
|
|
|
SELECT |
|
|
|
|
pt.`name` name, |
|
|
|
|
pt.id, |
|
|
|
|
count( DISTINCT n.id ) value |
|
|
|
|
FROM |
|
|
|
|
sup_dict_problem_type pt |
|
|
|
|
LEFT JOIN negative_problem_relation pr ON pt.id = pr.oneLevelCode |
|
|
|
|
LEFT JOIN negative_blame nb ON pr.blameId = nb.blameId |
|
|
|
|
LEFT JOIN negative n ON n.id = nb.negativeId |
|
|
|
|
AND n.checkStatus IN ( '1', '2' ) |
|
|
|
|
AND n.involveDepartId = #{departId} |
|
|
|
|
AND n.crtTime BETWEEN #{beginTime} AND #{endTime} |
|
|
|
|
WHERE |
|
|
|
|
pt.`level` = 1 |
|
|
|
|
GROUP BY |
|
|
|
|
pt.`name`, |
|
|
|
|
pt.id |
|
|
|
|
order by value desc |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
</mapper> |