import axios from 'axios';
// ----------------------列表-----------------------
const pageBillUrl = '/drinkingWater/drinkingWaterBill/page';
// 添加
const saveDrinkingWaterBill = function (data) {
    return axios.post("/drinkingWater/drinkingWaterBill/batch",data)
}

// 删除
const removeDrinkingWaterBill = function (id) {
    return axios.delete(`/drinkingWater/drinkingWaterBill/${id}`,)
}
// 批量删除
const removeBatchDrinkingWaterBill = function (ids) {
    return axios.delete("/drinkingWater/drinkingWaterBill/batch",{data:ids})
}

// 修改
const updateDrinkingWaterBill = function (data) {
    return axios.put("/drinkingWater/drinkingWaterBill",data)
}
// 审核
const verifyDrinkingWaterBill = function (data) {
    return axios.put("/drinkingWater/drinkingWaterBill/verify",data);
}
const getDrinkingWaterBill = function (id) {
    return axios.get(`/drinkingWater/drinkingWaterBill/${id}`)
}
// -------------------------数据---------------------
const pageDrinkingWaterUrl = '/drinkingWater/drinkingWater/page';

const listAll = function(data){
    return axios.get("/drinkingWater/drinkingWater",{params:data})
}
// 添加
const saveDrinkingWater = function (data) {
    return axios.post("/drinkingWater/drinkingWater",data)
}

// 删除
const removeDrinkingWater = function (id) {
    return axios.delete(`/drinkingWater/drinkingWater/${id}`,)
}
// 批量删除
const removeBatchDrinkingWater = function (ids) {
    return axios.delete("/drinkingWater/drinkingWater/batch",{data:ids})
}

// 修改
const updateDrinkingWater = function (data) {
        return axios.put("/drinkingWater/drinkingWater",data)
}
//批量修改取水量
const updateWaterWithdrawal=function(data){
    return axios.put("/drinkingWater/drinkingWater/updateWater",data)
}



// -------------------------统计---------------------
//市级原始数据
const pageDrinkingWaterStatisticUrl = '/drinkingWater/drinkingWater/AnalysePage';
//县级原始数据
const pageDrinkingWaterCountyStatisticUrl='/drinkingWater/drinkingWater/CountyAnalysePage'
// const pageDrinkingWaterCompare = '/drinkingWater/drinkingWater/statistic/compare';
const getHistoryyears = function () {
    return axios.get("/drinkingWater/drinkingWater/history-year")
}
const getColumnOptions = function(column){
    return axios.get("/drinkingWater/drinkingWater/options",{params:{column}})
}

const getGisBase = function(data){
    return axios.get("/drinkingWater/drinkingWater/gis",{params:data})
}

const getGisArea = function(data){
    return axios.get("/drinkingWater/drinkingWater/gis/area",{params:data})
}
export {
    pageBillUrl,
    saveDrinkingWaterBill,
    removeDrinkingWaterBill,
    updateDrinkingWaterBill,
    removeBatchDrinkingWaterBill,
    verifyDrinkingWaterBill,
    getDrinkingWaterBill,
    pageDrinkingWaterUrl,
    saveDrinkingWater,
    removeDrinkingWater,
    updateDrinkingWater,
    removeBatchDrinkingWater,
    pageDrinkingWaterStatisticUrl,
    pageDrinkingWaterCountyStatisticUrl,
    getHistoryyears,
    // pageDrinkingWaterCompare,
    getColumnOptions,
    listAll,
    getGisBase,
    getGisArea,
    updateWaterWithdrawal
  
}
