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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.android.vo.UserInfoVo;
import com.bonus.canteen.core.menu.domain.MenuDishesType;
import com.bonus.canteen.core.menu.dto.AppletDishesDetailDTO;
import com.bonus.canteen.core.menu.vo.AppletDishesDetailVO;
import com.bonus.canteen.core.menu.vo.AppletWeekCanteenVO;
import com.bonus.canteen.core.menu.vo.AppletWeekRecipeVO;
import com.bonus.canteen.core.menu.vo.MenuMaterialBasVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

/**
 * 商家食材原料信息Mapper接口
 *
 * @author xsheng
 * @date 2025-04-03
 */
public interface AppletRecipeH5Mapper {


    UserInfoVo selectMessageByUserId(UserInfoVo userInfoVo);

    List<AppletWeekCanteenVO> selectWeekCanteenList();

    AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dishesDetailDTO);

    List<Long> selectWeekRecipeId(@Param("recipeId") Long recipeId, @Param("effIdSet") Set<Long> effIdSet);

    List<AppletWeekRecipeVO> selectWeekRecipe(@Param("applyDate") LocalDate applyDate, @Param("recipeId") Long recipeId, @Param("recipeIdList") List<Long> recipeIdList);

    List<MenuMaterialBasVO> getMenuMaterialById(Long dishesId);

    public int getCollectionCountByUserIdAndDishesId(@Param("userId") Long userId, @Param("dishesId") Long dishesId);

    @Select({"select md.dishes_name from menu_package_dishes mpd left join menu_dishes md on mpd.dishes_id = md.dishes_id where mpd.del_flag = 2 and mpd.package_id = #{dishesId}"})
    List<String> selectDishesName(@Param("dishesId") Long dishesId);

    List<Long> selectWeekRecipeIdHistory(@Param("recipeIdList")  List<Long> recipeId, @Param("effIdSet") Set<Long> effIdSet, @Param("applyDate") LocalDate applyDate);

    List<Long> getRecipeIdListByRecipeId(@Param("recipeId") Long recipeId);

    String getBingTimeByRecipeId(@Param("recipeId") Long recipeId);
}
