import request from '@/utils/request'

// 查询数据接入列表
export function tableNameList(databaseName) {
    return request({
        url: '/system/accredit/tableNameList/' + databaseName,
        method: 'post'
    })
}

export function selectTableXml(tableName) {
    return request({
        url: '/system/accredit/selectTableXml/' + tableName,
        method: 'post'
    })
}

export function listDeptVo(data) {
    return request({
        url: '/system/accredit/listDeptVo',
        method: 'get',
        data
    })
}

export function listSelectSysUser(data) {
    return request({
        url: '/system/accredit/listSelectSysUser',
        method: 'get',
        data
    })
}

export function selJDBCStream(data) {
    return request({
        url: '/system/accredit/selJDBCStream',
        method: 'post',
        data
    })
}
export function selJDBCStream2(data) {
    return request({
        url: '/system/accredit/selJDBCStream2',
        method: 'post',
        data
    })
}

export function listListstructure(data) {
    return request({
        url: '/system/accredit/listListstructure',
        method: 'post',
        data
    })
}
// 根据表名查询表框架
export function selNameTableList(name) {
    return request({
        url: '/system/accredit/selNameTableList/'+ name,
        method: 'post'
    })
}
// 根据表名获取表结构
export function selNameListStructure(tableName,databaseName) {
    return request({
        url: '/system/accredit/selNameListStructure?tableName=' + tableName + '&databaseName=' + databaseName,
        method: 'post'
    })
}

/**
 * 修改状态/是否增加字典
 * @param data
 * @returns {AxiosPromise}
 */
export function updateListStructure(data) {
    return request({
        url: '/system/accredit/updateListStructure',
        method: 'post',
        data
    })
}

export function selectFrimary(data) {
    return request({
        url: '/system/accredit/selectFrimary',
        method: 'post',
        data
    })
}

export function selectTableList(id) {
    return request({
        url: '/system/accredit/selectTableList/'+ id ,
        method: 'post'
    })
}

export function selStatus(databaseName,tableName) {
    return request({
        url: '/system/accredit/selStatus?databaseName=' + databaseName + '&tableName=' + tableName,
        method: 'post'
    })
}

export function listMiddle(tableName,databaseName) {
    return request({
        url: '/system/accredit/listMiddle?tableName=' + tableName + '&databaseName=' + databaseName,
        method: 'post'
    })
}

export function listMiddle2(databaseName) {
    return request({
        url: '/system/accredit/listMiddle2?databaseName=' + databaseName,
        method: 'post'
    })
}

export function listUserMiddle(tableName,databaseName) {
    return request({
        url: '/system/accredit/listUserMiddle?tableName=' + tableName + '&databaseName=' + databaseName,
        method: 'post'
    })
}

export function listUserMiddle2(databaseName) {
    return request({
        url: '/system/accredit/listUserMiddle2?databaseName=' + databaseName,
        method: 'post'
    })
}

export function updateMiddle(mid,statusId) {
    return request({
        url: '/system/accredit/updateMiddle?mid=' + mid + "&statusId=" + statusId,
        method: 'post'
    })
}

export function updateUserMiddle(mid,statusId) {
    return request({
        url: '/system/accredit/updateUserMiddle?mid=' + mid + "&statusId=" + statusId,
        method: 'post'
    })
}

export function selectShow(tableName) {
    return request({
        url: '/system/accredit/selectShow?tableName=' + tableName,
        method: 'post'
    })
}

export function selTotalNum(data) {
    return request({
      url: '/system/accredit/selTotalNum',
      method: 'post',
      data
    })
}

export function selTotal(name) {
    return request({
      url: '/system/accredit/selTotal/' + name,
      method: 'post'
    })
}


