package com.jeesharp.business.modules.food.mapper;

import com.jeesharp.business.modules.food.entity.FoodMealMenu;
import com.jeesharp.business.modules.food.vo.FoodMealMenuQueryVO;
import com.jeesharp.framework.mybatis.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface FoodMealMenuMapper extends BaseMapper<FoodMealMenu, FoodMealMenuQueryVO> {

    int countSameScope(@Param("id") String id, @Param("serviceAreaId") String serviceAreaId,
                       @Param("menuDate") LocalDate menuDate, @Param("mealType") String mealType,
                       @Param("scopeType") String scopeType, @Param("companyId") String companyId);

    FoodMealMenu selectSameScope(@Param("serviceAreaId") String serviceAreaId,
                                 @Param("menuDate") LocalDate menuDate, @Param("mealType") String mealType,
                                 @Param("scopeType") String scopeType, @Param("companyId") String companyId);

    List<String> selectIdsBySameScope(@Param("serviceAreaId") String serviceAreaId,
                                      @Param("menuDate") LocalDate menuDate, @Param("mealType") String mealType,
                                      @Param("scopeType") String scopeType, @Param("companyId") String companyId);

    List<FoodMealMenu> selectByIds(@Param("ids") List<String> ids);

    int updatePublishStatus(@Param("id") String id, @Param("publishStatus") String publishStatus,
                            @Param("publishTime") LocalDateTime publishTime, @Param("tenantCode") String tenantCode);
}
