package com.nantian.cloud.jljc.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.jljc.entity.TReportEnergysTructure;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nantian.cloud.jljc.vo.TReportEnergysTructureVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 报表1-2能源消费表 Mapper 接口
 *
 * @author stz
 * @since 2020-09-16
 */
@Mapper
public interface TReportEnergysTructureMapper extends BaseMapper<TReportEnergysTructure> {

    //通过能源报表id获取能源消费表信息
    List<TReportEnergysTructure> getTructureByReportId(@Param("reportId") Long reportId);

    //获取完整的能源消费表信息
    //List<TReportEnergysTructureVo> getAllTructureByReportId(@Param("reportId") Long reportId);
    List<TReportEnergysTructure> getAllTructureByReportId(@Param("reportId") Long reportId);

    //根据报表id，能源名称获取能源消费表信息
    //List<TReportEnergysTructureVo> getTructureByReportIdAndName(@Param("reportId") Long reportId, @Param("list") String[] list);
    List<TReportEnergysTructure> getTructureByReportIdAndName(@Param("reportId") Long reportId, @Param("list") String[] list);

    //获取单条合计信息
    TReportEnergysTructure getSumInfo(@Param("reportId") Long reportId, @Param("name") String name);

    //分页获取能源消费表
    IPage<TReportEnergysTructure> selByPage(Page page,@Param("query") TReportEnergysTructure tReportEnergysTructure);

    //获取能源名称
    List<String> getEnergyName(Long reportId);
}
