import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BaseMonitorWorkUnitVO, BaseMonitorWorkUnitForm, BaseMonitorWorkUnitQuery } from '@/api/ems/base/types';

/**
 * 查询统计计量信息列表
 */
export function listBaseMonitorWorkUnit(query: BaseMonitorWorkUnitQuery): AxiosPromise<BaseMonitorWorkUnitVO[]> {
  return request({
    url: '/ems/base/baseMonitorWorkUnit/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询统计计量信息详细
 */
export function getBaseMonitorWorkUnit(objId: string | number): AxiosPromise<BaseMonitorWorkUnitVO> {
  return request({
    url: '/ems/base/baseMonitorWorkUnit/' + objId,
    method: 'get'
  });
}

/**
 * 新增统计计量信息
 */
export function addBaseMonitorWorkUnit(data: BaseMonitorWorkUnitForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseMonitorWorkUnit',
    method: 'post',
    data: data
  });
}

/**
 * 修改统计计量信息
 */
export function updateBaseMonitorWorkUnit(data: BaseMonitorWorkUnitForm): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseMonitorWorkUnit',
    method: 'put',
    data: data
  });
}

/**
 * 删除统计计量信息
 */
export function delBaseMonitorWorkUnit(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/base/baseMonitorWorkUnit/' + objId,
    method: 'delete'
  });
}
