package cn.iocoder.lyzsys.module.tjt.dal.mysql.profit;

import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.profit.ProjectCostMeasureSnapshotDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ProjectCostMeasureSnapshotMapper extends BaseMapperX<ProjectCostMeasureSnapshotDO> {

    default ProjectCostMeasureSnapshotDO selectByProjectIdAndType(Long projectId, String snapshotType) {
        return selectOne(new LambdaQueryWrapperX<ProjectCostMeasureSnapshotDO>()
                .eq(ProjectCostMeasureSnapshotDO::getProjectId, projectId)
                .eq(ProjectCostMeasureSnapshotDO::getSnapshotType, snapshotType));
    }

    default List<ProjectCostMeasureSnapshotDO> selectListByProjectId(Long projectId) {
        return selectList(new LambdaQueryWrapperX<ProjectCostMeasureSnapshotDO>()
                .eq(ProjectCostMeasureSnapshotDO::getProjectId, projectId));
    }

}
