import request from '@/utils/request'

// 查询工单信息列表
export function listMaintenance(query) {
    return request({
        url: '/iot/maintenance/list',
        method: 'get',
        params: query
    })
}

// 查询工单信息列表
export function myListMaintenance(query) {
  return request({
      url: '/iot/maintenance/my-list',
      method: 'get',
      params: query
  })
}

// 查询工单信息详细
export function getMaintenance(maintenanceId) {
    return request({
        url: '/iot/maintenance/' + maintenanceId,
        method: 'get'
    })
}

// 新增工单信息
export function addMaintenance(data) {
    return request({
        url: '/iot/maintenance',
        method: 'post',
        data: data
    })
}

// 修改工单信息
export function updateMaintenance(data) {
    return request({
        url: '/iot/maintenance',
        method: 'put',
        data: data
    })
}

// 删除工单信息
export function delMaintenance(maintenanceId) {
    return request({
        url: '/iot/maintenance/' + maintenanceId,
        method: 'delete'
    })
}

// 导出工单信息
export function exportMaintenance(query) {
    return request({
        url: '/iot/maintenance/export',
        method: 'get',
        params: query
    })
}


// 获取租户下用户
export function getTenantHandleUser(query) {
  return request({
      url: '/system/user/list',
      method: 'get',
      params: query
  })
}
