优化
This commit is contained in:
parent
e5fb50fd7b
commit
53da9d8ed2
@ -60,12 +60,8 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
|||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
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");
|
||||||
// if(!ObjectUtil.isEmpty(key)){
|
|
||||||
// queryWrapper.like("content", key).or().like("title",key);
|
|
||||||
// }
|
|
||||||
queryWrapper
|
queryWrapper
|
||||||
.like(!ObjectUtil.isEmpty(status),"content", key)
|
.like(!ObjectUtil.isEmpty(status),"content", key)
|
||||||
.or()
|
.or()
|
||||||
@ -93,8 +89,6 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteByAdmin(List<Integer> ids) {
|
public void deleteByAdmin(List<Integer> ids) {
|
||||||
@ -108,7 +102,8 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
|||||||
@Override
|
@Override
|
||||||
public Integer getPostNumByUid(Integer uid) {
|
public Integer getPostNumByUid(Integer uid) {
|
||||||
|
|
||||||
return this.lambdaQuery().eq(PostEntity::getUid,uid)
|
return this.lambdaQuery()
|
||||||
|
.eq(PostEntity::getUid,uid)
|
||||||
.count();
|
.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user