package com.jeeplus.psimanage.dishManage.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.jeeplus.core.domain.TreeMapper;
import com.jeeplus.psimanage.dishManage.domain.PsiDishType;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜品分类
 */
public interface PsiDishTypeMapper extends BaseMapper<PsiDishType>, TreeMapper<PsiDishType> {

    List<PsiDishType> findList(@Param(Constants.WRAPPER) Wrapper<PsiDishType> queryWrapper);

    PsiDishType getById(String id);

    Integer checkNameIsExist(@Param("name") String name, @Param("parentId") String parentId, @Param("id") String id);

    Integer getNo(@Param("parentId") String parentId);

    Integer getLevel(@Param("parentId") String parentId);

    Integer countChildren(@Param("id") String id);

    List<PsiDishType> findOrderTypeList();
}
