package com.jeeplus.psimanage.dishManage.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.psimanage.dishManage.domain.PsiDishLibrary;
import com.jeeplus.psimanage.dishManage.domain.PsiDishMenuDish;
import com.jeeplus.psimanage.dishManage.domain.PsiDishType;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜单菜品
 */
public interface PsiDishMenuDishMapper extends BaseMapper<PsiDishMenuDish> {

    IPage<PsiDishMenuDish> findCurrentDishList(Page<PsiDishMenuDish> page,
                                               @Param(Constants.WRAPPER) QueryWrapper<PsiDishMenuDish> queryWrapper);

    IPage<PsiDishMenuDish> findHistoryDishList(Page<PsiDishMenuDish> page,
                                               @Param(Constants.WRAPPER) QueryWrapper<PsiDishMenuDish> queryWrapper);

    IPage<PsiDishLibrary> findAvailableDishList(Page<PsiDishLibrary> page,
                                                @Param(Constants.WRAPPER) QueryWrapper<PsiDishLibrary> queryWrapper,
                                                @Param("menuId") String menuId);

    List<PsiDishLibrary> findOrderDishList(@Param("typeId") String typeId, @Param("dishName") String dishName);

    List<PsiDishType> findOrderTypeList();

    PsiDishMenuDish findCurrentByDishId(@Param("dishId") String dishId);

    Integer getMaxSort(@Param("menuId") String menuId);
}
