import request from '@/utils/request'

// 查询施工桩机信息列表
export function listPileMachineInfo(query) {
  return request({
    url: '/cons/pileMachineInfo/list',
    method: 'get',
    params: query
  })
}

export function listAllPileMachineInfo(query) {
  return request({
    url: '/cons/pileMachineInfo/list/all',
    method: 'get',
    params: query
  })
}


// 查询施工桩机信息详细
export function getPileMachineInfo(id) {
  return request({
    url: '/cons/pileMachineInfo/' + id,
    method: 'get'
  })
}

// 新增施工桩机信息
export function addPileMachineInfo(data) {
  return request({
    url: '/cons/pileMachineInfo',
    method: 'post',
    data: data
  })
}

// 修改施工桩机信息
export function updatePileMachineInfo(data) {
  return request({
    url: '/cons/pileMachineInfo',
    method: 'put',
    data: data
  })
}

// 删除施工桩机信息
export function delPileMachineInfo(id) {
  return request({
    url: '/cons/pileMachineInfo/' + id,
    method: 'delete'
  })
}

export function getConsUnitMachine(id) {
  return request({
    url: '/cons/pileMachineInfo/screen/consunit/machine',
    params: {
      consUnitId: id
    },
    method: 'get'
  })
}

export function calcPileMachineOnOffline() {
  return request({
    url: '/cons/pileMachineInfo/screen/onOffline',
    method: 'get'
  })
}

export function calcPileMachineLatestIndex(id) {
  return request({
    url: '/cons/pileMachineInfo/screen/machine/latest',
    params: {
      machineId: id
    },
    method: 'get'
  })
}

