|
@@ -81,28 +81,28 @@ public class BrandServiceImpl implements BrandService {
|
|
|
List<Long> deptIdList , Integer type,Long userId,Integer livestreamStatus,String orderBy) {
|
|
|
QueryWrapper<BrandEntity> queryWrapper = new QueryWrapper<>();
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(sceneName)){
|
|
|
- queryWrapper.like("name" , sceneName);
|
|
|
+ queryWrapper.like("b.name" , sceneName);
|
|
|
}
|
|
|
//添加是否绑定的过滤条件
|
|
|
if(!ObjectUtils.isEmpty(userId)){
|
|
|
//捞取已经绑定的
|
|
|
- queryWrapper.eq("create_user_id",userId);
|
|
|
+ queryWrapper.and(query->query.eq("b.create_user_id",userId).or().eq("u.user_id",userId));
|
|
|
}
|
|
|
if(!CollectionUtils.isEmpty(deptIdList)){
|
|
|
- queryWrapper.in("create_user_dept_id" , deptIdList);
|
|
|
+ queryWrapper.in("b.create_user_dept_id" , deptIdList);
|
|
|
}
|
|
|
if(!ObjectUtils.isEmpty(type)){
|
|
|
- queryWrapper.eq("type",type);
|
|
|
+ queryWrapper.eq("b.type",type);
|
|
|
}
|
|
|
if(!ObjectUtils.isEmpty(livestreamStatus)){
|
|
|
- queryWrapper.eq("livestream_status",livestreamStatus);
|
|
|
+ queryWrapper.eq("b.livestream_status",livestreamStatus);
|
|
|
}
|
|
|
- queryWrapper.groupBy("id");
|
|
|
+ queryWrapper.groupBy("b.id");
|
|
|
//这里投机取巧使用id来代替创建时间来做倒序,历史原因,原来的表没创建时间这个字段
|
|
|
if(StringUtils.isNotBlank(orderBy)){
|
|
|
- queryWrapper.last("order by "+ orderBy);
|
|
|
+ queryWrapper.last("order by b."+ orderBy);
|
|
|
}else {
|
|
|
- queryWrapper.orderByDesc("id");
|
|
|
+ queryWrapper.orderByDesc("b.id");
|
|
|
}
|
|
|
IPage<BrandEntity> page = new Page<>(pageNum , pageSize);
|
|
|
IPage<BrandEntity> resultPage = new Page<>();
|