import request from '@/utils/request'

// 查询巡线列表
export function listPatrol(query) {
  return request({
    url: '/line/patrol/list',
    method: 'get',
    params: query
  })
}

// 查询巡线详细
export function getPatrol(id) {
  return request({
    url: '/line/patrol/' + id,
    method: 'get'
  })
}

// 新增巡线
export function addPatrol(data) {
  return request({
    url: '/line/patrol',
    method: 'post',
    data: data
  })
}

// 修改巡线
export function updatePatrol(data) {
  return request({
    url: '/line/patrol',
    method: 'put',
    data: data
  })
}

// 删除巡线
export function delPatrol(id) {
  return request({
    url: '/line/patrol/' + id,
    method: 'delete'
  })
}

// 导出巡线
export function exportPatrol(query) {
  return request({
    url: '/line/patrol/export',
    method: 'get',
    params: query
  })
}

// 查询巡线柱状图数据
export function getPatrolChars(year) {
  return request({
    url: '/line/patrol/getPatrolChars/' + year,
    method: 'get'
  })
}
