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

import java.time.LocalDate;
import java.util.List;
import java.util.Set;

import com.bonus.canteen.core.cook.domain.CookRecipeDetail;
import org.apache.ibatis.annotations.Param;

/**
 * 菜品计划详情信息Mapper接口
 *
 * @author xsheng
 * @date 2025-05-25
 */
public interface CookRecipeDetailMapper {
    /**
     * 查询菜品计划详情信息
     *
     * @param recipeDetailId 菜品计划详情信息主键
     * @return 菜品计划详情信息
     */
    public CookRecipeDetail selectCookRecipeDetailByRecipeDetailId(Long recipeDetailId);

    /**
     * 查询菜品计划详情信息列表
     *
     * @param cookRecipeDetail 菜品计划详情信息
     * @return 菜品计划详情信息集合
     */
    public List<CookRecipeDetail> selectCookRecipeDetailList(CookRecipeDetail cookRecipeDetail);

    /**
     * 新增菜品计划详情信息
     *
     * @param cookRecipeDetail 菜品计划详情信息
     * @return 结果
     */
    public int insertCookRecipeDetail(CookRecipeDetail cookRecipeDetail);

    /**
     * 修改菜品计划详情信息
     *
     * @param cookRecipeDetail 菜品计划详情信息
     * @return 结果
     */
    public int updateCookRecipeDetail(CookRecipeDetail cookRecipeDetail);

    /**
     * 删除菜品计划详情信息
     *
     * @param recipeDetailId 菜品计划详情信息主键
     * @return 结果
     */
    public int deleteCookRecipeDetailByRecipeDetailId(Long recipeDetailId);

    /**
     * 批量删除菜品计划详情信息
     *
     * @param recipeDetailIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCookRecipeDetailByRecipeDetailIds(Long[] recipeDetailIds);

    public List<Long> getAllCookRecipeDetailIds(Long[] recipeIds);


    public List<Long> getToDeleteCookRecipeDetailIds4PointDays(@Param("recipeId") Long recipeId, @Param("dateList") List<LocalDate> dateList);

    public List<Long> getToDeleteCookRecipeDetailIds4Daily(@Param("recipeId") Long recipeId);

    public List<Long> getToDeleteCookRecipeDetailIds4WeeklyTemplate(@Param("recipeId") Long recipeId, @Param("applyWeeks") List<Long> applyWeeks);

    public List<Long> getToDeleteCookRecipeDetailIds4WeeklyDetail(@Param("recipeId")Long recipeId, @Param("dateList") List<LocalDate> dateList);

    List<CookRecipeDetail> getCookRecipeDetailLTemplate(@Param("recipeId") Long recipeId, @Param("detailType") String detailType);

    List<CookRecipeDetail> getByRecipeIdAndDatesAndIntervalId(@Param("recipeId") Long recipeId, @Param("dateList") Set<LocalDate> dateList, @Param("mealtimeType") Long mealtimeType);

}
