import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseEnergyPriceVO, BaseEnergyPriceForm, BaseEnergyPriceQuery } from '@/api/ems/base/types';

/**
 * 查询能源月份单价列表
 */
export function listBaseEnergyPrice(query: BaseEnergyPriceQuery): AxiosPromise<BaseEnergyPriceVO[]> {
  return request({
    url: '/ems/base/baseEnergyPrice/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询能源月份单价详细
 */
export function getBaseEnergyPrice(objId: string | number): AxiosPromise<BaseEnergyPriceVO> {
  return request({
    url: '/ems/base/baseEnergyPrice/' + objId,
    method: 'get'
  });
}

/**
 * 新增能源月份单价
 */
export function addBaseEnergyPrice(data: BaseEnergyPriceForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyPrice',
    method: 'post',
    data: data
  });
}

/**
 * 修改能源月份单价
 */
export function updateBaseEnergyPrice(data: BaseEnergyPriceForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyPrice',
    method: 'put',
    data: data
  });
}

/**
 * 删除能源月份单价
 */
export function delBaseEnergyPrice(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyPrice/' + objId,
    method: 'delete'
  });
}
