package com.yhy.module.core.dal.mysql.resource;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yhy.module.core.dal.dataobject.resource.ResourceCategoryTreeDO;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 工料机机类树 Mapper
 *
 * @author yihuiyong
 */
@Mapper
public interface ResourceCategoryTreeMapper extends BaseMapperX<ResourceCategoryTreeDO> {

    /**
     * 根据catalogId查询机类树
     */
    default List<ResourceCategoryTreeDO> selectByCatalogId(Long catalogId) {
        return selectList(new LambdaQueryWrapperX<ResourceCategoryTreeDO>()
                .eq(ResourceCategoryTreeDO::getCatalogId, catalogId)
                .orderByAsc(ResourceCategoryTreeDO::getSortOrder));
    }
}
