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

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.yhy.module.core.dal.dataobject.boq.BoqSubItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 清单子项 Mapper
 *
 * @author yhy
 */
@Mapper
public interface BoqSubItemMapper extends BaseMapperX<BoqSubItemDO> {

    /**
     * 根据编码查询
     */
    default BoqSubItemDO selectByCode(String code) {
        return selectOne("code", code);
    }

    /**
     * 根据清单项树ID查询所有子项
     */
    default List<BoqSubItemDO> selectListByBoqItemTreeId(Long boqItemTreeId) {
        return selectList("boq_item_tree_id", boqItemTreeId);
    }
}
