fix 修复 用户绑定角色 与 角色绑定用户 异常 编写错误
| | |
| | | import com.ruoyi.common.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户与角色关联表 数据层 |
| | | * |
| | |
| | | */ |
| | | public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRoleMapper, SysUserRole, SysUserRole> { |
| | | |
| | | Long selectUserIdByRoleId(Long roleId); |
| | | List<Long> selectUserIdsByRoleId(Long roleId); |
| | | |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<SysUser> selectUnallocatedList(SysUser user, PageQuery pageQuery) { |
| | | Long userId = userRoleMapper.selectUserIdByRoleId(user.getRoleId()); |
| | | List<Long> userId = userRoleMapper.selectUserIdsByRoleId(user.getRoleId()); |
| | | QueryWrapper<SysUser> wrapper = Wrappers.query(); |
| | | wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) |
| | | .and(w -> w.ne("r.role_id", user.getRoleId()).or().isNull("r.role_id")) |
| | |
| | | <result property="userId" column="user_id"/> |
| | | <result property="roleId" column="role_id"/> |
| | | </resultMap> |
| | | <select id="selectUserIdByRoleId" resultType="Long"> |
| | | <select id="selectUserIdsByRoleId" resultType="Long"> |
| | | select u.user_id from sys_user u |
| | | inner join sys_user_role ur |
| | | on u.user_id = ur.user_id and ur.role_id = #{roleId} |