package com.bonus.core.menu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bonus.core.menu.dto.AppletDishesDetailDTO;
import com.bonus.core.menu.entity.MenuDishes;
import com.bonus.core.menu.model.MenuDishesTypeModel;
import com.bonus.core.menu.vo.AppletDishesDetailVO;
import com.bonus.core.nutrition.common.po.DishNutritionParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

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

@Mapper
public interface MenuDishesMapper extends BaseMapper<MenuDishes> {
//   Page<MenuDishesPageVO> selectAllList(Page<MenuDishesPageVO> page, @Param("menuDishesPageDTO") MenuDishesPageDTO menuDishesPageDTO, @Param("canteenList") List<EffCanteenVO> canteenList);
//
//   Page<MenuDishesPageVO> selectAllListV2(Page<MenuDishesPageVO> page, @Param("dishesName") String dishesName, @Param("typeIdList") List<Long> typeIdList, @Param("delFlag") Integer delFlag, @Param("canteenList") List<EffCanteenVO> canteenList);
//
//   List<NutritionEntity> selectNutritionWeightList(Long dishesId);
//
//   List<MenuPackageDishesPageVO> selectListByPackageId(@Param("packageId") Long packageId);
//
   AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dishesDetailDTO);

//   List<IndexDishesListVO> selectIndexRecommendDishesList(MenuDishes dishes);
//
//   @Select({"select dishes_id from menu_dishes ${ew.customSqlSegment}"})
//   List<Long> selectMenuDishesLikeSurvey(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select dishes_id, dishes_name, like_num from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishesLikeRankingVO> selectMenuDishesLikeRanking(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select dishes_id, dishes_name, alias_name, image_url, like_batch, like_num from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishesLikeVO> selectMenuDishesLikeList(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Update({"update menu_dishes set like_num = like_num + 1 ${ew.customSqlSegment}"})
//   void updateLikeNum(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuBasicsDishesVO> selectAllDishesBasicsInfo(@Param("delFlag") Integer delFlag, @Param("canteenList") List<EffCanteenVO> canteenList);
//
//   @Select({"select custom_id from menu_dishes ${ew.customSqlSegment}"})
//   List<Integer> selectCustomIdByDishesId(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select dishes_id from menu_dishes where custom_id = #{customId} and del_flag = #{delFlag}"})
//   Long selectDishesIdByCustomId(@Param("customId") Integer customId, @Param("delFlag") Integer delFlag);
//
//   List<String> selectDishesLabelByDishesId(Long dishesId);
//
//   List<String> selectMaterialByType(@Param("dishesId") Long dishesId, @Param("materialType") Integer materialType);
//
//   @Select({"select weight_deviation from menu_dishes where custom_id = #{customId} and del_flag  = #{delFlag}"})
//   Double selectWeightDeviationByCustomId(@Param("customId") Integer customId, @Param("delFlag") Integer delFlag);
//
//   List<AndroidRecipeTypeDetailVO> selectAllDishesByType();
//
//   @Select({"select dishes_name from menu_dishes ${ew.customSqlSegment}"})
//   List<String> selectDishesNameListByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuDishesCustHealthVO> selectDishesCustHealth(@Param("dishesIdSet") Set<Long> dishesIdSet, @Param("delFlag") Integer delFlag);
//
//   List<MenuDishes> selectMenuDishesDataList();
//
//   @Select({"select distinct type_name from menu_dishes_data"})
//   List<String> selectDishesTypeNameList();
//
//   List<MenuMaterialDishes> selectMenuMaterialDishesDataList(@Param("dishesIdList") List<Long> dishesIdList);
//
//   @Select({"select dishes_name from menu_dishes where del_flag = 2"})
//   List<String> selectAllDishesNameList();
//
//   @Select({"select id, dishes_name from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishes> selectIdAndNameByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   Page<MenuDishesV2PageVO> selectAllV2List(Page<MenuDishesV2PageVO> resultPage, @Param("content") MenuDishesV2PageDTO content, @Param("canteenEnable") boolean canteenEnable, @Param("authPO") MgrUserAuthPO authPO);
//
//   MenuDishesDetailVO selectDishesDetailById(Long dishesId);
//
//   @Select({"select custom_id from menu_dishes ${ew.customSqlSegment}"})
//   List<Integer> selectCustomIdByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuAllTypeDishesVO> selectTypeDishesList(@Param("content") MenuTypeDishesDTO content, @Param("authPO") MgrUserAuthPO authPO);
//
//   @Select({"select 1 from menu_dishes ${ew.customSqlSegment}"})
//   Integer selectExistByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select custom_id, dishes_name, alias_name, price, calories, protein, fat, carbohydrate, dietary_fiber, cholesterol, calcium, sodium from menu_dishes ${ew.customSqlSegment}"})
//   MenuDishesByCustomIdVO selectMenuDishesDetailByCustomId(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select dishes_name from menu_dishes ${ew.customSqlSegment}"})
//   String selectDishesNameByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<AndroidDishesDetailByDateVO> selectDishesDetailByCustId(@Param("custId") Long custId, @Param("queryDate") LocalDate queryDate);
//
//   @Select({"select a.dishes_id,b.dishes_name,count(a.material_id) materialNum,b.sales_mode from menu_material_dishes a LEFT JOIN menu_dishes b on b.dishes_id = a.dishes_id where a.dishes_id = #{dishesId} GROUP BY a.dishes_id,b.dishes_name,b.sales_mode"})
//   MenuMaterialNumVO selectDishesMaterialNum(Long dishesId);
//
//   @Select({"<script>select a.material_id,b.material_name,b.category_id,d.category_name,a.weight,ROUND(c.edible/100,2) edible from menu_material_dishes a left join menu_material b on b.material_id = a.material_id left join menu_nutrition c on c.nutrition_id = b.nutrition_id left join menu_material_category d on d.category_id = b.category_id where a.dishes_id = #{dishesId} <if test='ifFilterIngredients == 1'>and a.material_type != 3</if></script>"})
//   List<MenuMaterialWeightVO> selectMaterialWeight(@Param("dishesId") Long dishesId, @Param("ifFilterIngredients") Integer ifFilterIngredients);
//
//   Page<DishVO> selectOpenMenuDishesList(Page<DishVO> page, @Param("param") DishQueryDTO param);
//
//   @Select({"select type_id from menu_dishes_type where default_flag = #{defaultFlag}"})
//   Long selectDefaultDishesType(Integer defaultFlag);
//
//   Integer menuRecipeCount(@Param("mealtimeType") Integer mealtimeType, @Param("dishesId") Long dishesId, @Param("nowDate") LocalDate nowDate);
//
//   @Select({"select dishes_id from menu_dishes where inventory_id = #{inventoryId} and del_flag = 2"})
//   Long selectDishesIdByInventoryId(String inventoryId);
//
//   @Select({"select dishes_id from menu_dishes ${ew.customSqlSegment}"})
//   Long selectDishesIdByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuLabelAndNutritionVO> selectDishesLabelAndNutritionList(@Param("dishesIdList") List<Long> dishesIdList);
//
//   @Select({"select picture_url from menuai_dishes_picture where menuai_dishes_id = #{dishesId}"})
//   List<String> selectAiPictureListByDishesId(@Param("dishesId") Long dishesId);
//
//   List<DishesCookLabelVO> queryDishesCookLabelList(@Param("dishesIdList") List<Long> dishesIdList);
//
//   List<Long> selectRegisterDishesIdList(@Param("recipeId") Long recipeId, @Param("mealtimeType") Integer mealtimeType);
//
//   @Select({"select dishes_id, dishes_name from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishes> selectDishesIdAndName(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   MenuaiDishesNumModel selectTypeDishesNum(Long dishesId);
//
//   @Select({"select dishes_id, dishes_name from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishes> selectDishesIdAndNameListByWrapper(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuaiRegisterDishesModel> selectRegisterDishes(@Param("recipeId") Long recipeId, @Param("mealtimeType") Integer mealtimeType, @Param("stallId") Long stallId);
//
//   List<MenuDishesMaterialModel> listDishesMaterial(@Param("dishesIdList") List<Long> dishesIdList, @Param("salesMode") Integer salesMode);
//
   List<DishNutritionParam> selectNutrition(@Param("dishesIdSet") Set<Long> dishesIdSet);
