import request from '@/utils/request'

// 耗水统计
export function waterStatistical(query) {
    return request({
        url: '/energy/workshop-energy/consumed-water',
        method: 'get',
        params: query
    })
}

// 耗水统计饼图
export function waterStatisticalPie(query) {
    return request({
        url: '/energy/findWaterByPieDiagrams',
        method: 'get',
        params: query
    })
}


// 能耗费用饼图跟漏斗图
export function energyCostTotal(query) {
    return request({
        url: '/energy/workshop-energy/energyCostStatistics',
        method: 'get',
        params: query
    })
}


// 耗气统计
export function gasStatistical(query) {
    return request({
        url: '/energy/workshop-energy/gas-consumption',
        method: 'get',
        params: query
    })
}

// 耗气统计饼图
export function gasStatisticalPie(query) {
    return request({
        url: '/energy/findGasByDiagrams',
        method: 'get',
        params: query
    })
}

// 时段用电总量
export function totalElectricity(query) {
    return request({
        url: '/energy/workshop-energy/total-electricity',
        method: 'get',
        params: query
    })
}

// 时段用电总量饼图
export function totalElectricityPie(query) {
    return request({
        url: '/energy/findElectricByPieDiagrams',
        method: 'get',
        params: query
    })
}

// 空调热能
export function airConditioningHeat(query) {
    return request({
        url: '/energy/workshop-energy/air-conditioner',
        method: 'get',
        params: query
    })
}

// 能耗排名
export function energyRank(query) {
    return request({
        url: '/energy/workshop-energy/energy-statistics',
        method: 'get',
        params: query
    })
}

// 区域能耗对比
export function workshopContrast(data) {
    return request({
        url: '/energy/workshop-energy/finWorkshopComparisonRevise',
        method: 'post',
        data
    })
}

// 能耗分类
export function energyClassification() {
    return request({
        url: '/energy/workshop-energy/classify',
        method: 'get'
    })
}

// 能耗类型
export function typeEnergy(query) {
    return request({
        url: '/energy/workshop-energy/typological',
        method: 'get',
        params: query
    })
}

// // 区域能耗对比
// export function workshopContrast(query) {
//   return request({
//     url: 'energy/workshop-energy/consumed-water',
//     method: 'get',
//     params: query
//   })
// }

// 设备列表
export function energyDevice() {
    return request({
        url: '/energy/listsByDeviceComboBox',
        method: 'get'
    })
}


// 采购金额图表
export function getEnergyPurchase(query) {
    return request({
        url: '/energy/purchaseByRange',
        method: 'get',
        params: query
    })
}


// 能耗统计 采购统计图表
export function purchaseStatisticsEcharts(query) {
    return request({
        url: '/energy/purchaseStatistics',
        method: 'get',
        params: query
    })
}


// 省钱管理 数据概览
export function getDataOverview() {
    return request({
        url: '/energy/findDataOverview',
        method: 'get'
    })
}

// 省钱管理 数据趋势
export function getDataTrend(val) {
    return request({
        url: `/energy/findDataTrend?range=${val}`,
        method: 'get'
    })
}

// 省钱管理 本月节省占比查询
export function getSavingsRatio() {
    return request({
        url: '/energy/findSavingsRatio',
        method: 'get',
    })
}


// 省钱管理 省钱数据查询
export function getSaveMoneyData(data) {
    return request({
        url: '/energy/findSaveMoneyData',
        method: 'post',
        data
    })
}


// 省钱管理 本月谷电运行分布查询
export function getLowEbbProportion(query) {
    return request({
        url: '/energy/findLowEbbProportion',
        method: 'get',
        params: query
    })
}


// 省钱管理 月份排名查询接口
export function getMonthlyRanking(query) {
    return request({
        url: '/energy/findSaveMoneyMonthlyRanking',
        method: 'get',
        params: query
    })
}

// 能耗统计 查询本日的总费用
export function getAllEnergyByDay() {
    return request({
        url: '/energy/findAllEnergyByDay',
        method: 'get'
    })
}

// cpc对比
export function getCPC(query) {
    return request({
        url: '/cop/api/getCop',
        method: 'get',
        params: query
    })
}
