| | |
| | | IFNULL( B.num, 0 ) AS bzc |
| | | FROM |
| | | ( |
| | | SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H |
| | | LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 0 and role_id = |
| | | SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction |
| | | ) H |
| | | LEFT JOIN |
| | | ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 0 or |
| | | u.examination_type is null) and role_id = |
| | | '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY u.dept_id |
| | | ) A ON H.departmentid = A.dept_id |
| | | LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 1 or |
| | | u.examination_type is null ) and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY |
| | | ) A |
| | | ON H.departmentid = A.dept_id |
| | | LEFT JOIN |
| | | ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 1 and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY |
| | | u.dept_id |
| | | ) B ON H.departmentid = B.dept_id where 1=1 |
| | | ) B |
| | | ON H.departmentid = B.dept_id |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = H.jurisdiction |
| | | where 1=1 |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | and H.jurisdiction = #{jurisdiction} |
| | | and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction}) |
| | | </if> |
| | | <if test="deptid!=null and deptid!=''"> |
| | | and H.departmentid = #{deptid} |