import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsReportDeviceEfficiencyVO, DmsReportDeviceEfficiencyForm, DmsReportDeviceEfficiencyQuery } from '@/api/dms/dmsReportDeviceEfficiency/types';

/**
 * 查询设备效率报列表
 * @param query
 * @returns {*}
 */

export const listDmsReportDeviceEfficiency = (query?: DmsReportDeviceEfficiencyQuery): AxiosPromise<DmsReportDeviceEfficiencyVO[]> => {
  return request({
    url: '/dms/dmsReportDeviceEfficiency/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备效率报详细
 * @param reportId
 */
export const getDmsReportDeviceEfficiency = (reportId: string | number): AxiosPromise<DmsReportDeviceEfficiencyVO> => {
  return request({
    url: '/dms/dmsReportDeviceEfficiency/' + reportId,
    method: 'get'
  });
};

/**
 * 新增设备效率报
 * @param data
 */
export const addDmsReportDeviceEfficiency = (data: DmsReportDeviceEfficiencyForm) => {
  return request({
    url: '/dms/dmsReportDeviceEfficiency',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备效率报
 * @param data
 */
export const updateDmsReportDeviceEfficiency = (data: DmsReportDeviceEfficiencyForm) => {
  return request({
    url: '/dms/dmsReportDeviceEfficiency',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备效率报
 * @param reportId
 */
export const delDmsReportDeviceEfficiency = (reportId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsReportDeviceEfficiency/' + reportId,
    method: 'delete'
  });
};


/**
 * 下拉框查询设备效率报列表
 * @param query
 * @returns {*}
 */
export function getDmsReportDeviceEfficiencyList (query) {
    return request({
        url: '/dms/dmsReportDeviceEfficiency/getDmsReportDeviceEfficiencyList',
        method: 'get',
        params: query
    });
};
