根据角色搜索用户

This commit is contained in:
sxu 2025-03-25 14:39:39 +08:00
parent c1203d103d
commit 1658216f71
2 changed files with 15 additions and 5 deletions

View File

@ -137,6 +137,11 @@ public class SysUser extends BaseEntity {
*/ */
private Long[] roleIds; private Long[] roleIds;
/**
* 角色权限
*/
private String roleKey;
/** /**
* 岗位组 * 岗位组
*/ */
@ -350,6 +355,14 @@ public class SysUser extends BaseEntity {
this.roleIds = roleIds; this.roleIds = roleIds;
} }
public String getRoleKey() {
return roleKey;
}
public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}
public Long[] getPostIds() { public Long[] getPostIds() {
return postIds; return postIds;
} }

View File

@ -152,11 +152,8 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="roles != null and roles.size() > 0"> <if test="roleKey != null and roleKey != ''">
and r.role_key in and r.role_key like concat('%', #{roleKey}, '%')
<foreach collection="roles" item="item" index="index" separator="," open="(" close=")">
#{item.roleKey}
</foreach>
</if> </if>
<include refid="com.bonus.system.mapper.DataScopeMapper.dataScopeFilter"/> <include refid="com.bonus.system.mapper.DataScopeMapper.dataScopeFilter"/>
GROUP BY u.user_id GROUP BY u.user_id