菜谱列表-获取菜品列表
This commit is contained in:
parent
36758547b1
commit
6a8aeca08f
|
|
@ -34,6 +34,11 @@ public class UserInfoVo {
|
||||||
*/
|
*/
|
||||||
private BigDecimal subsidiesBalance;
|
private BigDecimal subsidiesBalance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户状态 1正常 2冻结 3销户
|
||||||
|
*/
|
||||||
|
private String accStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.canteen.core.menu.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.menu.dto.MenuRecipeParamDTO;
|
||||||
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -113,4 +114,12 @@ public class MenuRecipeController extends BaseController {
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(menuRecipeService.deleteMenuRecipeByIds(ids));
|
return toAjax(menuRecipeService.deleteMenuRecipeByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping({"/getDishesList"})
|
||||||
|
@ApiOperation("菜谱列表-获取菜品列表")
|
||||||
|
public AjaxResult getDishesList(@RequestBody MenuRecipeParamDTO dto) {
|
||||||
|
return this.menuRecipeService.getDishesList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.bonus.canteen.core.menu.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class MenuRecipeParamDTO {
|
||||||
|
@ApiModelProperty("菜谱id")
|
||||||
|
private Long recipeId;
|
||||||
|
@ApiModelProperty("菜谱名称")
|
||||||
|
private String recipeName;
|
||||||
|
@ApiModelProperty("区域Id")
|
||||||
|
private Long areaId;
|
||||||
|
private List<Long> areaIds;
|
||||||
|
@ApiModelProperty("食堂id")
|
||||||
|
private Long canteenId;
|
||||||
|
private List<Long> canteenIds;
|
||||||
|
@ApiModelProperty("档口id")
|
||||||
|
private Long stallId;
|
||||||
|
private List<Long> stallIds;
|
||||||
|
@ApiModelProperty("菜谱类型")
|
||||||
|
private Integer recipeType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.bonus.canteen.core.menu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class RecipeDishesCountDTO {
|
||||||
|
private Long recipeId;
|
||||||
|
private Integer num;
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
package com.bonus.canteen.core.menu.mapper;
|
package com.bonus.canteen.core.menu.mapper;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import com.bonus.canteen.core.menu.domain.MenuRecipe;
|
import com.bonus.canteen.core.menu.domain.MenuRecipe;
|
||||||
|
import com.bonus.canteen.core.menu.dto.MenuRecipeParamDTO;
|
||||||
|
import com.bonus.canteen.core.menu.dto.RecipeDishesCountDTO;
|
||||||
|
import com.bonus.canteen.core.menu.vo.MenuRecipeDataVO;
|
||||||
|
import com.bonus.canteen.core.menu.vo.MenuRecipeV2VO;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜品计划信息Mapper接口
|
* 菜品计划信息Mapper接口
|
||||||
|
|
@ -58,4 +68,23 @@ public interface MenuRecipeMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMenuRecipeByIds(Long[] ids);
|
public int deleteMenuRecipeByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取菜品列表
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MenuRecipeV2VO> getDishesList(MenuRecipeParamDTO dto);
|
||||||
|
/**
|
||||||
|
* 根据recipeIds获取菜品数量
|
||||||
|
* @param recipeIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RecipeDishesCountDTO> getDishesCountByRecipeIds(@Param("recipeIds") List<Long> recipeIds);
|
||||||
|
/**
|
||||||
|
* 根据recipeIds获取日期
|
||||||
|
* @param recipeIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MenuRecipeDataVO> selectApplyDateListByRecipeId(@Param("applyDate") LocalDate applyDate, @Param("recipeIds") List<Long> recipeIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.bonus.canteen.core.menu.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.canteen.core.menu.domain.MenuRecipe;
|
import com.bonus.canteen.core.menu.domain.MenuRecipe;
|
||||||
|
import com.bonus.canteen.core.menu.dto.MenuRecipeParamDTO;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜品计划信息Service接口
|
* 菜品计划信息Service接口
|
||||||
|
|
@ -57,4 +59,11 @@ public interface IMenuRecipeService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMenuRecipeById(Long id);
|
public int deleteMenuRecipeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜谱列表-获取菜品列表
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getDishesList(MenuRecipeParamDTO dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,25 @@
|
||||||
package com.bonus.canteen.core.menu.service.impl;
|
package com.bonus.canteen.core.menu.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.time.DayOfWeek;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.TemporalAccessor;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.bonus.canteen.core.menu.dto.MenuRecipeParamDTO;
|
||||||
|
import com.bonus.canteen.core.menu.dto.RecipeDishesCountDTO;
|
||||||
|
import com.bonus.canteen.core.menu.mapper.MenuRecipeDishesMapper;
|
||||||
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
import com.bonus.canteen.core.menu.service.IMenuRecipeService;
|
||||||
|
import com.bonus.canteen.core.menu.vo.MenuRecipeDataVO;
|
||||||
|
import com.bonus.canteen.core.menu.vo.MenuRecipeV2VO;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.canteen.core.menu.mapper.MenuRecipeMapper;
|
import com.bonus.canteen.core.menu.mapper.MenuRecipeMapper;
|
||||||
|
|
@ -12,7 +27,7 @@ import com.bonus.canteen.core.menu.domain.MenuRecipe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜品计划信息Service业务层处理
|
* 菜品计划信息Service业务层处理
|
||||||
*
|
*
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2025-04-03
|
* @date 2025-04-03
|
||||||
*/
|
*/
|
||||||
|
|
@ -23,7 +38,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜品计划信息
|
* 查询菜品计划信息
|
||||||
*
|
*
|
||||||
* @param id 菜品计划信息主键
|
* @param id 菜品计划信息主键
|
||||||
* @return 菜品计划信息
|
* @return 菜品计划信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,7 +49,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜品计划信息列表
|
* 查询菜品计划信息列表
|
||||||
*
|
*
|
||||||
* @param menuRecipe 菜品计划信息
|
* @param menuRecipe 菜品计划信息
|
||||||
* @return 菜品计划信息
|
* @return 菜品计划信息
|
||||||
*/
|
*/
|
||||||
|
|
@ -45,7 +60,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增菜品计划信息
|
* 新增菜品计划信息
|
||||||
*
|
*
|
||||||
* @param menuRecipe 菜品计划信息
|
* @param menuRecipe 菜品计划信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -61,7 +76,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改菜品计划信息
|
* 修改菜品计划信息
|
||||||
*
|
*
|
||||||
* @param menuRecipe 菜品计划信息
|
* @param menuRecipe 菜品计划信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,7 +92,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除菜品计划信息
|
* 批量删除菜品计划信息
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的菜品计划信息主键
|
* @param ids 需要删除的菜品计划信息主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -88,7 +103,7 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜品计划信息信息
|
* 删除菜品计划信息信息
|
||||||
*
|
*
|
||||||
* @param id 菜品计划信息主键
|
* @param id 菜品计划信息主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -96,4 +111,65 @@ public class MenuRecipeServiceImpl implements IMenuRecipeService {
|
||||||
public int deleteMenuRecipeById(Long id) {
|
public int deleteMenuRecipeById(Long id) {
|
||||||
return menuRecipeMapper.deleteMenuRecipeById(id);
|
return menuRecipeMapper.deleteMenuRecipeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜谱列表-获取菜品列表
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getDishesList(MenuRecipeParamDTO dto) {
|
||||||
|
List<MenuRecipeV2VO> list = menuRecipeMapper.getDishesList(dto);
|
||||||
|
List<LocalDate> last = this.getLastWeekDate();
|
||||||
|
List<Long> recipeIds = list.stream().map(MenuRecipeV2VO::getRecipeId).collect(Collectors.toList());
|
||||||
|
List<RecipeDishesCountDTO> dishesCountByRecipeIdsList = menuRecipeMapper.getDishesCountByRecipeIds(recipeIds);
|
||||||
|
Map<Long, Integer> dishesCountByRecipeIds = dishesCountByRecipeIdsList.stream().collect(Collectors.toMap(RecipeDishesCountDTO::getRecipeId, RecipeDishesCountDTO::getNum));
|
||||||
|
List<MenuRecipeDataVO> recipeDatesList = this.menuRecipeMapper.selectApplyDateListByRecipeId(LocalDate.now(),recipeIds);
|
||||||
|
Map<Long, TreeSet<LocalDate>> recipeDates = recipeDatesList.stream().collect(Collectors.groupingBy(MenuRecipeDataVO::getRecipeId, Collectors.mapping(MenuRecipeDataVO::getApplyData, Collectors.toCollection(TreeSet::new))));
|
||||||
|
if (list.isEmpty()){
|
||||||
|
return AjaxResult.success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
list.forEach(r -> {
|
||||||
|
Long recipeId = r.getRecipeId();
|
||||||
|
r.setDishesCount(dishesCountByRecipeIds.getOrDefault(recipeId, 0));
|
||||||
|
Set<LocalDate> applyDateList = recipeDates.getOrDefault(recipeId, new TreeSet<>());
|
||||||
|
Object finalDate;
|
||||||
|
if (ObjectUtil.equal(r.getRecipeType(), 3)) {
|
||||||
|
Stream<LocalDate> var10000 = last.stream();
|
||||||
|
Objects.requireNonNull(applyDateList);
|
||||||
|
finalDate = var10000.filter(applyDateList::contains).collect(Collectors.toList());
|
||||||
|
} else if (ObjectUtil.equal(r.getRecipeType(), 2)) {
|
||||||
|
finalDate = this.getLastWeek();
|
||||||
|
} else {
|
||||||
|
finalDate = new ArrayList<>(applyDateList);
|
||||||
|
}
|
||||||
|
List<String> applyDateStringList = Lists.newArrayList();
|
||||||
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("MM-dd");
|
||||||
|
((List)finalDate).forEach(d -> {
|
||||||
|
applyDateStringList.add(dateTimeFormatter.format((TemporalAccessor) d));
|
||||||
|
});
|
||||||
|
r.setApplyDateList((List)finalDate);
|
||||||
|
r.setApplyDateStringList(applyDateStringList);
|
||||||
|
});
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LocalDate> getLastWeekDate() {
|
||||||
|
List<LocalDate> objects = new ArrayList<>();
|
||||||
|
LocalDate sunday = LocalDate.now().with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
for(LocalDate date = now; date.isBefore(sunday) || date.isEqual(sunday); date = date.plusDays(1L)) {
|
||||||
|
objects.add(date);
|
||||||
|
}
|
||||||
|
return objects;
|
||||||
|
}
|
||||||
|
public List<LocalDate> getLastWeek() {
|
||||||
|
List<LocalDate> dates = new ArrayList<>();
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
for(int i = 0; i < 7; ++i) {
|
||||||
|
dates.add(now.plusDays(i));
|
||||||
|
}
|
||||||
|
return dates;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.bonus.canteen.core.menu.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class MenuRecipeDataVO {
|
||||||
|
@ApiModelProperty("菜谱id")
|
||||||
|
private Long recipeId;
|
||||||
|
@ApiModelProperty("日期")
|
||||||
|
private LocalDate applyData;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.bonus.canteen.core.menu.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@ApiModel("菜谱计划发布记录列表")
|
||||||
|
public class MenuRecipeV2VO {
|
||||||
|
@ApiModelProperty("菜谱id")
|
||||||
|
private Long recipeId;
|
||||||
|
@ApiModelProperty("菜谱类型")
|
||||||
|
private Integer recipeType;
|
||||||
|
@ApiModelProperty("菜谱名称")
|
||||||
|
private String recipeName;
|
||||||
|
@ApiModelProperty("区域id")
|
||||||
|
private Long areaId;
|
||||||
|
@ApiModelProperty("区域名称")
|
||||||
|
private String areaName;
|
||||||
|
@ApiModelProperty("食堂id")
|
||||||
|
private Long canteenId;
|
||||||
|
@ApiModelProperty("食堂名称")
|
||||||
|
private String canteenName;
|
||||||
|
@ApiModelProperty("档口id")
|
||||||
|
private Long stallId;
|
||||||
|
@ApiModelProperty("档口名称")
|
||||||
|
private String stallName;
|
||||||
|
@ApiModelProperty("菜品数量")
|
||||||
|
private Integer dishesCount;
|
||||||
|
@ApiModelProperty("生效范围id")
|
||||||
|
private Long effId;
|
||||||
|
@ApiModelProperty("生效范围名称")
|
||||||
|
private String effName;
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String crby;
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime crtime;
|
||||||
|
@ApiModelProperty("已排菜日期")
|
||||||
|
private List<LocalDate> applyDateList;
|
||||||
|
@ApiModelProperty("已排菜日期(月-日)")
|
||||||
|
private List<String> applyDateStringList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -9,9 +9,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
su.nick_name as userName,
|
su.nick_name as userName,
|
||||||
ac.acc_id as accId,
|
ac.acc_id as accId,
|
||||||
ac.card_num as cardNum,
|
ac.card_num as cardNum,
|
||||||
ac.serial_num as serialNum
|
ac.serial_num as serialNum,
|
||||||
|
ai.acc_status as accStatus
|
||||||
from sys_user su
|
from sys_user su
|
||||||
left join acc_card ac on ac.user_id = su.user_id
|
left join acc_card ac on ac.user_id = su.user_id
|
||||||
|
left join acc_info ai on ai.user_id = su.user_id
|
||||||
<where>
|
<where>
|
||||||
<if test="type == 'user'">
|
<if test="type == 'user'">
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectMenuRecipeVo"/>
|
<include refid="selectMenuRecipeVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDishesList" resultType="com.bonus.canteen.core.menu.vo.MenuRecipeV2VO">
|
||||||
|
select
|
||||||
|
mr.recipe_id,
|
||||||
|
mr.recipe_name,
|
||||||
|
mr.recipe_type,
|
||||||
|
ac.canteen_id,
|
||||||
|
ac.canteen_name,
|
||||||
|
aa.area_id,
|
||||||
|
aa.area_name,
|
||||||
|
a.stall_id,
|
||||||
|
a.stall_name,
|
||||||
|
mr.create_time,
|
||||||
|
mr.create_by
|
||||||
|
from
|
||||||
|
menu_recipe mr
|
||||||
|
left join alloc_canteen ac on mr.canteen_id = ac.canteen_id
|
||||||
|
left join alloc_stall a on mr.stall_id = a.stall_id
|
||||||
|
left join alloc_area aa on ac.area_id = aa.area_id
|
||||||
|
where 1 = 1
|
||||||
|
<if test="recipeId != null ">
|
||||||
|
and mr.recipe_id = #{recipeId}
|
||||||
|
</if>
|
||||||
|
<if test="areaIds != null and areaIds.size >0">
|
||||||
|
and aa.area_id in
|
||||||
|
<foreach collection="areaIds" item="areaId" open="(" separator="," close=")">
|
||||||
|
#{areaId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="recipeName != null and recipeName != ''">
|
||||||
|
and mr.recipe_name like concat('%', #{recipeName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="canteenId != null and canteenId !=-1">
|
||||||
|
and mr.canteen_id = #{canteenId}
|
||||||
|
</if>
|
||||||
|
<if test="canteenIds != null and canteenIds.size >0">
|
||||||
|
and ac.canteen_id in
|
||||||
|
<foreach collection="canteenIds" item="canteenId" open="(" separator="," close=")">
|
||||||
|
#{canteenId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="stallId != null and stallId !=-1">
|
||||||
|
and mr.stall_id = #{stallId}
|
||||||
|
</if>
|
||||||
|
<if test="stallIds != null and stallIds.size >0">
|
||||||
|
and a.stall_id in
|
||||||
|
<foreach collection="stallIds" item="stallId" open="(" separator="," close=")">
|
||||||
|
#{stallId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="areaId != null and areaId !=-1">
|
||||||
|
and ac.area_id = #{areaId}
|
||||||
|
</if>
|
||||||
|
<if test="areaIds != null and areaIds.size >0">
|
||||||
|
and ac.area_id in
|
||||||
|
<foreach collection="areaIds" item="areaId" open="(" separator="," close=")">
|
||||||
|
#{areaId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="recipeType != null">
|
||||||
|
and mr.recipe_type = #{recipeType}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getDishesCountByRecipeIds" resultType="com.bonus.canteen.core.menu.dto.RecipeDishesCountDTO">
|
||||||
|
SELECT
|
||||||
|
mrd.recipe_id,count(DISTINCT(md.base_dishes_id)) as num
|
||||||
|
FROM
|
||||||
|
menu_recipe_detail mrd
|
||||||
|
LEFT JOIN menu_recipe_dishes mrdd ON mrd.detail_id = mrdd.detail_id
|
||||||
|
LEFT JOIN menu_dishes md ON md.dishes_id = mrdd.dishes_id
|
||||||
|
where
|
||||||
|
mrd.apply_date >= curdate()
|
||||||
|
<if test="recipeIds !=null and recipeIds.size()>0">
|
||||||
|
AND mrd.recipe_id in
|
||||||
|
<foreach collection="recipeIds" separator="," open="(" close=")" item="item">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
GROUP BY mrd.recipe_id
|
||||||
|
</select>
|
||||||
|
<select id="selectApplyDateListByRecipeId" resultType="com.bonus.canteen.core.menu.vo.MenuRecipeDataVO">
|
||||||
|
SELECT recipe_id as recipeId, apply_date as applyData
|
||||||
|
FROM menu_recipe_detail
|
||||||
|
WHERE apply_date >= #{applyDate}
|
||||||
|
<if test="recipeIds !=null and recipeIds.size()>0">
|
||||||
|
AND recipe_id IN
|
||||||
|
<foreach collection="recipeIds" open="(" close=")" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertMenuRecipe" parameterType="com.bonus.canteen.core.menu.domain.MenuRecipe" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertMenuRecipe" parameterType="com.bonus.canteen.core.menu.domain.MenuRecipe" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into menu_recipe
|
insert into menu_recipe
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue