package com.vci.ubcs.ddl.mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.ResultType;
|
import org.apache.ibatis.annotations.Update;
|
import org.springframework.stereotype.Repository;
|
|
/**
|
* Description: Oracle数据库操作
|
*
|
* @author LiHang
|
* @date 2023/4/24
|
*/
|
@Repository
|
public interface DdlOracleMapper extends DdlMapper{
|
|
/**
|
* 删除表格中的列
|
* @param tableName 表名称
|
* @param columnName 列名称
|
* @return 受影响的行数
|
*/
|
@Update("alter table ${tableName} DROP COLUMN ${columnName}")
|
@Override
|
int dropTableColumn(@Param("tableName")String tableName, @Param("columnName")String columnName);
|
|
/**
|
* 删除表格
|
* @param tableName 表格名称
|
* @return 影响的行数
|
*/
|
@Update("drop table if exists ${tableName}")
|
@ResultType(Integer.class)
|
@Override
|
int dropTable(@Param("tableName") String tableName);
|
|
/**
|
* 批量修改数据库表的字段
|
* @param tableName 表格的名称
|
* @param attributeSql 修改的属性的sql
|
* @return 影响的行数
|
*/
|
@Update("alter table ${tableName} modify ( ${attributeSql} ) ")
|
@ResultType(Integer.class)
|
@Override
|
int modifyTableBySql(@Param("tableName") String tableName, @Param("attributeSql") String attributeSql);
|
|
/**
|
* 向数据库表中批量添加字段
|
* @param tableName 表格的名称
|
* @param attributeSql 要添加的新的sql
|
* @return 影响的行数
|
*/
|
@Update("alter table ${tableName} add ( ${attributeSql} )")
|
@ResultType(Integer.class)
|
@Override
|
int addColumn2TableBySql(@Param("tableName") String tableName, @Param("attributeSql") String attributeSql);
|
}
|