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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.menu.entity.MenuDishesEffectRelation;
import com.bonus.canteen.core.menu.vo.MenuDishesEffectPageVO;
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 MenuDishesEffectRelationMapper extends BaseMapper<MenuDishesEffectRelation> {
   int insertBatch(@Param("effectIdsList") List<MenuDishesEffectRelation> effectIdsList);

   @Select({"select mde.effect_id,mde.effect_name from menu_dishes_effect mde left join menu_dishes_effect_relation mser on mser.effect_id = mde.effect_id where mser.dishes_id = #{dishesId} and mser.del_flag = #{delFlag}"})
   List<MenuDishesEffectPageVO> selectListByDishesId(MenuDishesEffectRelation menuDishesEffectRelation);
}
