ycl-common/src/main/resources/mapper/user/UmsDepartManageMapper.xml
@@ -34,4 +34,16 @@ where user_id=#{userId} limit #{current},#{pageSize} </select> <select id="selectChildrendIds" resultType="com.ycl.entity.depart.UmsDepart"> select * from ums_depart where id in (WITH RECURSIVE cte_dept(id) AS ( SELECT id FROM ums_depart WHERE id = #{id} UNION ALL SELECT ums_depart.id FROM ums_depart JOIN cte_dept ON ums_depart.parent_id = cte_dept.id )SELECT id FROM cte_dept) and is_deleted = 0 </select> </mapper>