//
//   @Select({"select dishes_id from menu_dishes ${ew.customSqlSegment}"})
//   List<Long> selectdishesIdList(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuBaseModel> selectBaseSizeDishesId(@Param("baseDishesIdList") List<Long> baseDishesIdList);
//
//   Page<MenuAppDishesPageVO> selectAppDishesPage(Page<?> page, @Param("content") MenuAppDishesPageDTO content);
//
//   List<MenuAppDishesListVO> selectTypeDishesListForApp(@Param("content") MenuAppDishesListDTO content);
//
//   @Select({"select dishes_id, custom_id, sales_mode, unit_price from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishesSaleModel> selectDishesSaleModelList(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   List<MenuBaseDishesIdDTO> listBaseDishesId(@Param("param") MenuBaseDishesIdDTO param);
//
//   List<MenuBaseAndDishesModel> selectBaseAndDetailList(@Param("baseIdList") List<Long> baseIdList);
//
//   List<MenuDishes> selectListByBase(@Param("dishesNameList") List<String> dishesNameList, @Param("canteenId") Long canteenId);
//
//   List<MenuDishesSizeModel> listDishesSizeModel(@Param("salesMode") Integer salesMode, @Param("delFlag") Integer delFlag);
//
//   @Select({"select dishes_id, size_json ,convert_flag from menu_dishes where base_dishes_id = #{dishesId}"})
//   List<MenuBaseDishesModel> selectBaseDishesIdSize(@Param("dishesId") Long dishesId);
//
//   @Select({"select calories, protein, fat, carbohydrate, dietary_fiber, cholesterol, calcium, sodium, purine, iron, iodine, kalium, vitamin_a, vitamin_c, vitamin_e, magnesium, zinc, glycemic_index from menu_dishes where dishes_id = #{dishesId}"})
//   MenuDishesNutritionVO selectDishesNutrition(@Param("dishesId") Long dishesId);
//
//   List<MenuDishesExportVO> selectDishesExportList(@Param("content") MenuDishesExportDTO content, @Param("canteenEnable") boolean canteenEnable, @Param("authPO") MgrUserAuthPO authPO);
//
//   @Select({"select material_cost from menu_dishes ${ew.customSqlSegment}"})
//   Integer selectMaterialCost(@Param("ew") Wrapper<MenuDishes> wrapper);
//
//   @Select({"select base_dishes_id, material_cost from menu_dishes ${ew.customSqlSegment}"})
//   List<MenuDishesCostModel> selectMaterialCostList(@Param("ew") Wrapper<MenuDishes> wrapper);
//
   List<MenuDishesTypeModel> selectDishesTypeNameAndIdList(@Param("dishesIdList") List<Long> dishesIdList);
//
//   List<IssueRecipeMealCompressVO> getMealListByDishesIds(@Param("dishesIds") List<Long> dishesIds);
//
//   List<String> selectDishesNameAndCanteenName();
//
//   List<DishesLabelDto> selectDishesLabelByDishesIds(@Param("dishesIds") List<Long> dishesIds);
//
//   List<DishesLabelDto> selectMaterialByTypeAndDishesIds(@Param("dishesIds") List<Long> dishesIds);
//
//   List<Long> nutritionGetDishes(@Param("content") NutritionGetDishesDto nutritionGetDishesDto);
//
//   void openLimitCustomId();
//
//   List<Long> selectUseTypeDishesList(@Param("content") MenuTypeDishesDTO content, @Param("authPO") MgrUserAuthPO authPO);
//
//   List<DishesLabelDto> selectTasteByDishesIds(@Param("dishesIds") List<Long> dishesIdList);
//
//   List<MenuBaseDishesDetail> getBaseDishesDetail(@Param("baseDishesIdList") List<Long> baseDishesIdList);
}
