import request from '@/utils/request'

// 车辆运动信息管理
// 查询车辆运动信息列表
export function listCarRunInfo(query) {
  return request({
    url: '/system/vehicle_location/list',
    method: 'get',
    params: query
  })
}

// 导出车辆运动信息列表
export function exportCarRunInfo(query) {
  return request({
    url: '/system/vehicle_location/export',
    method: 'post',
    params: query
  })
}

// 批量查询车辆轨迹
export function batchQueryVehicleTrajectory(data) {
  return request({
    url: '/system/vehicle_location/trajectory/batch',
    method: 'post',
    data: data
  })
}

// 根据车辆ID查询车辆运动信息列表
export function listCarRunInfoByVehicleId(vehicleId, query) {
  return request({
    url: '/system/vehicle_location/vehicle/' + vehicleId,
    method: 'get',
    params: query
  })
}

// 根据车辆ID查询车辆轨迹
export function getVehicleTrajectory(vehicleId, query) {
  return request({
    url: '/system/vehicle_location/trajectory/' + vehicleId,
    method: 'get',
    params: query
  })
}

// 根据车辆ID查询轨迹统计信息
export function getTrajectoryStatistics(vehicleId, query) {
  return request({
    url: '/system/vehicle_location/trajectory/' + vehicleId + '/statistics',
    method: 'get',
    params: query
  })
}

// 根据车辆ID查询轨迹回放数据
export function getTrajectoryPlayback(vehicleId, query) {
  return request({
    url: '/system/vehicle_location/trajectory/' + vehicleId + '/playback',
    method: 'get',
    params: query
  })
}

// 根据车辆ID查询区域内轨迹
export function getAreaTrajectory(vehicleId, query) {
  return request({
    url: '/system/vehicle_location/trajectory/' + vehicleId + '/area',
    method: 'get',
    params: query
  })
}

// 根据车牌号查询车辆运动信息列表
export function listCarRunInfoByLicensePlate(licensePlate, query) {
  return request({
    url: '/system/vehicle_location/plate/' + licensePlate,
    method: 'get',
    params: query
  })
}

// 根据车辆ID查询车辆最新位置信息
export function getLatestLocationByVehicleId(vehicleId) {
  return request({
    url: '/system/vehicle_location/latest/vehicle/' + vehicleId,
    method: 'get'
  })
}

// 根据车牌号查询车辆最新位置信息
export function getLatestLocationByLicensePlate(licensePlate) {
  return request({
    url: '/system/vehicle_location/latest/plate/' + licensePlate,
    method: 'get'
  })
}

// 删除调度日志
export function delJobLog(jobLogId) {
  return request({
    url: '/monitor/jobLog/' + jobLogId,
    method: 'delete'
  })
}

// 清空调度日志
export function cleanJobLog() {
  return request({
    url: '/monitor/jobLog/clean',
    method: 'delete'
  })
}
