import request from '@/utils/request'

// 查询动态sql执行config列表
export function listSql(query) {
  return request({
    url: '/system/sql/list',
    method: 'get',
    params: query
  })
}

// 查询动态sql执行config详细
export function getSql(id) {
  return request({
    url: '/system/sql/' + id,
    method: 'get'
  })
}

// 新增动态sql执行config
export function addSql(data) {
  return request({
    url: '/system/sql',
    method: 'post',
    data: data
  })
}

// 修改动态sql执行config
export function updateSql(data) {
  return request({
    url: '/system/sql',
    method: 'put',
    data: data
  })
}

// 删除动态sql执行config
export function delSql(id) {
  return request({
    url: '/system/sql/' + id,
    method: 'delete'
  })
}


export function executeSqlByKeyAndParam(sqlKey, param){
  return request({
    url: '/system/sql/executeSqlByKeyAndParam/' + sqlKey,
    method: 'post',
    data: param
  })
}