import request from '@/utils/request'

// 查询预警策略列表
export function listStrategy(query) {
  return request({
    url: '/enterprise/strategy/list',
    method: 'get',
    params: query
  })
}
export function selectStrategyList(query) {
  return request({
    url: '/enterprise/strategy/selectStrategyList',
    method: 'get',
    params: query
  })
}

// 查询预警策略详细
export function getStrategy(id) {
  return request({
    url: '/enterprise/strategy/' + id,
    method: 'get'
  })
}

// 新增预警策略
export function addStrategy(data) {
  return request({
    url: '/enterprise/strategy',
    method: 'post',
    data: data
  })
}

// 修改预警策略
export function updateStrategy(data) {
  return request({
    url: '/enterprise/strategy',
    method: 'put',
    data: data
  })
}

// 删除预警策略
export function delStrategy(id) {
  return request({
    url: '/enterprise/strategy/' + id,
    method: 'delete'
  })
}
export function findCarTypeName() {
  return request({
    url: '/enterprise/carType/findCarTypeName',
    method: 'post',
  })
}
export function findStrategyListByCarTypeId(carTypeId) {
  return request({
    url: '/enterprise/strategy/findStrategyListByCarTypeId',
    method: 'post',
    params: {carTypeId:carTypeId}
  })
}
