|
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
|
|
<include refid="selectDeptVo"/>
|
|
|
- where d.del_flag = '0'
|
|
|
+ where d.del_flag = '1'
|
|
|
<if test="deptId != null and deptId != 0">
|
|
|
AND dept_id = #{deptId}
|
|
|
</if>
|
|
@@ -70,12 +70,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
|
|
- select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
|
|
+ select count(1)
|
|
|
+ from sys_user
|
|
|
+ where dept_id = #{deptId}
|
|
|
+ and del_flag = 1
|
|
|
</select>
|
|
|
|
|
|
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
|
|
- select count(1) from sys_dept
|
|
|
- where del_flag = '0' and parent_id = #{deptId} limit 1
|
|
|
+ select count(1)
|
|
|
+ from sys_dept
|
|
|
+ where del_flag = 1
|
|
|
+ and parent_id = #{deptId} limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
|
@@ -83,12 +88,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
|
|
- select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
|
|
+ select count(*)
|
|
|
+ from sys_dept
|
|
|
+ where status = 1
|
|
|
+ and del_flag = 1
|
|
|
+ and find_in_set(#{deptId}, ancestors)
|
|
|
</select>
|
|
|
|
|
|
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
|
|
<include refid="selectDeptVo"/>
|
|
|
- where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
|
|
+ where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = 1 limit 1
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertDept" parameterType="SysDept">
|
|
@@ -150,14 +159,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<update id="updateDeptStatusNormal" parameterType="Long">
|
|
|
- update sys_dept set status = '0' where dept_id in
|
|
|
- <foreach collection="array" item="deptId" open="(" separator="," close=")">
|
|
|
+ update sys_dept set status = 1 where dept_id in
|
|
|
+ <foreach collection="array" item="deptId" open="(" separator="," close=")">
|
|
|
#{deptId}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteDeptById" parameterType="Long">
|
|
|
- update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
|
|
+ update sys_dept
|
|
|
+ set del_flag = 2
|
|
|
+ where dept_id = #{deptId}
|
|
|
</delete>
|
|
|
|
|
|
</mapper>
|