智慧保安后台管理-外网项目备份
Administrator
2021-08-18 4f5952c0082ef451dbf2c7ac4c2fb6055cb02f38
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -159,7 +159,22 @@
    <!--懒加载获取部门树形结构(包含用户数据)app-->
    <select id="lazyTreeUserApp" resultType="org.springblade.modules.system.vo.DeptAndUserVO" >
        select DISTINCT  * from (
        select DISTINCT
            c.id,
            c.parent_id,
            c.title,
            c.value,
            c.key,
            (
            SELECT
            CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
            FROM
            blade_dept
            where
            id = c.parent_id
            and dept_category=1
            ) AS "has_children"
        from (
        (SELECT
        dept.id,
        dept.parent_id,
@@ -201,7 +216,8 @@
        union all
        (select
            (
                select
        bu.id,
        bu.dept_id  parent_id,
        bu.real_name AS label,
@@ -232,7 +248,25 @@
    <!--懒加载获取部门树形结构(包含用户数据)-->
    <select id="lazyTreeUser" resultMap="treeNodeResultMap" >
        select DISTINCT  * from (
        select DISTINCT
            c.id,
            c.parent_id,
            c.title,
            c.value,
            c.key,
            (
            SELECT
            CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
            FROM
            blade_dept
            where
            id = c.parent_id
            <if test="parentId!=null and parentId!=''">
                and dept_category=1
                AND id = #{parentId}
            </if>
            ) AS "has_children"
        from (
            (SELECT
              dept.id,
              dept.parent_id,