朱杰
2021-05-31 90063ad03c406c0cf88f5e6a1860bb43926bfddf
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -57,4 +57,17 @@
        order by d.parent_id, d.order_num
    </select>
    <update id="updateDeptChildren" parameterType="java.util.List">
        update sys_dept set ancestors =
        <foreach collection="depts" item="item" index="index"
                 separator=" " open="case dept_id" close="end">
            when #{item.deptId} then #{item.ancestors}
        </foreach>
        where dept_id in
        <foreach collection="depts" item="item" index="index"
                 separator="," open="(" close=")">
            #{item.deptId}
        </foreach>
    </update>
</mapper>