隐患数据统计分析:本月上报隐患排名,隐患数量不正确修复

main
15036302109 8 months ago
parent 6e0e417c08
commit dae090e4e5

@ -153,15 +153,22 @@ SELECT
s.* s.*
FROM FROM
( (
SELECT SELECT
d.dept_name 'areaName', d.dept_name 'areaName',
count(r.dept_id) 'reportHiddenNum' IFNULL(SUM( hd_count ),0) 'reportHiddenNum'
FROM
sys_dept d
LEFT JOIN (
SELECT
*
FROM FROM
sys_dept d left join (select * from ehs_hidden_danger where ehs_hidden_danger
DATE_FORMAT(NOW(), '%Y-%m') = DATE_FORMAT( check_time, '%Y-%m')) r on r.dept_id = d.dept_id WHERE
GROUP BY DATE_FORMAT( NOW(), '%Y-%m' ) = DATE_FORMAT( check_time, '%Y-%m' )) r ON r.dept_id = d.dept_id
d.dept_id,d.dept_name GROUP BY
) s d.dept_id,
d.dept_name
) s
ORDER BY ORDER BY
s.reportHiddenNum DESC s.reportHiddenNum DESC
</select> </select>

Loading…
Cancel
Save