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

import java.util.List;
import com.bonus.canteen.core.cook.domain.CookRecipeDishes;
import org.apache.ibatis.annotations.Param;

/**
 * 菜品计划菜品关联Mapper接口
 *
 * @author xsheng
 * @date 2025-05-25
 */
public interface CookRecipeDishesMapper {
    /**
     * 查询菜品计划菜品关联
     *
     * @param id 菜品计划菜品关联主键
     * @return 菜品计划菜品关联
     */
    public CookRecipeDishes selectCookRecipeDishesById(Long id);

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

    /**
     * 新增菜品计划菜品关联
     *
     * @param cookRecipeDishes 菜品计划菜品关联
     * @return 结果
     */
    public int insertCookRecipeDishes(CookRecipeDishes cookRecipeDishes);

    /**
     * 修改菜品计划菜品关联
     *
     * @param cookRecipeDishes 菜品计划菜品关联
     * @return 结果
     */
    public int updateCookRecipeDishes(CookRecipeDishes cookRecipeDishes);

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

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

    /**
     * 删除菜谱关联菜品信息
     * @param recipeDetailIds id集合
     * @return 是否成功
     */
    public int deleteCookRecipeDishesByCookRecipeDetailIds(Long[] recipeDetailIds);

    List<CookRecipeDishes> getCookRecipeDishesByDetailId(@Param("recipeDetailId") Long recipeDetailId);

    public int reduceCookRecipeDishesSupplyNum(@Param("dish") CookRecipeDishes menuRecipeDishes,
                                               @Param("quantity") Integer quantity);

    public int addCookRecipeDishesSupplyNum(@Param("dish")CookRecipeDishes menuRecipeDishes,
                                            @Param("quantity") Integer quantity);


}
