package com.njcn.rdms.module.project.dal.mysql.workreport.project;

import com.njcn.rdms.framework.mybatis.core.mapper.BaseMapperX;
import com.njcn.rdms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.njcn.rdms.module.project.dal.dataobject.workreport.project.ProjectReportCurrentItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ProjectReportCurrentItemMapper extends BaseMapperX<ProjectReportCurrentItemDO> {

    default List<ProjectReportCurrentItemDO> selectListByReportId(Long reportId) {
        return selectList(new LambdaQueryWrapperX<ProjectReportCurrentItemDO>()
                .eq(ProjectReportCurrentItemDO::getReportId, reportId)
                .orderByAsc(ProjectReportCurrentItemDO::getId));
    }

    default int deleteByReportId(Long reportId) {
        return delete(new LambdaQueryWrapperX<ProjectReportCurrentItemDO>()
                .eq(ProjectReportCurrentItemDO::getReportId, reportId));
    }
}
