【8.3.3】【role】角色列表查询,增加角色分类的查询条件

dev-8.3.3
stylefeng 2025-01-23 18:05:59 +08:00
parent eac8d42b90
commit 43ea520792
2 changed files with 11 additions and 0 deletions

View File

@ -88,4 +88,10 @@ public class SysRoleRequest extends BaseRequest {
@ChineseDescription("角色id集合用在批量删除")
private Set<Long> roleIdList;
/**
* id
*/
@ChineseDescription("角色分类id")
private Long roleCategoryId;
}

View File

@ -454,6 +454,11 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
queryWrapper.nested(i -> i.like(SysRole::getRoleName, searchText).or().like(SysRole::getRoleCode, searchText));
}
// 根据角色分类id查询角色
if (ObjectUtil.isNotEmpty(sysRoleRequest.getRoleCategoryId())) {
queryWrapper.eq(SysRole::getRoleCategoryId, sysRoleRequest.getRoleCategoryId());
}
// 排序字段
queryWrapper.orderByAsc(SysRole::getRoleType);
queryWrapper.orderByAsc(SysRole::getRoleSort);