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

import java.util.Collection;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.menu.domain.MenuRecipeDetail;
import com.bonus.canteen.core.menu.domain.MenuRecipeDishes;
import org.apache.ibatis.annotations.Param;

/**
 * 菜品计划菜品关联Mapper接口
 *
 * @author xsheng
 * @date 2025-04-03
 */
public interface MenuRecipeDishesMapper extends BaseMapper<MenuRecipeDishes> {
    /**
     * 查询菜品计划菜品关联
     *
     * @param id 菜品计划菜品关联主键
     * @return 菜品计划菜品关联
     */
    public MenuRecipeDishes selectMenuRecipeDishesById(Long id);



    /**
     * 查询菜品计划菜品关联列表
     *
     * @param menuRecipeDishes 菜品计划菜品关联
     * @return 菜品计划菜品关联集合
     */
    public List<MenuRecipeDishes> selectMenuRecipeDishesList(MenuRecipeDishes menuRecipeDishes);

    /**
     * 新增菜品计划菜品关联
     *
     * @param menuRecipeDishes 菜品计划菜品关联
     * @return 结果
     */
    public int insertMenuRecipeDishes(MenuRecipeDishes menuRecipeDishes);

    /**
     * 修改菜品计划菜品关联
     *
     * @param menuRecipeDishes 菜品计划菜品关联
     * @return 结果
     */
    public int updateMenuRecipeDishes(MenuRecipeDishes menuRecipeDishes);

    public int reduceMenuRecipeDishesSupplyNum(@Param("dish") MenuRecipeDishes menuRecipeDishes, @Param("quantity") Integer quantity);

    public int addMenuRecipeDishesSupplyNum(@Param("dish")MenuRecipeDishes menuRecipeDishes, @Param("quantity") Integer quantity);

    /**
     * 删除菜品计划菜品关联
     *
     * @param id 菜品计划菜品关联主键
     * @return 结果
     */
    public int deleteMenuRecipeDishesById(Long id);

    /**
     * 批量删除菜品计划菜品关联
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMenuRecipeDishesByIds(Long[] ids);

    Integer insertValues(Collection<MenuRecipeDishes> list);
}
