智慧保安后台管理-外网项目备份
Administrator
2021-11-27 dca2532f01dac86be25ad09fa9ee8035bccdca6a
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -100,7 +100,25 @@
            and bu.hold = #{user.hold}
        </if>
        <if test="user.deptId!=null and user.deptId != ''">
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
            and bd.id in
            (
                select id from blade_dept where id = #{user.deptId}
                union
                SELECT
                id
                FROM
                (
                SELECT
                t1.id,t1.parent_id,t1.dept_name,
                IF
                ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
                FROM
                ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
                ( SELECT @pids := #{user.deptId} ) t2
                ) t3
                WHERE
                ischild != 0
            )
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}
@@ -166,7 +184,25 @@
            and real_name like concat(concat('%', #{user.realName}),'%')
        </if>
        <if test="user.deptId!=null and user.deptId != ''">
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
            and bd.id in
            (
                select id from blade_dept where id = #{user.deptId}
                union
                SELECT
                id
                FROM
                (
                SELECT
                t1.id,t1.parent_id,t1.dept_name,
                IF
                ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
                FROM
                ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
                ( SELECT @pids := #{user.deptId} ) t2
                ) t3
                WHERE
                ischild != 0
            )
        </if>
        <if test="user.userType!=null and user.userType != ''">
            and user_type = #{user.userType}
@@ -377,13 +413,9 @@
            where 1 = 1
            <if test="user.examType==1">
                and a.isApply != 1
                and a.age&gt;=18
                and a.age&lt;=60
            </if>
            <if test="user.examType==2">
                and a.isTrain != 1
                and a.age&gt;=18
                and a.age&lt;=60
            </if>
        )
    </select>
@@ -698,7 +730,25 @@
            and bu.hold = #{user.hold}
        </if>
        <if test="user.deptId!=null and user.deptId != ''">
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
            and bd.id in
            (
                select id from blade_dept where id = #{user.deptId}
                union
                SELECT
                id
                FROM
                (
                SELECT
                t1.id,t1.parent_id,t1.dept_name,
                IF
                ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
                FROM
                ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
                ( SELECT @pids := #{user.deptId} ) t2
                ) t3
                WHERE
                ischild != 0
            )
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}