DbTableService.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. package jnpf.base.service;
  2. import jnpf.base.Page;
  3. import jnpf.base.Pagination;
  4. import jnpf.database.model.dbfield.DbFieldModel;
  5. import jnpf.database.model.dbtable.DbTableFieldModel;
  6. import jnpf.database.model.page.DbTableDataForm;
  7. import jnpf.exception.DataException;
  8. import java.util.List;
  9. import java.util.Map;
  10. /**
  11. * 数据管理
  12. *
  13. * @author JNPF开发平台组
  14. * @version V3.1.0
  15. * @copyright 引迈信息技术有限公司
  16. * @date 2019年9月27日 上午9:18
  17. */
  18. public interface DbTableService {
  19. /**
  20. * 1:表列表
  21. *
  22. * @param dbLinkId 连接Id
  23. * @param methodName
  24. * @return 表集合信息
  25. * @throws DataException ignore
  26. */
  27. List<DbTableFieldModel> getList(String dbLinkId, String methodName) throws Exception;
  28. /**
  29. * 1:表列表
  30. *
  31. * @param dbLinkId 连接Id
  32. * @param page 关键字
  33. * @return 表集合信息
  34. * @throws DataException ignore
  35. */
  36. List<DbTableFieldModel> getListPage(String dbLinkId, Page page) throws Exception;
  37. /**
  38. * 1:表列表
  39. *
  40. * @param dbLinkId 连接Id
  41. * @return 表集合信息
  42. * @throws DataException ignore
  43. */
  44. List<DbTableFieldModel> getListPage(String dbLinkId, Pagination pagination) throws Exception;
  45. /**
  46. * 2:单表信息
  47. *
  48. * @param dbLinkId 连接Id
  49. * @return 表集合信息
  50. * @throws DataException ignore
  51. */
  52. DbTableFieldModel getTable(String dbLinkId, String table) throws Exception;
  53. /**
  54. * 3:表字段
  55. *
  56. * @param dbLinkId 连接Id
  57. * @param table 表名
  58. * @return 字段集合信息
  59. * @throws DataException ignore
  60. */
  61. List<DbFieldModel> getFieldList(String dbLinkId, String table) throws Exception;
  62. /**
  63. * 4:表数据
  64. *
  65. * @param dbTableDataForm 分页
  66. * @param dbLinkId 连接Id
  67. * @param table 表名
  68. * @return 表数据集合
  69. * @throws Exception ignore
  70. */
  71. List<Map<String, Object>> getData(DbTableDataForm dbTableDataForm, String dbLinkId, String table) throws Exception;
  72. /**
  73. * 5:校验:表名重名
  74. *
  75. * @param dbLinkId 连接Id
  76. * @return 重名标识
  77. * @throws Exception ignore
  78. */
  79. boolean isExistTable(String dbLinkId, String table) throws Exception;
  80. /**
  81. * 6:删除存在表
  82. *
  83. * @param dbLinkId 连接ID
  84. * @param table 删除表
  85. */
  86. boolean dropExistsTable(String dbLinkId, String table) throws Exception;
  87. /**
  88. * 7:删除表
  89. *
  90. * @param dbLinkId 连接Id
  91. * @param table 表名
  92. * @throws DataException ignore
  93. */
  94. void delete(String dbLinkId, String table) throws Exception;
  95. /**
  96. * 删除全部表(慎用)
  97. * @param dbLinkId 连接Id
  98. */
  99. void deleteAllTable(String dbLinkId, String dbType) throws Exception;
  100. /**
  101. * 8:创建表
  102. *
  103. * @param dbTableFieldModel 前端创表表单信息
  104. * @return 执行状态(1:成功;0:重名)
  105. * @throws DataException ignore
  106. */
  107. int createTable(DbTableFieldModel dbTableFieldModel) throws Exception;
  108. /**
  109. * 9:获取表模型
  110. * @param dbLinkId 数据连接ID
  111. * @param tableName 表名
  112. * @return 表模板
  113. * @throws Exception ignore
  114. */
  115. DbTableFieldModel getDbTableModel(String dbLinkId, String tableName) throws Exception;
  116. /**
  117. * 10:修改表
  118. *
  119. * @param dbTableFieldModel 修改表参数对象
  120. * @throws DataException ignore
  121. */
  122. void update(DbTableFieldModel dbTableFieldModel) throws Exception;
  123. /**
  124. * 11:添加字段
  125. * @param dbTableFieldModel 数据表字段模型
  126. * @throws DataException ignore
  127. */
  128. void addField(DbTableFieldModel dbTableFieldModel) throws Exception;
  129. /**
  130. * 12:获取表数据行数
  131. *
  132. * @param dbLinkId 数据连接Id
  133. * @param table 表名
  134. * @return 数据行数
  135. * @throws DataException ignore
  136. */
  137. int getSum(String dbLinkId, String table) throws Exception;
  138. /**
  139. * 13:获取动态数据源
  140. *
  141. * @param dbLinkId 数据连接ID
  142. * @return 动态数据库源
  143. * @throws DataException ignore
  144. */
  145. // DbConnDTO getResource(String dbLinkId) throws DataException;
  146. }