菜谱问题修复
This commit is contained in:
parent
9b2045952e
commit
a107b2b170
|
|
@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.bonus.canteen.core.common.utils.RedisUtil;
|
import com.bonus.canteen.core.common.utils.RedisUtil;
|
||||||
import com.bonus.canteen.core.common.utils.TenantContextHolder;
|
import com.bonus.canteen.core.common.utils.TenantContextHolder;
|
||||||
import com.bonus.canteen.core.menu.dto.*;
|
import com.bonus.canteen.core.menu.dto.*;
|
||||||
|
|
@ -199,5 +200,23 @@ public class MenuRecipeController extends BaseController {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @PostMapping({"/page"})
|
||||||
|
// @ApiOperation("菜谱计划发布记录分页列表")
|
||||||
|
// public Page<MenuRecipeV2PageVO> getMenuRecipeV2Page(@RequestBody MenuRecipeV2PageDTO dto) {
|
||||||
|
// return this.menuRecipeService.getMenuRecipeV2Page(dto);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @PostMapping({"/template/detail"})
|
||||||
|
// @ApiOperation("获取指定菜谱模版详情")
|
||||||
|
// public List<MenuRecipeDetailDateVO> queryRecipeTemplateDate(@RequestBody QueryRecipeTemplateDateDTO dto) {
|
||||||
|
// return this.menuRecipeService.queryRecipeTemplateDate(dto);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @PostMapping({"/date/detail"})
|
||||||
|
// @ApiOperation("获取指定日期菜谱计划菜品详情")
|
||||||
|
// public List<MenuRecipeDetailDateVO> getMenuRecipeDateDetail(@RequestBody MenuRecipeDetailDateDTO dto) {
|
||||||
|
// return this.menuRecipeService.getMenuRecipeDateDetail(dto);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.canteen.core.menu.domain;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
|
@ -27,6 +28,7 @@ public class MenuAppRecipe extends Model<MenuAppRecipe> {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private Long recipeId;
|
private Long recipeId;
|
||||||
private Integer bindType;
|
private Integer bindType;
|
||||||
|
private List<Long> recipeIds;
|
||||||
|
|
||||||
/** 绑定时间 */
|
/** 绑定时间 */
|
||||||
@ApiModelProperty(value = "绑定时间")
|
@ApiModelProperty(value = "绑定时间")
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,7 @@ public class MenuDishesServiceImpl extends ServiceImpl<MenuDishesMapper, MenuDis
|
||||||
nutritionEntityList.add(nutritionEntity);
|
nutritionEntityList.add(nutritionEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(materialList != null && materialList.size() > 0){
|
||||||
//添加菜品和材料关系表
|
//添加菜品和材料关系表
|
||||||
menuDishesMapper.addMenuMaterialDishes(dishesId,materialList);
|
menuDishesMapper.addMenuMaterialDishes(dishesId,materialList);
|
||||||
NutritionEntityUtil nutritionEntityUtil = new NutritionEntityUtil();
|
NutritionEntityUtil nutritionEntityUtil = new NutritionEntityUtil();
|
||||||
|
|
@ -281,6 +282,8 @@ public class MenuDishesServiceImpl extends ServiceImpl<MenuDishesMapper, MenuDis
|
||||||
System.err.println("计算后:"+nutritionEntity.getCalcium());
|
System.err.println("计算后:"+nutritionEntity.getCalcium());
|
||||||
return menuDishesMapper.addFinalNutrition(nutritionEntity,dishesId);
|
return menuDishesMapper.addFinalNutrition(nutritionEntity,dishesId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelReader;
|
import com.alibaba.excel.ExcelReader;
|
||||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.bonus.canteen.core.alloc.domain.AllocArea;
|
import com.bonus.canteen.core.alloc.domain.AllocArea;
|
||||||
import com.bonus.canteen.core.alloc.domain.AllocCanteen;
|
import com.bonus.canteen.core.alloc.domain.AllocCanteen;
|
||||||
|
|
@ -45,6 +47,7 @@ import com.bonus.canteen.core.menu.enums.*;
|
||||||
import com.bonus.canteen.core.menu.enums.MenuRecipeSortEnum;
|
import com.bonus.canteen.core.menu.enums.MenuRecipeSortEnum;
|
||||||
import com.bonus.canteen.core.menu.mapper.*;
|
import com.bonus.canteen.core.menu.mapper.*;
|
||||||
import com.bonus.canteen.core.menu.model.*;
|
import com.bonus.canteen.core.menu.model.*;
|
||||||
|
import com.bonus.canteen.core.menu.service.IMenuRecipeDetailService;
|
||||||
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
||||||
import com.bonus.canteen.core.menu.service.MenuDishesBaseService;
|
import com.bonus.canteen.core.menu.service.MenuDishesBaseService;
|
||||||
import com.bonus.canteen.core.menu.service.MenuDishesSizeService;
|
import com.bonus.canteen.core.menu.service.MenuDishesSizeService;
|
||||||
|
|
@ -65,6 +68,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||||
import com.bonus.common.houqin.i18n.I18n;
|
import com.bonus.common.houqin.i18n.I18n;
|
||||||
import com.bonus.common.houqin.mq.constant.LeMqConstant;
|
import com.bonus.common.houqin.mq.constant.LeMqConstant;
|
||||||
|
import com.bonus.common.houqin.utils.LeBeanUtil;
|
||||||
import com.bonus.common.houqin.utils.id.Id;
|
import com.bonus.common.houqin.utils.id.Id;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
@ -152,6 +156,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
}else{
|
}else{
|
||||||
content.setDeviceTypeList(sortEnum.getDeviceType());
|
content.setDeviceTypeList(sortEnum.getDeviceType());
|
||||||
content.setBindType(sortEnum.getBindType());
|
content.setBindType(sortEnum.getBindType());
|
||||||
|
content.setRecipeName(LeBeanUtil.fieldLikeHandle(content.getRecipeName()));
|
||||||
records = menuRecipeMapper.selectMenuRecipeListV2(content);
|
records = menuRecipeMapper.selectMenuRecipeListV2(content);
|
||||||
if (ObjectUtil.isNotEmpty(records)) {
|
if (ObjectUtil.isNotEmpty(records)) {
|
||||||
List<Long> recipeIds;
|
List<Long> recipeIds;
|
||||||
|
|
@ -161,6 +166,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
List<StallAndRecipeBindDto> stallAndRecipeBindDtos = this.menuRecipeMapper.selectRecipeByStallIdsAndBindType(menuRecipeDateVOS, content.getBindType());
|
List<StallAndRecipeBindDto> stallAndRecipeBindDtos = this.menuRecipeMapper.selectRecipeByStallIdsAndBindType(menuRecipeDateVOS, content.getBindType());
|
||||||
maping = stallAndRecipeBindDtos.stream().collect(Collectors.toMap(StallAndRecipeBindDto::getStallId, StallAndRecipeBindDto::getRecipeId));
|
maping = stallAndRecipeBindDtos.stream().collect(Collectors.toMap(StallAndRecipeBindDto::getStallId, StallAndRecipeBindDto::getRecipeId));
|
||||||
recipeIds = stallAndRecipeBindDtos.stream().map(StallAndRecipeBindDto::getRecipeId).distinct().collect(Collectors.toList());
|
recipeIds = stallAndRecipeBindDtos.stream().map(StallAndRecipeBindDto::getRecipeId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
this.generateRecipe(recipeIds, content.getApplyDate());
|
this.generateRecipe(recipeIds, content.getApplyDate());
|
||||||
List<MenuRecipeDateVO> menuRecipeDateVOS1 = this.menuRecipeMapper.selectTmpBetweenDateDetailList(recipeIds, content.getApplyDate(), content.getApplyDate());
|
List<MenuRecipeDateVO> menuRecipeDateVOS1 = this.menuRecipeMapper.selectTmpBetweenDateDetailList(recipeIds, content.getApplyDate(), content.getApplyDate());
|
||||||
Map<Long, MenuRecipe> recipeMap = (recipeIds == null || recipeIds.isEmpty())
|
Map<Long, MenuRecipe> recipeMap = (recipeIds == null || recipeIds.isEmpty())
|
||||||
|
|
@ -172,7 +178,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
Map<Long, MenuRecipeDateVO> detailMap = menuRecipeDateVOS1.stream().collect(Collectors.toMap(MenuRecipeDateVO::getRecipeId, Function.identity(), (t1, t2) -> {
|
Map<Long, MenuRecipeDateVO> detailMap = menuRecipeDateVOS1.stream().collect(Collectors.toMap(MenuRecipeDateVO::getRecipeId, Function.identity(), (t1, t2) -> {
|
||||||
return t1;
|
return t1;
|
||||||
}));
|
}));
|
||||||
|
System.err.println("records = " + records.size());
|
||||||
AllocRecipeStallVO item;
|
AllocRecipeStallVO item;
|
||||||
long count;
|
long count;
|
||||||
for(Iterator<AllocRecipeStallVO> var12 = records.iterator(); var12.hasNext(); item.setDishesCount(count)) {
|
for(Iterator<AllocRecipeStallVO> var12 = records.iterator(); var12.hasNext(); item.setDishesCount(count)) {
|
||||||
|
|
@ -226,7 +232,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
if (MenuBindTypeEnum.RESERVE.key().equals(content.getBindType())) {
|
if (MenuBindTypeEnum.RESERVE.key().equals(content.getBindType())) {
|
||||||
exists = this.checkCanteenIfReserve(menuRecipe.getCanteenId(), menuRecipe.getStallId());
|
exists = this.checkCanteenIfReserve(menuRecipe.getCanteenId(), menuRecipe.getStallId());
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
throw new ServiceException(I18n.getMessage("不支持与订餐", new Object[0]));
|
throw new ServiceException(I18n.getMessage("不支持预订餐", new Object[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exists = this.menuRecipeMapper.exists(mar);
|
exists = this.menuRecipeMapper.exists(mar);
|
||||||
|
|
@ -235,6 +241,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
}
|
}
|
||||||
List<Long> sourceRecipeList = this.menuRecipeMapper.selectRecipeInSameShop(menuRecipe.getStallId(), null, content.getBindType(), content.getMealLineId());
|
List<Long> sourceRecipeList = this.menuRecipeMapper.selectRecipeInSameShop(menuRecipe.getStallId(), null, content.getBindType(), content.getMealLineId());
|
||||||
if (ObjectUtil.isNotEmpty(sourceRecipeList)) {
|
if (ObjectUtil.isNotEmpty(sourceRecipeList)) {
|
||||||
|
mar.setRecipeIds(sourceRecipeList);
|
||||||
this.menuRecipeMapper.delete(mar);
|
this.menuRecipeMapper.delete(mar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -249,6 +256,7 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
}
|
}
|
||||||
MqUtil.sendDataChange(menuRecipe, LeMqConstant.DataChangeType.ADD, LeMqConstant.Topic.DATA_CHANGE_RECIPE_RELEASE);
|
MqUtil.sendDataChange(menuRecipe, LeMqConstant.DataChangeType.ADD, LeMqConstant.Topic.DATA_CHANGE_RECIPE_RELEASE);
|
||||||
} else {
|
} else {
|
||||||
|
mar.setRecipeIds(Collections.singletonList(mar.getRecipeId()));
|
||||||
this.menuRecipeMapper.delete(mar);
|
this.menuRecipeMapper.delete(mar);
|
||||||
if (ObjectUtil.isNotEmpty(deviceTypes) && deviceTypeList!= null && !deviceTypeList.isEmpty()) {
|
if (ObjectUtil.isNotEmpty(deviceTypes) && deviceTypeList!= null && !deviceTypeList.isEmpty()) {
|
||||||
this.menuRecipeMapper.updateRecipeByCanteeStallMeal("-1", String.valueOf(menuRecipe.getCanteenId()), String.valueOf(menuRecipe.getStallId()), deviceTypeList);
|
this.menuRecipeMapper.updateRecipeByCanteeStallMeal("-1", String.valueOf(menuRecipe.getCanteenId()), String.valueOf(menuRecipe.getStallId()), deviceTypeList);
|
||||||
|
|
@ -574,14 +582,17 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IMenuRecipeDetailService menuRecipeDetailService;
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public synchronized void generateRecipe(List<Long> recipeIdList, LocalDate applyDate) {
|
public synchronized void generateRecipe(List<Long> recipeIdList, LocalDate applyDate) {
|
||||||
if (!ObjectUtil.isEmpty(recipeIdList) && !ObjectUtil.isEmpty(applyDate)) {
|
if (!ObjectUtil.isEmpty(recipeIdList) && !ObjectUtil.isEmpty(applyDate)) {
|
||||||
recipeIdList = new ArrayList<>(recipeIdList);
|
recipeIdList = new ArrayList<>(recipeIdList);
|
||||||
Map<Long, Long> recipeDetailContMap = this.menuRecipeMapper.selectMenuRecipeDetailList(new QueryWrapper<MenuRecipeDetail>()
|
// Map<Long, Long> recipeDetailContMap = this.menuRecipeMapper.selectMenuRecipeDetailList(new QueryWrapper<MenuRecipeDetail>()
|
||||||
.eq("apply_date", applyDate)
|
// .eq("apply_date", applyDate)
|
||||||
.in("recipe_id", recipeIdList))
|
// .in("recipe_id", recipeIdList))
|
||||||
.stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId, Collectors.counting()));
|
// .stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId, Collectors.counting()));
|
||||||
|
Map<Long, Long> recipeDetailContMap = (Map) menuRecipeDetailService.list((Wrapper<MenuRecipeDetail>) ((LambdaQueryWrapper<MenuRecipeDetail>) Wrappers.lambdaQuery(MenuRecipeDetail.class).select(MenuRecipeDetail::getRecipeId).eq(MenuRecipeDetail::getApplyDate, applyDate)).in(MenuRecipeDetail::getRecipeId, recipeIdList)).stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId, Collectors.counting()));
|
||||||
recipeIdList.removeAll(recipeDetailContMap.keySet());
|
recipeIdList.removeAll(recipeDetailContMap.keySet());
|
||||||
if (!ObjectUtil.isEmpty(recipeIdList)) {
|
if (!ObjectUtil.isEmpty(recipeIdList)) {
|
||||||
List<MenuRecipe> menuRecipes = this.list(Wrappers.lambdaQuery(MenuRecipe.class).in(MenuRecipe::getRecipeType, new Object[]{2, 3})
|
List<MenuRecipe> menuRecipes = this.list(Wrappers.lambdaQuery(MenuRecipe.class).in(MenuRecipe::getRecipeType, new Object[]{2, 3})
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="shopstallId != null "> and b.shopstall_id = #{shopstallId}</if>
|
<if test="shopstallId != null "> and b.shopstall_id = #{shopstallId}</if>
|
||||||
<if test="areaId != null "> and b.area_id = #{areaId}</if>
|
<if test="areaId != null "> and b.area_id = #{areaId}</if>
|
||||||
<if test="typeId != null "> and b.type_id = #{typeId}</if>
|
<if test="typeId != null "> and b.type_id = #{typeId}</if>
|
||||||
|
|
||||||
|
<if test="dishesName !=null and dishesName !=''"> and b.dishes_name like concat('%',#{dishesName},'%')</if>
|
||||||
<if test="typeIdList != null and typeIdList.size() > 0">
|
<if test="typeIdList != null and typeIdList.size() > 0">
|
||||||
and b.type_id in
|
and b.type_id in
|
||||||
<foreach item="id" collection="typeIdList" open="(" separator="," close=")">
|
<foreach item="id" collection="typeIdList" open="(" separator="," close=")">
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 获取指定日期菜谱详情 -->
|
||||||
|
<resultMap id="menuRecipeDateVO" type="com.bonus.canteen.core.menu.vo.MenuRecipeDateVO">
|
||||||
|
<result property="day" column="apply_date"/>
|
||||||
|
<result property="recipeId" column="recipe_id"/>
|
||||||
|
<collection property="details" ofType="com.bonus.canteen.core.menu.vo.MenuRecipeDetailDateVO">
|
||||||
|
<result property="mealtimeType" column="mealtime_type"/>
|
||||||
|
<result property="detailId" column="detail_id"/>
|
||||||
|
<collection property="dishesList" ofType="com.bonus.canteen.core.menu.vo.MenuRecipeDetailDishesVO">
|
||||||
|
<result property="dishesId" column="dishes_id"/>
|
||||||
|
<result property="dishesName" column="dishes_name"/>
|
||||||
|
<result property="dishesId" column="dishesId"/>
|
||||||
|
<result property="price" column="price"/>
|
||||||
|
<result property="sizeType" column="size_type"/>
|
||||||
|
<result property="supplyNum" column="supply_num"/>
|
||||||
|
<result property="saleNum" column="sale_num"/>
|
||||||
|
<result property="surplusNum" column="surplus_num"/>
|
||||||
|
<result property="restrictNum" column="restrict_num"/>
|
||||||
|
<result property="salePrice" column="sale_price"/>
|
||||||
|
<result property="recommendFlag" column="recommend_flag"/>
|
||||||
|
<result property="sortNum" column="sort_num"/>
|
||||||
|
<result property="typeId" column="type_id"/>
|
||||||
|
<result property="typeName" column="type_name"/>
|
||||||
|
<result property="salesMode" column="sales_mode"/>
|
||||||
|
<result property="canteenName" column="canteen_name"/>
|
||||||
|
<result property="unitPrice" column="unit_price"/>
|
||||||
|
<result property="mealType" column="meal_type"/>
|
||||||
|
<result property="dishesNum" column="dishes_num"/>
|
||||||
|
<result property="materialCost" column="material_cost"/>
|
||||||
|
</collection>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectMenuRecipeVo">
|
<sql id="selectMenuRecipeVo">
|
||||||
select id, recipe_id, plan_id, recipe_name, is_default, recipe_type, effect_date, expire_date, canteen_id, stall_id, enable_flag, revision, create_by, create_time, update_by, update_time, remark from menu_recipe
|
select id, recipe_id, plan_id, recipe_name, is_default, recipe_type, effect_date, expire_date, canteen_id, stall_id, enable_flag, revision, create_by, create_time, update_by, update_time, remark from menu_recipe
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -1004,7 +1036,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="delete" parameterType="com.bonus.canteen.core.menu.domain.MenuAppRecipe">
|
<delete id="delete" parameterType="com.bonus.canteen.core.menu.domain.MenuAppRecipe">
|
||||||
delete from menu_app_recipe where recipe_id = #{recipeId}
|
delete from menu_app_recipe where recipe_id in
|
||||||
|
<foreach collection="recipeIds" item="recipeId" separator="," open="(" close=")">
|
||||||
|
#{recipeId}
|
||||||
|
</foreach>
|
||||||
<if test="mealLineId != null">
|
<if test="mealLineId != null">
|
||||||
and meal_line_id = #{mealLineId}
|
and meal_line_id = #{mealLineId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -1136,26 +1171,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectMenuRecipeListV2" resultType="com.bonus.canteen.core.menu.vo.AllocRecipeStallVO">
|
<select id="selectMenuRecipeListV2" resultType="com.bonus.canteen.core.menu.vo.AllocRecipeStallVO">
|
||||||
SELECT
|
SELECT
|
||||||
t3.area_id as areaId, t3.area_name as areaName, t2.canteen_id as canteenId,
|
t3.area_id, t3.area_name, t2.canteen_id, t2.canteen_name, t1.stall_id, t1.stall_name
|
||||||
t2.canteen_name as canteenName, t1.stall_id as stallId, t1.stall_name as stallName,
|
|
||||||
a.recipe_id as recipeId,a.recipe_name as recipeName
|
|
||||||
FROM
|
FROM
|
||||||
alloc_stall t1
|
alloc_stall t1
|
||||||
LEFT JOIN alloc_canteen t2 ON t1.canteen_id = t2.canteen_id
|
LEFT JOIN alloc_canteen t2 ON t1.canteen_id = t2.canteen_id
|
||||||
LEFT JOIN alloc_area t3 ON t2.area_id = t3.area_id
|
LEFT JOIN alloc_area t3 ON t2.area_id = t3.area_id
|
||||||
LEFT JOIN(
|
where 1=1
|
||||||
select
|
<if test="recipeName !=null and recipeName !=''">
|
||||||
mar.recipe_id,
|
AND EXISTS (
|
||||||
mr.stall_id,
|
select null
|
||||||
mar.bind_type,
|
from menu_app_recipe t4 INNER JOIN menu_recipe t5 on t4.recipe_id = t5.recipe_id
|
||||||
mr.recipe_name
|
where t5.stall_id = t1.stall_id AND t4.bind_type = #{bindType}
|
||||||
from menu_app_recipe mar
|
and t5.recipe_name like #{recipeName}
|
||||||
left join menu_recipe mr on mar.recipe_id = mr.recipe_id
|
)
|
||||||
where bind_type = #{bindType}
|
</if>
|
||||||
) a on a.stall_id =t1.stall_id
|
|
||||||
<if test="deviceTypeList != null and deviceTypeList.size() > 0">
|
<if test="deviceTypeList != null and deviceTypeList.size() > 0">
|
||||||
and
|
AND EXISTS (
|
||||||
EXISTS (
|
|
||||||
SELECT NULL
|
SELECT NULL
|
||||||
FROM
|
FROM
|
||||||
device_bind t6
|
device_bind t6
|
||||||
|
|
@ -1169,9 +1200,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
where 1= 1
|
|
||||||
|
|
||||||
<if test="areaId !=null">
|
<if test="areaId !=null">
|
||||||
and t3.area_id = #{areaId}
|
and t3.area_id = #{areaId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -1182,28 +1210,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and t1.stall_id = #{stallId}
|
and t1.stall_id = #{stallId}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<!-- <if test="areaIds !=null and areaIds.size()>0">-->
|
<!-- SELECT-->
|
||||||
<!-- and t3.area_id in-->
|
<!-- t3.area_id as areaId, t3.area_name as areaName, t2.canteen_id as canteenId,-->
|
||||||
<!-- <foreach collection="areaIds" open="(" close=")" item="item" separator=",">-->
|
<!-- t2.canteen_name as canteenName, t1.stall_id as stallId, t1.stall_name as stallName,-->
|
||||||
<!-- #{item}-->
|
<!-- a.recipe_id as recipeId,a.recipe_name as recipeName-->
|
||||||
<!-- </foreach>-->
|
<!-- FROM-->
|
||||||
<!-- </if>-->
|
<!-- alloc_stall t1-->
|
||||||
<!-- <if test="canteenIds !=null and canteenIds.size()>0">-->
|
<!-- LEFT JOIN alloc_canteen t2 ON t1.canteen_id = t2.canteen_id-->
|
||||||
<!-- and t2.canteen_id in-->
|
<!-- LEFT JOIN alloc_area t3 ON t2.area_id = t3.area_id-->
|
||||||
<!-- <foreach collection="canteenIds" open="(" close=")" item="item" separator=",">-->
|
<!-- LEFT JOIN(-->
|
||||||
<!-- #{item}-->
|
<!-- select-->
|
||||||
<!-- </foreach>-->
|
<!-- mar.recipe_id,-->
|
||||||
<!-- </if>-->
|
<!-- mr.stall_id,-->
|
||||||
<!-- <if test="stallIds !=null and stallIds.size()>0">-->
|
<!-- mar.bind_type,-->
|
||||||
<!-- and t1.stall_id in-->
|
<!-- mr.recipe_name-->
|
||||||
<!-- <foreach collection="stallIds" open="(" close=")" item="item" separator=",">-->
|
<!-- from menu_app_recipe mar-->
|
||||||
<!-- #{item}-->
|
<!-- left join menu_recipe mr on mar.recipe_id = mr.recipe_id-->
|
||||||
|
<!-- where bind_type = #{bindType}-->
|
||||||
|
<!-- ) a on a.stall_id =t1.stall_id-->
|
||||||
|
<!-- <if test="deviceTypeList != null and deviceTypeList.size() > 0">-->
|
||||||
|
<!-- and-->
|
||||||
|
<!-- EXISTS (-->
|
||||||
|
<!-- SELECT NULL-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- device_bind t6-->
|
||||||
|
<!-- LEFT JOIN device_info t7 ON t7.device_id = t6.device_id-->
|
||||||
|
<!-- WHERE-->
|
||||||
|
<!-- t6.canteen_id = t2.canteen_id-->
|
||||||
|
<!-- AND t6.stall_id = t1.stall_id-->
|
||||||
|
<!-- AND t7.device_type IN-->
|
||||||
|
<!-- <foreach collection="deviceTypeList" item="deviceType" separator="," open="(" close=")">-->
|
||||||
|
<!-- #{deviceType}-->
|
||||||
<!-- </foreach>-->
|
<!-- </foreach>-->
|
||||||
|
<!-- )-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="recipeName !=null and recipeName !=''">
|
<!-- where 1= 1-->
|
||||||
and a.recipe_name like concat('%', #{recipeName}, '%')
|
|
||||||
</if>
|
<!-- <if test="areaId !=null">-->
|
||||||
|
<!-- and t3.area_id = #{areaId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="canteenId !=null">-->
|
||||||
|
<!-- and t2.canteen_id = #{canteenId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="stallId !=null ">-->
|
||||||
|
<!-- and t1.stall_id = #{stallId}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
|
||||||
|
<!-- <if test="recipeName !=null and recipeName !=''">-->
|
||||||
|
<!-- and a.recipe_name like concat('%', #{recipeName}, '%')-->
|
||||||
|
<!-- </if>-->
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRecipeByStallIdsAndBindType"
|
<select id="selectRecipeByStallIdsAndBindType"
|
||||||
|
|
@ -1223,7 +1279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTmpBetweenDateDetailList" resultType="com.bonus.canteen.core.menu.vo.MenuRecipeDateVO">
|
<select id="selectTmpBetweenDateDetailList" resultMap="menuRecipeDateVO">
|
||||||
|
|
||||||
select mrd.mealtime_type,
|
select mrd.mealtime_type,
|
||||||
mrd.recipe_id,
|
mrd.recipe_id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue