lambda处理
This commit is contained in:
parent
d47c451584
commit
0f28c392dc
@ -83,9 +83,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
||||
//模糊查询
|
||||
String key = (String) params.get("key");
|
||||
if (!ObjectUtil.isEmpty(key)) {
|
||||
queryWrapper.like("username", key)
|
||||
queryWrapper.lambda()
|
||||
.like(AppUserEntity::getUsername, key)
|
||||
.or()
|
||||
.like("mobile", key);
|
||||
.like(AppUserEntity::getMobile, key);
|
||||
}
|
||||
queryWrapper.lambda().orderByDesc(AppUserEntity::getUid);
|
||||
IPage<AppUserEntity> page = this.page(
|
||||
|
@ -62,10 +62,10 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
||||
QueryWrapper<PostEntity> queryWrapper=new QueryWrapper<>();
|
||||
String key = (String)params.get("key");
|
||||
String status = (String)params.get("status");
|
||||
queryWrapper
|
||||
.like(!ObjectUtil.isEmpty(status),"content", key)
|
||||
queryWrapper.lambda()
|
||||
.like(!ObjectUtil.isEmpty(status),PostEntity::getContent, key)
|
||||
.or()
|
||||
.like(!ObjectUtil.isEmpty(status),"title",key);
|
||||
.like(!ObjectUtil.isEmpty(status),PostEntity::getTitle,key);
|
||||
queryWrapper.lambda().orderByDesc(PostEntity::getId);
|
||||
IPage<PostEntity> page = this.page(
|
||||
new Query<PostEntity>().getPage(params),
|
||||
|
Loading…
Reference in New Issue
Block a user