56 lines
2.4 KiB
XML
56 lines
2.4 KiB
XML
<?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="com.auth.dao.base.mapper.v1.UserDeptMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.auth.dao.base.entity.base.UserDeptEntity">
|
|
<id column="id" property="id"/>
|
|
<id column="user_id" property="userId"/>
|
|
<id column="dept_id" property="deptId"/>
|
|
<id column="is_deleted" property="isDeleted"/>
|
|
<id column="is_primary" property="isPrimary"/>
|
|
<id column="position" property="position"/>
|
|
<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"/>
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
id, user_id,dept_id,is_deleted,is_primary,position, create_time, update_time, create_user, update_user,
|
|
is_deleted
|
|
</sql>
|
|
|
|
<!-- 分页查询部门用户关系表内容 -->
|
|
<select id="selectListByPage" resultType="com.auth.model.base.vo.UserDeptVo">
|
|
select
|
|
base.*,
|
|
create_user.username as create_username,
|
|
update_user.username as update_username
|
|
from sys_user_dept base
|
|
left join sys_user create_user on create_user.id = base.create_user
|
|
left join sys_user update_user on update_user.id = base.update_user
|
|
<where>
|
|
base.is_deleted = 0
|
|
<if test="dto.userId != null and dto.userId != ''">
|
|
and base.user_id like CONCAT('%',#{dto.userId},'%')
|
|
</if>
|
|
<if test="dto.deptId != null and dto.deptId != ''">
|
|
and base.dept_id like CONCAT('%',#{dto.deptId},'%')
|
|
</if>
|
|
<if test="dto.isDeleted != null and dto.isDeleted != ''">
|
|
and base.is_deleted like CONCAT('%',#{dto.isDeleted},'%')
|
|
</if>
|
|
<if test="dto.isPrimary != null and dto.isPrimary != ''">
|
|
and base.is_primary like CONCAT('%',#{dto.isPrimary},'%')
|
|
</if>
|
|
<if test="dto.position != null and dto.position != ''">
|
|
and base.position like CONCAT('%',#{dto.position},'%')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|