package com.nantian.cloud.jljc.mapper;

import com.nantian.cloud.jljc.entity.TReportUnitenergy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报表1-3能耗指标表 Mapper 接口
 * @since 2020-09-16
 * @author stz
 */
@Mapper
public interface TReportUnitenergyMapper extends BaseMapper<TReportUnitenergy> {

    //通过能源报表id获取能耗指标表信息
    List<TReportUnitenergy> getUnitenergyByReportId(@Param("reportId") Long reportId);

    //报表填写时，根据报表设置、上年值进行初始化
    List<TReportUnitenergy> initialize(@Param("ids") List<Long> ids,@Param("reportId") Long reportId);

    //根据本年、上年报表id获取 能耗指标表列表信息
    List<TReportUnitenergy> getByIdAndPrevId(@Param("id") Long id,@Param("prevId") Long prevId);

    //取出该指标所在年份的平均值（只取已经上报的）
    String getQuotaAverage(@Param("year") int year,@Param("type") String type,@Param("quotaId") Long quotaId);
}
