办学质量监测教学评价系统
ageer
2025-04-20 4af26fe4b42c4056f1226ba6f1e36e3fcc03a588
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.ruoyi.system.mapper.SysDeptMapper">
 
    <resultMap type="org.ruoyi.system.domain.vo.SysDeptVo" id="SysDeptResult">
    </resultMap>
 
    <select id="selectDeptList" resultMap="SysDeptResult">
        select * from sys_dept ${ew.getCustomSqlSegment}
    </select>
 
    <select id="selectDeptById" resultMap="SysDeptResult">
        select * from sys_dept where del_flag = '0' and dept_id = #{deptId}
    </select>
 
    <select id="selectDeptListByRoleId" resultType="Long">
        select d.dept_id
        from sys_dept d
            left join sys_role_dept rd on d.dept_id = rd.dept_id
        where rd.role_id = #{roleId}
            <if test="deptCheckStrictly">
                and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
            </if>
        order by d.parent_id, d.order_num
    </select>
 
</mapper>