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");
|
String key = (String) params.get("key");
|
||||||
if (!ObjectUtil.isEmpty(key)) {
|
if (!ObjectUtil.isEmpty(key)) {
|
||||||
queryWrapper.like("username", key)
|
queryWrapper.lambda()
|
||||||
|
.like(AppUserEntity::getUsername, key)
|
||||||
.or()
|
.or()
|
||||||
.like("mobile", key);
|
.like(AppUserEntity::getMobile, key);
|
||||||
}
|
}
|
||||||
queryWrapper.lambda().orderByDesc(AppUserEntity::getUid);
|
queryWrapper.lambda().orderByDesc(AppUserEntity::getUid);
|
||||||
IPage<AppUserEntity> page = this.page(
|
IPage<AppUserEntity> page = this.page(
|
||||||
|
@ -62,10 +62,10 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
|||||||
QueryWrapper<PostEntity> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<PostEntity> queryWrapper=new QueryWrapper<>();
|
||||||
String key = (String)params.get("key");
|
String key = (String)params.get("key");
|
||||||
String status = (String)params.get("status");
|
String status = (String)params.get("status");
|
||||||
queryWrapper
|
queryWrapper.lambda()
|
||||||
.like(!ObjectUtil.isEmpty(status),"content", key)
|
.like(!ObjectUtil.isEmpty(status),PostEntity::getContent, key)
|
||||||
.or()
|
.or()
|
||||||
.like(!ObjectUtil.isEmpty(status),"title",key);
|
.like(!ObjectUtil.isEmpty(status),PostEntity::getTitle,key);
|
||||||
queryWrapper.lambda().orderByDesc(PostEntity::getId);
|
queryWrapper.lambda().orderByDesc(PostEntity::getId);
|
||||||
IPage<PostEntity> page = this.page(
|
IPage<PostEntity> page = this.page(
|
||||||
new Query<PostEntity>().getPage(params),
|
new Query<PostEntity>().getPage(params),
|
||||||
|
Loading…
Reference in New Issue
Block a user