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

import java.util.List;

@Mapper
public interface ProjectReportNextItemMapper extends BaseMapperX<ProjectReportNextItemDO> {

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

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