import request from '@/utils/request'

// 计算CTS扣分 / 装置人均扣分
export function calcScore2ByYear(saiYear) {
  return request({
    url: '/production/sai/calcScore2ByYear/' + saiYear,
    method: 'get'
  })
}

// 计算当年装置自查人均扣分
export function calcScoreByYear(saiYear) {
  return request({
    url: '/production/sai/calcScoreByYear/' + saiYear,
    method: 'get'
  })
}

// 查询SAI信息列表
export function listSaiByYear(query) {
  return request({
    url: '/production/sai/listByYear',
    method: 'get',
    params: query
  })
}

// 查询SAI信息列表
export function listSai(query) {
  return request({
    url: '/production/sai/list',
    method: 'get',
    params: query
  })
}

// 查询SAI信息详细
export function getSai(saiId) {
  return request({
    url: '/production/sai/' + saiId,
    method: 'get'
  })
}

// 新增SAI信息
export function addSai(data) {
  return request({
    url: '/production/sai',
    method: 'post',
    data: data
  })
}

// 修改SAI信息
export function updateSai(data) {
  return request({
    url: '/production/sai',
    method: 'put',
    data: data
  })
}

// 删除SAI信息
export function delSai(saiId) {
  return request({
    url: '/production/sai/' + saiId,
    method: 'delete'
  })
}

// 导出SAI信息
export function exportSai(query) {
  return request({
    url: '/production/sai/export',
    method: 'get',
    params: query
  })
}
