TableInfoMapper.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. package com.customer.mapper;
  2. import com.customer.pojo.TableInfo;
  3. import com.customer.vo.TableInfoVO;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.session.RowBounds;
  6. import java.util.List;
  7. import java.util.Map;
  8. public interface TableInfoMapper {
  9. //---------------------------------mysql------------------------------------------
  10. /**
  11. * 使用数据库
  12. */
  13. void useDataBase(String dataBaseName);
  14. /**
  15. * 创建msql数据库表
  16. */
  17. void createMysqlDataBase(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName,@Param("tableComment") String tableComment,@Param("filedList") List<String> filedList);
  18. /**
  19. * 查询mysql数据库是否存在
  20. */
  21. int mysqlDataBaseExist(String dataBaseName);
  22. /**
  23. * 查询数据库表是否存在
  24. */
  25. int mysqlTableExist(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName);
  26. /**
  27. * 查询数据库中的表信息
  28. */
  29. List<TableInfoVO> tableInfoList(@Param("databaseName") String databaseName,@Param("map") Map<String,Object> map, RowBounds rowBounds);
  30. /**
  31. * 查询表中有没有数据
  32. */
  33. int selectDataCount(String tableName);
  34. /**
  35. * 删除表
  36. */
  37. void dropMysqlTable(String tableName);
  38. /**
  39. * 修改mysql数据表
  40. */
  41. void updateMysqlTable(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName,@Param("tableComment") String tableComment,@Param("filedList") List<String> filedList);
  42. /**
  43. * 获取表字段信息
  44. */
  45. List<TableInfo> mysqlTableFieldInfo(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName);
  46. //---------------------------------sqlServer------------------------------------------
  47. /**
  48. * 查询数据库表是否存在
  49. */
  50. int sqlServerTableExist(String tableName);
  51. /**
  52. * 创建数据库
  53. */
  54. void createSqlServerDataBase(String dataBaseName);
  55. /**
  56. * 创建数据表
  57. */
  58. void createSqlServerTable(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName,@Param("filedList") List<String> filedList,@Param("descriptionList") List<String> descriptionList);
  59. /**
  60. * 判断数据库是否存在
  61. */
  62. int existOrNot(@Param("dataBaseName") String dataBaseName);
  63. /**
  64. * 获取当前库中所有表信息
  65. */
  66. List<TableInfoVO> sqlServerTableInfoList(String databaseName);
  67. /**
  68. * 查询表中是否有数据
  69. */
  70. int selectSqlServerDataCount(String tableName);
  71. /**
  72. * 删除当前库中表
  73. */
  74. void dropSqlserverTable(String tableName);
  75. /**
  76. * 修改sqlserver数据表
  77. */
  78. void updateSqlserverTable(@Param("tableName") String tableName,@Param("filedList") List<String> filedList,@Param("descriptionList") List<String> descriptionList);
  79. //---------------------------------DM------------------------------------------
  80. /**
  81. * 查询数据库表是否存在
  82. */
  83. int dmTableExist(@Param("dataBaseName") String dataBaseName,@Param("tableName") String tableName);
  84. /**
  85. * 查询数据库是否存在
  86. */
  87. int dmDataBaseExist(String databaseName);
  88. /**
  89. * 创建数据库
  90. */
  91. void createDmDataBase(String databaseName);
  92. /**
  93. * 创建数据表
  94. */
  95. void createDmTable(@Param("databaseName") String databaseName,@Param("tableName") String tableName,@Param("filedList") List<String> filedList);
  96. /**
  97. * 添加表注释
  98. */
  99. void addTableDescription(String description);
  100. /**
  101. * 库中所有表信息
  102. */
  103. List<TableInfoVO> dmTableInfoList(String databaseName);
  104. /**
  105. * 查询表行数
  106. */
  107. int selectDmDataCount(String tableName);
  108. /**
  109. * 删除数据表
  110. */
  111. void dropDmTable(String tableName);
  112. //---------------------------------oracle------------------------------------------
  113. /**
  114. * 创建新用户
  115. */
  116. void createOracleUser(@Param("username") String username,@Param("password") String password);
  117. /**
  118. * 授予全部权限
  119. */
  120. void assignAuthority(String username);
  121. /**
  122. * 判断当前用户下表是否存在
  123. */
  124. int oracleTableExist(String tableName);
  125. /**
  126. * 创建oracle数据表
  127. */
  128. void createOracleTable(@Param("tableName") String tableName,@Param("filedList") List<String> filedList);
  129. // void createOracleTable(@Param("username") String username,@Param("tableName") String tableName,@Param("filedList") List<String> filedList);
  130. /**
  131. * 添加注释
  132. */
  133. void addOracleTableDescription(String description);
  134. }