2025-07-18 00:20:37 +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="com.auth.dao.base.mapper.v1.RoleDataScopeMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
2025-07-21 08:11:50 +08:00
|
|
|
<resultMap id="BaseResultMap" type="com.auth.dao.base.entity.RoleDataScopeEntity">
|
2025-07-18 00:20:37 +08:00
|
|
|
<id column="id" property="id"/>
|
|
|
|
<id column="role_id" property="roleId"/>
|
|
|
|
<id column="dept_id" property="deptId"/>
|
|
|
|
<id column="create_time" property="createTime"/>
|
|
|
|
<id column="update_time" property="updateTime"/>
|
|
|
|
<id column="create_user" property="createUser"/>
|
|
|
|
<id column="update_user" property="updateUser"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id, role_id,dept_id, create_time, update_time, create_user, update_user
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 分页查询系统角色数据权限范围内容 -->
|
2025-07-18 10:42:59 +08:00
|
|
|
<select id="selectListByPage" resultType="com.auth.model.base.vo.RoleDataScopeVo">
|
2025-07-18 00:20:37 +08:00
|
|
|
select
|
|
|
|
base.*,
|
|
|
|
create_user.username as create_username,
|
|
|
|
update_user.username as update_username
|
|
|
|
from sys_role_data_scope 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.roleId != null and dto.roleId != ''">
|
|
|
|
and base.role_id like CONCAT('%',#{dto.roleId},'%')
|
|
|
|
</if>
|
|
|
|
<if test="dto.deptId != null and dto.deptId != ''">
|
|
|
|
and base.dept_id like CONCAT('%',#{dto.deptId},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|