refactor: 冗余判断删除

冗余判断删除
This commit is contained in:
胡少翔
2024-11-14 09:42:01 +08:00
parent be91043dcb
commit 7a001ef506

View File

@@ -61,9 +61,9 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
new LambdaQueryWrapper<Role>()
.and(StrUtil.isNotBlank(keywords),
wrapper ->
wrapper.like(StrUtil.isNotBlank(keywords), Role::getName, keywords)
wrapper.like(Role::getName, keywords)
.or()
.like(StrUtil.isNotBlank(keywords), Role::getCode, keywords)
.like(Role::getCode, keywords)
)
.ne(!SecurityUtils.isRoot(), Role::getCode, SystemConstants.ROOT_ROLE_CODE) // 非超级管理员不显示超级管理员角色
.orderByDesc(Role::getCreateTime).orderByDesc(Role::getUpdateTime)