| | |
| | | SELECT IFNULL(A.thisnum, 0) AS thisnum, |
| | | IFNULL(B.lastnum, 0) AS lastnum, |
| | | IFNULL( C.num, 0 ) AS num, |
| | | IFNULL( C.fznum, 0 ) AS fznum, |
| | | H.departmentid, |
| | | H.jurisdiction |
| | | FROM (SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction) H |
| | | FROM (SELECT departmentid, jurisdiction FROM sys_information WHERE stats!=1 GROUP BY departmentid, jurisdiction) H |
| | | LEFT JOIN ( |
| | | SELECT COUNT(*) AS thisnum, |
| | | dept_id |
| | |
| | | ) B ON B.dept_id = H.departmentid |
| | | LEFT JOIN ( |
| | | SELECT |
| | | J.fznum, |
| | | J.znum+J.fznum as num, |
| | | J.dept_id |
| | | FROM |
| | |
| | | i.departmentid |
| | | FROM |
| | | sys_information i |
| | | LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 |
| | | LEFT JOIN sys_jurisdiction j ON j.id= i.jurisdiction where 1=1 and s.status=0 |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | and i.jurisdiction =#{jurisdiction} |
| | | </if> |
| | |
| | | GROUP BY |
| | | dept_id |
| | | ) J ON J.dept_id = H.departmentid |
| | | WHERE 1 = 1 |
| | | LEFT JOIN blade_dept d ON H.departmentid = d.id |
| | | LEFT JOIN sys_jurisdiction j ON j.id = H.jurisdiction |
| | | WHERE 1 =1 |
| | | <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'"> |
| | | AND H.jurisdiction in(${jurisdiction}) |
| | | and (j.id = #{jurisdiction} or j.parent_id = #{jurisdiction}) |
| | | </if> |
| | | <if test="deptid!=null and deptid!=''"> |
| | | AND H.departmentid = #{deptid} |