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