import request from '@/utils/request'

// 查询列表
export function listPower(query) {
  return request({
    url: '/mk/bo/power/list',
    method: 'get',
    params: query
  })
}

// 查询详情
export function getPower(id) {
  return request({
    url: '/mk/bo/power/' + id,
    method: 'get'
  })
}

// 新增主表
export function addPower(data) {
  return request({
    url: '/mk/bo/power/addPower',
    method: 'post',
    data: data
  })
}

// 删除主表
export function delPower(id) {
  return request({
    url: '/mk/bo/power/' + id,
    method: 'delete'
  })
}

// 新增子表
export function addPowerCustomers(data) {
  return request({
    url: '/mk/bo/power/addPowerCustomers',
    method: 'post',
    data: data
  })
}

// 删除子表
export function delPowerCustomers(id) {
  return request({
    url: '/mk/bo/power/delPowerCustomers/' + id,
    method: 'delete'
  })
}

// 新增孙表
export function addPowerProduct(data) {
  return request({
    url: '/mk/bo/power/addPowerProduct',
    method: 'post',
    data: data
  })
}

// 删除孙表
export function delPowerProduct(id) {
  return request({
    url: '/mk/bo/power/delPowerProduct/' + id,
    method: 'delete'
  })
}
