import request from '@/utils/request'

// 查询设备参数管理列表
export function listParam(query) {
  return request({
    url: '/hnyz/param/list',
    method: 'get',
    params: query
  })
}

// 查询设备参数管理详细
export function getParam(registerId) {
  return request({
    url: '/hnyz/param/' + registerId,
    method: 'get'
  })
}

// 新增设备参数管理
export function addParam(data) {
  return request({
    url: '/hnyz/param',
    method: 'post',
    data: data
  })
}

// 修改设备参数管理
export function updateParam(data) {
  return request({
    url: '/hnyz/param',
    method: 'put',
    data: data
  })
}

// 删除设备参数管理
export function delParam(registerId) {
  return request({
    url: '/hnyz/param/' + registerId,
    method: 'delete'
  })
}

//修改设备参数管理状态
export function changeStatus(registerId, status) {
  return request({
    url: '/hnyz/param/changeStatus',    
    method: 'put',
    data: {
      registerId: registerId,
      status: status
    }
  })
}

//根据设备code查询对应主设置项寄存器
export function getMainSetParam(code) {
  return request({
    url: '/hnyz/param/getMainSetParam/' + code,
    method: 'get'
  })
}

//根据设备code查询对应所有设置项寄存器
export function getAllSetParam(code) {
  return request({
    url: '/hnyz/param/getAllSetParam/' + code,
    method: 'get'
  })
}

//根据设备code查询对应所有设置项寄存器
export function getAllParamConfigDataByCodeList(codeList) {
  return request({
    url: '/hnyz/param/getAllParamConfigDataByCodeList',
    method: 'post', 
    data: codeList
  })
}

//根据设备code查询对应所有设置项寄存器
export function getAllParamConfigByCode(code) {
  return request({
    url: '/hnyz/param/getAllParamConfigByCode/' + code,
    method: 'get'
  })
}