import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReportPointWaterVO, ReportPointWaterForm, ReportPointWaterQuery } from '@/api/ems/report/types';

/**
 * 查询水点位报表列表
 */
export function listReportPointWater(query: ReportPointWaterQuery): AxiosPromise<ReportPointWaterVO[]> {
  return request({
    url: '/ems/report/reportPointWater/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询水点位报表详细
 */
export function getReportPointWater(objId: string | number): AxiosPromise<ReportPointWaterVO> {
  return request({
    url: '/ems/report/reportPointWater/' + objId,
    method: 'get'
  });
}

/**
 * 生成水点位报表
 */
export function generateReportPointWater(data: ReportPointWaterForm) {
  return request({
    url: '/ems/report/reportPointWater/generate',
    method: 'post',
    data: data
  });
}

/**
 * 新增水整点报表
 */
export function addReportPointWater(data: ReportPointWaterForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointWater',
    method: 'post',
    data: data
  });
}

/**
 * 修改水整点报表
 */
export function updateReportPointWater(data: ReportPointWaterForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointWater',
    method: 'put',
    data: data
  });
}

/**
 * 删除水整点报表
 */
export function delReportPointWater(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointWater/' + objId,
    method: 'delete'
  });
}

/**
 * 导出水点位报表
 */
export function exportReportPointWater(query: ReportPointWaterQuery) {
  return request({
    url: '/ems/report/reportPointWater/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
}
