import request from '@/utils/request'

// 创建统计
export function createUseCount(data) {
  return request({
    url: '/system/use-count/create',
    method: 'post',
    data: data
  })
}

// 更新统计
export function updateUseCount(data) {
  return request({
    url: '/system/use-count/update',
    method: 'put',
    data: data
  })
}

// 删除统计
export function deleteUseCount(id) {
  return request({
    url: '/system/use-count/delete?id=' + id,
    method: 'delete'
  })
}

// 获得统计
export function getUseCount(id) {
  return request({
    url: '/system/use-count/get?id=' + id,
    method: 'get'
  })
}


// 获得统计分页
export function getUseCountPage(query) {
  return request({
    url: '/system/use-count/page',
    method: 'get',
    params: query
  })
}

// 获得统计分页
export function getUseCountTo(query) {
  return request({
    url: '/system/use-count/countto',
    method: 'get',
    params: query
  })
}
// 获得统计分页
export function getUseCountToDate(query) {
  return request({
    url: '/system/use-count/counttodate',
    method: 'get',
    params: query
  })
}

export function getUseCountToSection(query) {
  return request({
    url: '/system/use-count/counttosection',
    method: 'get',
    params: query
  })
}

// 导出统计 Excel
export function exportUseCountExcel(query) {
  return request({
    url: '/system/use-count/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
