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

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.menu.domain.MapBean;
import com.bonus.canteen.core.menu.domain.MenuDishes;
import com.bonus.canteen.core.menu.domain.MenuDishesRelation;
import com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO;
import com.bonus.canteen.core.menu.dto.MenuDishesDTO;
import com.bonus.canteen.core.utils.NutritionEntity;
import org.apache.ibatis.annotations.Param;

/**
 * 菜品信息Mapper接口
 *
 * @author xsheng
 * @date 2025-04-03
 */
public interface MenuDishesMapper extends BaseMapper<MenuDishes> {
    /**
     * 查询菜品信息
     *
     * @param id 菜品信息主键
     * @return 菜品信息
     */
    public MenuDishes selectMenuDishesById(Long id);

    /**
     * 查询菜品信息列表
     *
     * @param menuDishes 菜品信息
     * @return 菜品信息集合
     */
    public List<MenuDishes> selectMenuDishesList(MenuDishes menuDishes);

    /**
     * 新增菜品信息
     *
     * @param menuDishes 菜品信息
     * @return 结果
     */
    public int insertMenuDishes(MenuDishes menuDishes);

    /**
     * 修改菜品信息
     *
     * @param menuDishesDTO 菜品信息
     * @return 结果
     */
    public int updateMenuDishes(MenuDishesDTO menuDishesDTO);

    /**
     * 删除菜品信息
     *
     * @param id 菜品信息主键
     * @return 结果
     */
    public int deleteMenuDishesById(Long id);

    /**
     * 批量删除菜品信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMenuDishesByIds(@Param("dishesIds") Long[] ids);

    public int deleteMenuByIds(@Param("ids") Long[] ids);
    List<Long> getBassIdByDishesId(@Param("dishesIds") Long[] ids);

    int deleteBaseDishesByIds(@Param("baseDishesIds") Long[] ids);

    List<Long> getBassIdByIds(@Param("ids") Long[] ids);

    MenuDishes getOneByName(MenuDishesDTO menuDishesDTO);

    MenuDishes getOneByNum(MenuDishesDTO menuDishesDTO);

    int addMenuDishesBase(MenuDishesDTO menuDishesDTO);
    int updateMenuDishesBase(MenuDishesDTO menuDishesDTO);

    int addMenuDishes(MenuDishesDTO menuDishesDTO);

    int editMenuDishes(MenuDishesDTO menuDishesDTO);
    NutritionEntity getNutritionEntity(MenuDishesAddMaterialDTO dto);


    int addFinalNutrition(@Param("nutritionEntity") NutritionEntity nutritionEntity,@Param("dishesId") Long dishesId);


    int addMenuMaterialDishes(@Param("dishesId")Long dishesId,@Param("materialList") List<MenuDishesAddMaterialDTO> materialList);

    int updateMenuMaterialDishes(@Param("dishesId")Long dishesId);
    List<MenuDishesAddMaterialDTO> getMenuMaterialDishes(String deshesId);
    MenuDishes getDishMessageByDishesId(String dishesId);

    List<MapBean> getDishesType(MapBean mapBean);
    List<MapBean> getDishesTypeByList(@Param("key")String key,@Param("keyList")List<String> keyList);
}
