package com.energy.manage.service.mappers.analysis;

import com.energy.manage.common.mapper.MyMapper;
import com.energy.manage.common.po.analysis.AnalysisResultReportPo;
import com.energy.manage.service.domain.dto.analysis.AnalysisResultReportDto;
import com.energy.manage.service.domain.vo.analysis.AnalysisResultReportVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chy
 * @date 2024/9/20 16:58
 * @desc
 */
@Repository
public interface AnalysisResultReportMapper extends MyMapper<AnalysisResultReportPo> {

    /**
     * 保存报表
     * @return
     */
    int saveReportBatch(@Param("list") List<AnalysisResultReportDto> resultReportDto);

    /**
     * 保存单个报表
     * @param resultReportVo
     * @return
     */
    int insertReport(AnalysisResultReportVo resultReportVo);

    /**
     * 更新报表
     * @param resultReportVo
     * @return
     */
    int updateReport(AnalysisResultReportVo resultReportVo);

    /**
     * 根据批次查询报表
     * @param batchCode
     * @return
     */
    List<AnalysisResultReportVo> selectByBatchCode(@Param("batchCode") String batchCode);


    /**
     * 查询报告
     * @param batchCode
     * @param reportType
     * @return
     */
    AnalysisResultReportPo selectByBatchCodeAndReportType(@Param("batchCode") String batchCode,
                                                          @Param("reportType") Integer reportType);

}
