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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.canteen.core.menu.dto.MenuDishesTastePageDTO;
import com.bonus.canteen.core.menu.entity.MenuDishesTaste;
import com.bonus.canteen.core.menu.entity.MenuTasteDishes;
import com.bonus.canteen.core.menu.vo.MenuDishesTastePageVO;
import com.bonus.canteen.core.menu.vo.MenuTasteDishesPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MenuDishesTasteMapper extends BaseMapper<MenuDishesTaste> {
   List<MenuTasteDishesPageVO> selectListByDishesId(MenuTasteDishes tasteDishes);

   Page<MenuDishesTastePageVO> selectAllList(Page<MenuDishesTaste> page, @Param("dishesTastePageDTO") MenuDishesTastePageDTO dishesTastePageDTO, @Param("delFlag") Integer delFlag);

   @Select({"select taste_id from menu_taste_dishes where del_flag = 2 and dishes_id = #{dishesId}"})
   List<Long> selectTasteByDishesId(@Param("dishesId") Long dishesId);
}
