package com.bonus.canteen.core.menu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.device.manage.dto.DeviceBindDTO;
import com.bonus.canteen.core.device.manage.dto.DeviceRecipeDTO;
import com.bonus.canteen.core.menu.dto.StallAndRecipeBindDto;
import com.bonus.canteen.core.menu.entity.MenuAppRecipe;
import com.bonus.canteen.core.menu.vo.AppletReserveCanteenVO;
import com.bonus.canteen.core.menu.vo.AppletWeekCanteenVO;
import com.bonus.canteen.core.menu.vo.MenuAppBindRecipeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

@Mapper
public interface MenuAppRecipeMapper extends BaseMapper<MenuAppRecipe> {
   List<AppletWeekCanteenVO> selectWeekCanteenList(@Param("effIdSet") Set<Long> effIdSet);

   List<Long> selectWeekRecipeId(@Param("recipeId") Long recipeId, @Param("effIdSet") Set<Long> effIdSet);

   List<AppletReserveCanteenVO> selectReserveMealCanteenList(@Param("effIdSet") Set<Long> effIdSet);

   List<DeviceRecipeDTO> getBindByTypeAndStalls(@Param("deviceBinds") List<DeviceBindDTO> deviceBinds, @Param("bindType") Integer bindType);

   List<StallAndRecipeBindDto> selectRecipeByStallIdsAndBindType(@Param("stallIds") List<Long> stallIds, @Param("bindType") Integer bindType);

   List<Long> selectRecipeInSameShop(@Param("stallId") Long stallId, @Param("effId") Long effId, @Param("bindType") Integer bindType, @Param("mealLineId") Long mealLineId);

   @Select({"select bind_type from menu_app_recipe ${ew.customSqlSegment}"})
   List<MenuAppBindRecipeVO> selectRecipeBindApp(@Param("ew") Wrapper<MenuAppRecipe> wrapper);

}
