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 org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜品库
 */
public interface PsiDishLibraryMapper extends BaseMapper<PsiDishLibrary> {

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

    PsiDishLibrary queryById(@Param("id") String id);

    Integer checkCodeIsExist(@Param("dishCode") String dishCode, @Param("id") String id);

    Integer checkNameIsExist(@Param("dishName") String dishName, @Param("typeId") String typeId, @Param("id") String id);

    Integer countByTypeId(@Param("typeId") String typeId);

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