import request from '@/utils/request'

// ============ 工程基础信息 ATT_ENG_BASE ============
export function listEngBase(query) {
  return request({ url: '/hidd/engbase/list', method: 'get', params: query })
}
export function getEngBase(guid) {
  return request({ url: '/hidd/engbase/' + guid, method: 'get' })
}
export function addEngBase(data) {
  return request({ url: '/hidd/engbase', method: 'post', data: data })
}
export function updateEngBase(data) {
  return request({ url: '/hidd/engbase', method: 'put', data: data })
}
export function delEngBase(guids) {
  return request({ url: '/hidd/engbase/' + guids, method: 'delete' })
}

// ============ 工程信息 OBJ_ENG ============
export function listObjEng(query) {
  return request({ url: '/hidd/objeng/list', method: 'get', params: query })
}
export function getObjEng(guid) {
  return request({ url: '/hidd/objeng/' + guid, method: 'get' })
}
export function addObjEng(data) {
  return request({ url: '/hidd/objeng', method: 'post', data: data })
}
export function updateObjEng(data) {
  return request({ url: '/hidd/objeng', method: 'put', data: data })
}
export function delObjEng(guids) {
  return request({ url: '/hidd/objeng/' + guids, method: 'delete' })
}

// ============ 工程类型属性 - 通用函数（index.vue 动态路由使用）============
export function listEngAttr(type, query) {
  return request({ url: `/eng/attr/${type}/list`, method: 'get', params: query })
}
export function getEngAttr(type, guid) {
  return request({ url: `/eng/attr/${type}/${guid}`, method: 'get' })
}
export function addEngAttr(type, data) {
  return request({ url: `/eng/attr/${type}`, method: 'post', data: data })
}
export function updateEngAttr(type, data) {
  return request({ url: `/eng/attr/${type}`, method: 'put', data: data })
}
export function delEngAttr(type, guids) {
  return request({ url: `/eng/attr/${type}/${guids}`, method: 'delete' })
}

// ============ 各类型专用 API（与后端 AttEng*Controller 一一对应）============

// 农村供水工程 cws
export function listAttEngCws(query) { return request({ url: '/eng/attr/cws/list', method: 'get', params: query }) }
export function getAttEngCws(guid) { return request({ url: '/eng/attr/cws/' + guid, method: 'get' }) }
export function addAttEngCws(data) { return request({ url: '/eng/attr/cws', method: 'post', data: data }) }
export function updateAttEngCws(data) { return request({ url: '/eng/attr/cws', method: 'put', data: data }) }
export function delAttEngCws(guids) { return request({ url: '/eng/attr/cws/' + guids, method: 'delete' }) }

// 堤防工程 dike
export function listAttEngDike(query) { return request({ url: '/eng/attr/dike/list', method: 'get', params: query }) }
export function getAttEngDike(guid) { return request({ url: '/eng/attr/dike/' + guid, method: 'get' }) }
export function addAttEngDike(data) { return request({ url: '/eng/attr/dike', method: 'post', data: data }) }
export function updateAttEngDike(data) { return request({ url: '/eng/attr/dike', method: 'put', data: data }) }
export function delAttEngDike(guids) { return request({ url: '/eng/attr/dike/' + guids, method: 'delete' }) }

// 水电站工程 hyst
export function listAttEngHyst(query) { return request({ url: '/eng/attr/hyst/list', method: 'get', params: query }) }
export function getAttEngHyst(guid) { return request({ url: '/eng/attr/hyst/' + guid, method: 'get' }) }
export function addAttEngHyst(data) { return request({ url: '/eng/attr/hyst', method: 'post', data: data }) }
export function updateAttEngHyst(data) { return request({ url: '/eng/attr/hyst', method: 'put', data: data }) }
export function delAttEngHyst(guids) { return request({ url: '/eng/attr/hyst/' + guids, method: 'delete' }) }

// 灌区工程 irr
export function listAttEngIrr(query) { return request({ url: '/eng/attr/irr/list', method: 'get', params: query }) }
export function getAttEngIrr(guid) { return request({ url: '/eng/attr/irr/' + guid, method: 'get' }) }
export function addAttEngIrr(data) { return request({ url: '/eng/attr/irr', method: 'post', data: data }) }
export function updateAttEngIrr(data) { return request({ url: '/eng/attr/irr', method: 'put', data: data }) }
export function delAttEngIrr(guids) { return request({ url: '/eng/attr/irr/' + guids, method: 'delete' }) }

// 其他工程 othe
export function listAttEngOthe(query) { return request({ url: '/eng/attr/othe/list', method: 'get', params: query }) }
export function getAttEngOthe(guid) { return request({ url: '/eng/attr/othe/' + guid, method: 'get' }) }
export function addAttEngOthe(data) { return request({ url: '/eng/attr/othe', method: 'post', data: data }) }
export function updateAttEngOthe(data) { return request({ url: '/eng/attr/othe', method: 'put', data: data }) }
export function delAttEngOthe(guids) { return request({ url: '/eng/attr/othe/' + guids, method: 'delete' }) }

// 泵站工程 pust
export function listAttEngPust(query) { return request({ url: '/eng/attr/pust/list', method: 'get', params: query }) }
export function getAttEngPust(guid) { return request({ url: '/eng/attr/pust/' + guid, method: 'get' }) }
export function addAttEngPust(data) { return request({ url: '/eng/attr/pust', method: 'post', data: data }) }
export function updateAttEngPust(data) { return request({ url: '/eng/attr/pust', method: 'put', data: data }) }
export function delAttEngPust(guids) { return request({ url: '/eng/attr/pust/' + guids, method: 'delete' }) }

// 淤地坝工程 sd
export function listAttEngSd(query) { return request({ url: '/eng/attr/sd/list', method: 'get', params: query }) }
export function getAttEngSd(guid) { return request({ url: '/eng/attr/sd/' + guid, method: 'get' }) }
export function addAttEngSd(data) { return request({ url: '/eng/attr/sd', method: 'post', data: data }) }
export function updateAttEngSd(data) { return request({ url: '/eng/attr/sd', method: 'put', data: data }) }
export function delAttEngSd(guids) { return request({ url: '/eng/attr/sd/' + guids, method: 'delete' }) }

// 引调水工程 wadi
export function listAttEngWadi(query) { return request({ url: '/eng/attr/wadi/list', method: 'get', params: query }) }
export function getAttEngWadi(guid) { return request({ url: '/eng/attr/wadi/' + guid, method: 'get' }) }
export function addAttEngWadi(data) { return request({ url: '/eng/attr/wadi', method: 'post', data: data }) }
export function updateAttEngWadi(data) { return request({ url: '/eng/attr/wadi', method: 'put', data: data }) }
export function delAttEngWadi(guids) { return request({ url: '/eng/attr/wadi/' + guids, method: 'delete' }) }

// 水闸工程 waga
export function listAttEngWaga(query) { return request({ url: '/eng/attr/waga/list', method: 'get', params: query }) }
export function getAttEngWaga(guid) { return request({ url: '/eng/attr/waga/' + guid, method: 'get' }) }
export function addAttEngWaga(data) { return request({ url: '/eng/attr/waga', method: 'post', data: data }) }
export function updateAttEngWaga(data) { return request({ url: '/eng/attr/waga', method: 'put', data: data }) }
export function delAttEngWaga(guids) { return request({ url: '/eng/attr/waga/' + guids, method: 'delete' }) }

// ============ 水库工程属性 ATT_ENG_RES (sins 模块) ============
export { listAttEngRes, getAttEngRes, addAttEngRes, updateAttEngRes, delAttEngRes } from './sins'
