import request from '@/utils/request'

// 查询农机作业记录列表
export function listMachineWorkRecords(query) {
  return request({
    url: '/base/machineWorkRecords/list',
    method: 'get',
    params: query
  })
}

// 查询农机作业记录详细
export function getMachineWorkRecords(id) {
  return request({
    url: '/base/machineWorkRecords/' + id,
    method: 'get'
  })
}

// 新增农机作业记录
export function addMachineWorkRecords(data) {
  return request({
    url: '/base/machineWorkRecords',
    method: 'post',
    data: data
  })
}



export function getMachineNameFieldUser(farmId) {
  return request({
    url: '/base/machineWorkRecords/MachineNameFieldUser/' + farmId,
    method: 'get'
  })
}

// 修改农机作业记录
export function updateMachineWorkRecords(data) {
  return request({
    url: '/base/machineWorkRecords',
    method: 'put',
    data: data
  })
}

// 删除农机作业记录
export function delMachineWorkRecords(id) {
  return request({
    url: '/base/machineWorkRecords/' + id,
    method: 'delete'
  })
}
