import { TAicbqCfg,TAicbqCfgQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取抄表器基本参数配置列表
 * @param data TAicbqCfgQueryParam
 */
const QueryTAicbqCfgList = (data: TAicbqCfgQueryParam) =>
    request({
        url: '/TAicbqCfgAction/list',
        method: 'post',
        data: data
    })

/**
* 新增抄表器基本参数配置
* @param data TAicbqCfg
*/
const AddTAicbqCfg = (data: TAicbqCfg) =>
    request({
        url: '/TAicbqCfgAction/saveTAicbqCfg',
        method: 'post',
        data: data
    })

/**
* 编辑抄表器基本参数配置
* @param data TAicbqCfg
*/
const EditTAicbqCfg = (data: TAicbqCfg) =>
    request({
        url: '/TAicbqCfgAction/updateTAicbqCfg',
        method: 'post',
        data: data
    })

/**
* 删除抄表器基本参数配置
* @param  id number
*/
const DeleteTAicbqCfg = (id: number) =>
    request({
        url: '/TAicbqCfgAction/deleteTAicbqCfg/' + id,
        method: 'get',
    })

 /**
  * 
  * @param deviceSn 根据设备SN/遥测站编码/启用标记获取抄表器对象
  * @param stationCode 
  * @param useFlag 
  * @returns 
  */
 const QueryTAicbqCfg = (deviceSn: string) =>
 request({
     url: '/TAicbqCfgAction/findTAicbqCfg/' + deviceSn,
    //  params:{
    //     "deviceSn":deviceSn,
    //     "stationCode":stationCode,
    //     "useFlag":useFlag
    // },
     method: 'get'
 })


export default {
    QueryTAicbqCfgList,
    AddTAicbqCfg,
    EditTAicbqCfg,
    DeleteTAicbqCfg,
    QueryTAicbqCfg
}