2024-10-04 10:43:44 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="cn.bunny.services.mapper.DeptMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.system.Dept">
|
|
|
|
<id column="id" property="id"/>
|
|
|
|
<id column="create_time" property="createTime"/>
|
|
|
|
<id column="update_time" property="updateTime"/>
|
|
|
|
<id column="create_user" property="createUser"/>
|
|
|
|
<id column="update_user" property="updateUser"/>
|
|
|
|
<id column="is_deleted" property="isDeleted"/>
|
|
|
|
<id column="parent_id" property="parentId"/>
|
2024-10-06 18:57:39 +08:00
|
|
|
<id column="manager" property="manager"/>
|
2024-10-04 10:43:44 +08:00
|
|
|
<id column="dept_name" property="deptName"/>
|
|
|
|
<id column="summary" property="summary"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
<sql id="Base_Column_List">
|
2024-10-06 18:57:39 +08:00
|
|
|
id, create_time, update_time, create_user, update_user, is_deleted, parent_id, manager, dept_name, summary
|
2024-10-04 10:43:44 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 分页查询部门内容 -->
|
|
|
|
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.Dept">
|
2024-10-05 15:21:15 +08:00
|
|
|
select
|
|
|
|
<include refid="Base_Column_List"/>
|
2024-10-04 10:43:44 +08:00
|
|
|
from sys_dept
|
|
|
|
<where>
|
2024-10-24 23:39:09 +08:00
|
|
|
is_deleted = 0
|
2024-10-05 15:21:15 +08:00
|
|
|
<if test="dto.parentId != null and dto.parentId != ''">
|
2024-10-11 16:47:15 +08:00
|
|
|
and parent_id like CONCAT('%',#{dto.parentId},'%')
|
2024-10-05 15:21:15 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.deptName != null and dto.deptName != ''">
|
2024-10-11 16:47:15 +08:00
|
|
|
and dept_name like CONCAT('%',#{dto.deptName},'%')
|
2024-10-05 15:21:15 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.summary != null and dto.summary != ''">
|
2024-10-11 16:47:15 +08:00
|
|
|
and summary like CONCAT('%',#{dto.summary},'%')
|
2024-10-05 15:21:15 +08:00
|
|
|
</if>
|
2024-10-04 10:43:44 +08:00
|
|
|
</where>
|
|
|
|
order by update_time
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 物理删除部门 -->
|
|
|
|
<delete id="deleteBatchIdsWithPhysics">
|
|
|
|
delete
|
|
|
|
from sys_dept
|
|
|
|
where id in
|
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|