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

import java.util.List;
import com.bonus.canteen.core.cook.domain.CookMaterialType;
import com.bonus.canteen.core.cook.vo.CookMaterialTypeTreeVO;
import org.apache.ibatis.annotations.Param;

/**
 * 原料类别Mapper接口
 * 
 * @author xsheng
 * @date 2025-05-25
 */
public interface CookMaterialTypeMapper {
    /**
     * 查询原料类别
     * 
     * @param materialTypeId 原料类别主键
     * @return 原料类别
     */
    public CookMaterialType selectCookMaterialTypeByMaterialTypeId(Long materialTypeId);

    /**
     * 查询原料类别列表
     * 
     * @param cookMaterialType 原料类别
     * @return 原料类别集合
     */
    public List<CookMaterialType> selectCookMaterialTypeList(CookMaterialType cookMaterialType);

    /**
     * 新增原料类别
     * 
     * @param cookMaterialType 原料类别
     * @return 结果
     */
    public int insertCookMaterialType(CookMaterialType cookMaterialType);

    /**
     * 修改原料类别
     * 
     * @param cookMaterialType 原料类别
     * @return 结果
     */
    public int updateCookMaterialType(CookMaterialType cookMaterialType);

    /**
     * 删除原料类别
     * 
     * @param materialTypeId 原料类别主键
     * @return 结果
     */
    public int deleteCookMaterialTypeByMaterialTypeId(Long materialTypeId);

    /**
     * 批量删除原料类别
     * 
     * @param materialTypeIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCookMaterialTypeByMaterialTypeIds(Long[] materialTypeIds);
    /**
     * 根据原料类别名称查询原料类别
     *
     * @param materialTypeName 原料类别名称
     * @param materialTypeId 原料类别ID（用于编辑时排除自身）
     * @return 原料类别
     */
    public CookMaterialType selectCookMaterialTypeByMaterialTypeName(@Param("materialTypeName") String materialTypeName,@Param("materialTypeId") Long materialTypeId);
    /**
     * 根据原料类别ID查询子类别数量
     *
     * @param materialTypeIds 原料类别ID
     * @return 子类别数量
     */
    public int selectCookMaterialTypeByParentId(@Param("materialTypeIds") Long[] materialTypeIds);
    /**
     * 获取原料类别树
     *
     * @return 原料类别树
     */
    public List<CookMaterialTypeTreeVO> getTree();
}
