菜谱中菜品集合名称查询优化
This commit is contained in:
@@ -136,7 +136,7 @@ public class FoodBookServiceImpl extends ServiceImpl<FoodBookMapper, FoodBook> i
|
|||||||
foodBookVO.setDishIdList(dishIdList);
|
foodBookVO.setDishIdList(dishIdList);
|
||||||
LambdaQueryWrapper<Dish> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Dish> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(Dish::getDishId, split);
|
queryWrapper.in(Dish::getDishId, split);
|
||||||
queryWrapper.last("or del_flag = 1");
|
queryWrapper.last("or (del_flag = 1 and dish_id in ("+ids+"))" );
|
||||||
List<Dish> dishList = dishService.list(queryWrapper);
|
List<Dish> dishList = dishService.list(queryWrapper);
|
||||||
String names = dishList.stream().map(Dish::getDishName).reduce((a, b) -> a + "," + b).get();
|
String names = dishList.stream().map(Dish::getDishName).reduce((a, b) -> a + "," + b).get();
|
||||||
foodBookVO.setDishNames(names);
|
foodBookVO.setDishNames(names);
|
||||||
|
|||||||
Reference in New Issue
Block a user