import request from '@/utils/request'

// 条件查询
export function listMeterReadingByParam(query) {
  return request({
    url: '/ems/meterReading/listByParam',
    method: 'get',
    params: query
  })
}

// 查询最后一条
export function getLastRecord(areaCode, deviceCode) {
  return request({
    url: '/ems/meterReading/getLastRecord?areaCode=' + areaCode + '&deviceCode=' + deviceCode,
    method: 'get'
  })
}

// 新增手动抄记录
export function addMeterReading(data) {
  return request({
    url: '/ems/meterReading',
    method: 'post',
    data: data
  })
}

// 修改手动抄记录
export function updateMeterReading(data) {
  return request({
    url: '/ems/meterReading',
    method: 'put',
    data: data
  })
}

// 删除手动抄记录
export function delMeterReading(id) {
  return request({
    url: '/ems/manual/' + id,
    method: 'delete'
  })
}
