import request from '@/utils/request';
import type {
  EnergyPreviewReportQuery,
  EnergyPreviewReportRow,
  EnergyStatisticalReportVO,
  EmsActionResponse,
  EmsListResponse,
  EmsReportQuery,
  PeaksValleysConsumptionReportVO
} from '../types';

// 查询统计能耗报表
export function energyStatisticalReportList(query?: EmsReportQuery): Promise<EmsListResponse<EnergyStatisticalReportVO>> {
  return request({
    url: '/ems/report/energyStatisticalReportList',
    method: 'get',
    params: query
  });
}

// 查询峰平谷耗量报表
export function peaksValleysConsumptionReportList(query?: EmsReportQuery): Promise<EmsListResponse<PeaksValleysConsumptionReportVO>> {
  return request({
    url: '/ems/report/peaksValleysConsumptionReportList',
    method: 'get',
    params: query
  });
}

// 查询能源预览接口
// 这个接口返回 AjaxResult 包裹的自定义数组，不是标准 TableDataInfo，所以不能误标成 rows/total 结构。
export function energyPreviewReportList(query?: EnergyPreviewReportQuery): Promise<EmsActionResponse<EnergyPreviewReportRow[]>> {
  return request({
    url: '/ems/report/energyPreviewReportList',
    method: 'get',
    params: query
  });
}
