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.MenuDishesLabelPageDTO;
import com.bonus.canteen.core.menu.entity.MenuDishesLabel;
import com.bonus.canteen.core.menu.entity.MenuLabelDishes;
import com.bonus.canteen.core.menu.vo.MenuDishesLabelPageVO;
import com.bonus.canteen.core.menu.vo.MenuLabelDishesPageVO;
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 MenuDishesLabelMapper extends BaseMapper<MenuDishesLabel> {
   List<MenuLabelDishesPageVO> selectListByDishesId(MenuLabelDishes labelDishes);

   Page<MenuDishesLabelPageVO> selectAllList(Page<MenuDishesLabel> page, @Param("dishesLabelPageDTO") MenuDishesLabelPageDTO dishesLabelPageDTO, @Param("delFlag") Integer delFlag);

   @Select({"select label_id from menu_label_dishes where del_flag = 2 and dishes_id = #{dishesId}"})
   List<Long> selectLabelByDishesId(@Param("dishesId") Long dishesId);
}
