import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseEnergyTypeVO, BaseEnergyTypeForm, BaseEnergyTypeQuery } from '@/api/ems/base/types';

/**
 * 查询能源类型信息列表
 */
export function listBaseEnergyType(query: BaseEnergyTypeQuery): AxiosPromise<BaseEnergyTypeVO[]> {
  return request({
    url: '/ems/base/baseEnergyType/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询能源类型信息详细
 */
export function getBaseEnergyType(objId: string | number): AxiosPromise<BaseEnergyTypeVO> {
  return request({
    url: '/ems/base/baseEnergyType/' + objId,
    method: 'get'
  });
}

/**
 * 新增能源类型信息
 */
export function addBaseEnergyType(data: BaseEnergyTypeForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyType',
    method: 'post',
    data: data
  });
}

/**
 * 修改能源类型信息
 */
export function updateBaseEnergyType(data: BaseEnergyTypeForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyType',
    method: 'put',
    data: data
  });
}

/**
 * 删除能源类型信息
 */
export function delBaseEnergyType(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseEnergyType/' + objId,
    method: 'delete'
  });
}

/**
 * 查询能源类型信息列表(不分页)
 */
export function getBaseEnergyTypeList(query?: BaseEnergyTypeQuery): AxiosPromise<BaseEnergyTypeVO[]> {
  return request({
    url: '/ems/base/baseEnergyType/getBaseEnergyTypeList',
    method: 'get',
    params: query
  });
}
