智慧保安后台管理-验收版本
tangzy
2021-09-17 bcb742a2682e7e33621fc028cee9da033cf2ad80
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -383,23 +383,22 @@
    <select id="selectHold" resultType="java.util.HashMap">
        SELECT IFNULL(B.cz, 0)  as cz,
               IFNULL(C.wcz, 0) as wcz,
               A.jurisdiction
        FROM (SELECT jurisdiction FROM blade_user) A
                 LEFT JOIN (SELECT COUNT(hold) as cz, jurisdiction
               IFNULL(C.wcz, 0) as wcz
        FROM (SELECT departmentid,jurisdiction FROM sys_information) A
                 LEFT JOIN (SELECT COUNT(hold) as cz, dept_id
                            FROM blade_user
                            WHERE hold = 1
                              AND role_id = '1412226235153731586'
                              and status = 1
                            GROUP BY jurisdiction) B ON A.jurisdiction = B.jurisdiction
                 LEFT JOIN (SELECT COUNT(hold) as wcz, jurisdiction
                            GROUP BY dept_id) B ON A.departmentid = B.dept_id
                 LEFT JOIN (SELECT COUNT(hold) as wcz, dept_id
                            FROM blade_user
                            WHERE hold = 2
                              AND role_id = '1412226235153731586'
                              and status = 1
                            GROUP BY jurisdiction) C ON A.jurisdiction = C.jurisdiction
                            GROUP BY dept_id) C ON A.departmentid = C.dept_id
        WHERE A.jurisdiction in (${deptid})
        GROUP BY cz, wcz, jurisdiction
        GROUP BY cz, wcz
    </select>
    <!--查询部门下面的所有单位-->