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

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.workbench.WbItemInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 单项基本信息 Mapper
 *
 * @author yhy
 */
@Mapper
public interface WbItemInfoMapper extends BaseMapperX<WbItemInfoDO> {

    /**
     * 根据编制树节点ID查询
     */
    default WbItemInfoDO selectByCompileTreeId(Long compileTreeId) {
        return selectOne(new LambdaQueryWrapperX<WbItemInfoDO>()
                .eq(WbItemInfoDO::getCompileTreeId, compileTreeId));
    }

    /**
     * 根据编制树节点ID删除
     */
    default int deleteByCompileTreeId(Long compileTreeId) {
        return delete(new LambdaQueryWrapperX<WbItemInfoDO>()
                .eq(WbItemInfoDO::getCompileTreeId, compileTreeId));
    }
}
