|
@@ -46,6 +46,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
${params.dataScope}
|
|
|
order by d.parent_id, d.order_num
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectAllDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
|
|
+ <include refid="selectDeptVo"/>
|
|
|
+ where d.del_flag = '0'
|
|
|
+ <if test="parentId != null and parentId != 0">
|
|
|
+ AND parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND dept_name like concat(concat('%',#{deptName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ order by d.parent_id, d.order_num
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectDeptListByRoleId" resultType="Long">
|
|
|
select d.dept_id
|
|
@@ -57,6 +72,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
order by d.parent_id, d.order_num
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectDeptListByUserId" resultType="Integer">
|
|
|
+ select d.dept_id
|
|
|
+ from sys_dept d
|
|
|
+ left join sys_user_dept rd on d.dept_id = rd.dept_id
|
|
|
+ where rd.user_id = #{userId}
|
|
|
+ <if test="deptCheckStrictly">
|
|
|
+ and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_user_dept rd on d.dept_id =
|
|
|
+ rd.dept_id and rd.user_id = #{userId})
|
|
|
+ </if>
|
|
|
+ order by d.parent_id, d.order_num
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|