|
|
@ -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>
|
|
|
|