tuqin
2026-09-24 034f720f0bbc7f253c15613c28d994d7abf401eb
src/main/resources/mapper/system/SysDeptMapper.xml
@@ -26,7 +26,6 @@
   <sql id="selectDeptVo">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
        from sys_dept d
        order by d.create_time desc
    </sql>
   <select id="selectDeptList" parameterType="com.ruoyi.project.system.domain.SysDept" resultMap="SysDeptResult">
@@ -92,7 +91,7 @@
   <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 = '0' order by d.create_time desc limit 1
   </select>
    <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept">
@@ -156,6 +155,19 @@
       </foreach>
   </update>
   <update id="updateDeptSort" parameterType="java.util.List">
       update sys_dept set order_num =
       <foreach collection="depts" item="item" index="index"
           separator=" " open="case dept_id" close="end">
           when #{item.deptId} then #{item.orderNum}
       </foreach>
       where dept_id in
       <foreach collection="depts" item="item" index="index"
           separator="," open="(" close=")">
           #{item.deptId}
       </foreach>
   </update>
   <update id="updateDeptStatusNormal" parameterType="Long">
        update sys_dept set status = '0' where dept_id in
        <foreach collection="array" item="deptId" open="(" separator="," close=")">