update 优化 角色权限支持仅本人权限查看 解决无法查看自己创建的角色问题
| | |
| | | public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> { |
| | | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "d.dept_id") |
| | | @DataColumn(key = "deptName", value = "d.dept_id"), |
| | | @DataColumn(key = "userName", value = "r.create_by") |
| | | }) |
| | | Page<SysRoleVo> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | |
| | |
| | | * @return 角色数据集合信息 |
| | | */ |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "d.dept_id") |
| | | @DataColumn(key = "deptName", value = "d.dept_id"), |
| | | @DataColumn(key = "userName", value = "r.create_by") |
| | | }) |
| | | List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "d.dept_id") |
| | | @DataColumn(key = "deptName", value = "d.dept_id"), |
| | | @DataColumn(key = "userName", value = "r.create_by") |
| | | }) |
| | | SysRoleVo selectRoleById(Long roleId); |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | select r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | from sys_role r |
| | | left join sys_user_role sur on sur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = sur.user_id |
| | | WHERE r.del_flag = '0' and u.user_name = #{userName} |
| | | </select> |
| | | |