saas_platform.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. CREATE DATABASE IF NOT EXISTS `saas_platform` DEFAULT CHARACTER SET = utf8mb4;
  2. Use `saas_platform`;
  3. SET NAMES utf8mb4;
  4. SET FOREIGN_KEY_CHECKS = 0;
  5. -- ----------------------------
  6. -- Table structure for saas_account
  7. -- ----------------------------
  8. DROP TABLE IF EXISTS `saas_account`;
  9. CREATE TABLE `saas_account` (
  10. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  11. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团编码',
  12. `TERMINAL` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
  13. `USERNAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录用户名,集团下唯一,业务保证',
  14. `PASSWORD` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登录密码',
  15. `PHONE_NUM` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
  16. `MAIL` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  17. `HEAD_PORTRAIT` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像,图片URL',
  18. `ACCOUNT_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '2' COMMENT '账号类型, 0-超级管理员(所有集团),1-单集团管理员(单集团),2-普通账号',
  19. `ACCOUNT_BELONG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号所属, 0-运维系统账号,1-业务账号',
  20. `ACCOUNT_SOURCE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'persagy' COMMENT '账号来源, persagy-博锐',
  21. `LAST_LOGIN_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '账号上一次登录时间',
  22. `LAST_LOGIN_IP` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号上一次登录IP',
  23. `LOGIN_FAIL` tinyint(4) NULL DEFAULT NULL COMMENT '账号登录失败次数,超过阈值,冻结',
  24. `VALID_LAST` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '账号有效期,0-期内有效,1-永久有效',
  25. `VALID_START_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '账号有效期的开始时间',
  26. `VALID_END_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '账号有效期的结束时间',
  27. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  28. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  29. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  30. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  31. `VALID` tinyint(4) NULL DEFAULT 1 COMMENT '0-不可用,1-可用',
  32. PRIMARY KEY (`ID`) USING BTREE,
  33. INDEX `NK_ACCOUNT_GROUP_APP`(`GROUP_CODE`, `TERMINAL`) USING BTREE,
  34. INDEX `NK_ACCOUNT_VALID_NAME`(`VALID`, `USERNAME`) USING BTREE,
  35. INDEX `NK_ACCOUNT_UPDATE_TIME`(`UPDATE_TIME`) USING BTREE
  36. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号信息' ROW_FORMAT = Dynamic;
  37. -- ----------------------------
  38. -- Table structure for saas_account_project
  39. -- ----------------------------
  40. DROP TABLE IF EXISTS `saas_account_project`;
  41. CREATE TABLE `saas_account_project` (
  42. `ACCOUNT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账号ID',
  43. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团编码',
  44. `AREA_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域ID',
  45. `PROJECT_ID` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目ID',
  46. UNIQUE INDEX `UK_ACCOUNT_PROJECT_GROUP`(`ACCOUNT_ID`, `GROUP_CODE`, `PROJECT_ID`) USING BTREE
  47. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号-集团项目关联信息' ROW_FORMAT = Dynamic;
  48. -- ----------------------------
  49. -- Table structure for saas_account_role
  50. -- ----------------------------
  51. DROP TABLE IF EXISTS `saas_account_role`;
  52. CREATE TABLE `saas_account_role` (
  53. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  54. `ACCOUNT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账号ID',
  55. `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID',
  56. `CAS_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '关联类型,0-主岗,1-副岗,2-业务超管默认角色',
  57. UNIQUE INDEX `UK_ACCOUNT_ACCOUNT_ROLE`(`ACCOUNT_ID`, `GROUP_CODE`, `ROLE_ID`) USING BTREE
  58. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号-角色关联信息' ROW_FORMAT = Dynamic;
  59. -- ----------------------------
  60. -- Table structure for saas_area
  61. -- ----------------------------
  62. DROP TABLE IF EXISTS `saas_area`;
  63. CREATE TABLE `saas_area` (
  64. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  65. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '集团编码',
  66. `PARENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级区域ID',
  67. `AREA_CODE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域编码',
  68. `AREA_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域名称',
  69. `AREA_TYPE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域类型,0-非最底层区域,1-最底层区域',
  70. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  71. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  72. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  73. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  74. PRIMARY KEY (`ID`) USING BTREE,
  75. INDEX `NK_AREA_PARENT_ID`(`PARENT_ID`) USING BTREE,
  76. INDEX `NK_AREA_AREA_CODE`(`AREA_TYPE`) USING BTREE,
  77. INDEX `NK_AREA_GROUP_AREA_CODE`(`GROUP_CODE`, `AREA_CODE`) USING BTREE
  78. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '区域信息' ROW_FORMAT = Dynamic;
  79. -- ----------------------------
  80. -- Table structure for saas_function
  81. -- ----------------------------
  82. DROP TABLE IF EXISTS `saas_function`;
  83. CREATE TABLE `saas_function` (
  84. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  85. `PRODUCT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
  86. `PAGE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面ID',
  87. `MENU_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单ID',
  88. `FUN_CODE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '功能编码',
  89. `FUN_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '功能名称',
  90. `FUN_URL` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '功能URL',
  91. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  92. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  93. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  94. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  95. PRIMARY KEY (`ID`) USING BTREE,
  96. INDEX `NK_FUN_MENU_ID`(`MENU_ID`) USING BTREE,
  97. INDEX `NK_FUN_FUN_CODE`(`FUN_CODE`) USING BTREE,
  98. INDEX `NK_FUN_PAGE_ID`(`PAGE_ID`) USING BTREE,
  99. INDEX `NK_FUN_CREATE_TIME`(`CREATE_TIME`) USING BTREE
  100. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '功能信息' ROW_FORMAT = Dynamic;
  101. -- ----------------------------
  102. -- Table structure for saas_group
  103. -- ----------------------------
  104. DROP TABLE IF EXISTS `saas_group`;
  105. CREATE TABLE `saas_group` (
  106. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '集团编码',
  107. `GROUP_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团名称,业务保证唯一性',
  108. `GROUP_ICON` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团图标',
  109. `GROUP_DESC` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团描述',
  110. `DEPLOY_MODEL` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团部署方式,0-公有云,1-私有云',
  111. `SYNC_STATE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '2' COMMENT '数据同步状态,0-数据同步失败,1-数据同步成功,2-未同步',
  112. `SYNC_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '上次数据同步时间',
  113. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  114. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  115. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  116. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  117. `VALID` tinyint(4) NULL DEFAULT 1 COMMENT '0-不可用,1-可用',
  118. PRIMARY KEY (`GROUP_CODE`) USING BTREE,
  119. INDEX `NK_GROUP_VALID_NAME`(`VALID`, `GROUP_NAME`) USING BTREE
  120. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '集团信息' ROW_FORMAT = Dynamic;
  121. -- ----------------------------
  122. -- Table structure for saas_group_product
  123. -- ----------------------------
  124. DROP TABLE IF EXISTS `saas_group_product`;
  125. CREATE TABLE `saas_group_product` (
  126. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  127. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团编码',
  128. `PRODUCT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
  129. `PRODUCT_RANGE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品使用范围,0-全部项目,1-部分项目',
  130. `PRODUCT_CONTRACT` timestamp(0) NULL DEFAULT NULL COMMENT '签约时间',
  131. `VALID_START_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '签约有效期的开始时间',
  132. `VALID_END_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '签约有效期的结束时间',
  133. `VALID_LAST` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '签约有效期,0-期内有效,1-永久有效',
  134. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  135. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  136. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  137. PRIMARY KEY (`ID`) USING BTREE,
  138. UNIQUE INDEX `UK_GROUP_PRODUCT_ID`(`GROUP_CODE`, `PRODUCT_ID`) USING BTREE,
  139. INDEX `NK_GROUP_PRODUCT_ID`(`PRODUCT_ID`) USING BTREE
  140. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品集团签约信息' ROW_FORMAT = Dynamic;
  141. -- ----------------------------
  142. -- Table structure for saas_group_product_page
  143. -- ----------------------------
  144. DROP TABLE IF EXISTS `saas_group_product_page`;
  145. CREATE TABLE `saas_group_product_page` (
  146. `CONTRACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团签约ID',
  147. `PAGE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面ID',
  148. UNIQUE INDEX `UK_GROUP_PRODUCT_PAGE_ID`(`CONTRACT_ID`, `PAGE_ID`) USING BTREE
  149. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '集团签约产品详情' ROW_FORMAT = Dynamic;
  150. -- ----------------------------
  151. -- Table structure for saas_menu
  152. -- ----------------------------
  153. DROP TABLE IF EXISTS `saas_menu`;
  154. CREATE TABLE `saas_menu` (
  155. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  156. `PARENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级菜单ID',
  157. `PRODUCT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
  158. `APP_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
  159. `MENU_CODE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单编码',
  160. `MENU_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
  161. `MENU_URL` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单URL',
  162. `URL_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'URL类型,0-相对路径,1-绝对路径',
  163. `MENU_ICON` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单图标',
  164. `MENU_SORT` int(11) NULL DEFAULT NULL COMMENT '菜单顺序',
  165. `MENU_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单类型,0-系统菜单,1-标准业务菜单,2-IBMS菜单,3-APP菜单',
  166. `MENU_GROUP` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '分组菜单,0-非分组菜单,1-分组菜单',
  167. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  168. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  169. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  170. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  171. `EXTRA_MENU` json NULL COMMENT '菜单额外字段',
  172. PRIMARY KEY (`ID`) USING BTREE,
  173. INDEX `NK_MENU_MENU_CODE`(`MENU_CODE`) USING BTREE,
  174. INDEX `NK_MENU_PARENT_ID`(`PARENT_ID`) USING BTREE,
  175. INDEX `NK_MENU_APP_ID`(`APP_ID`) USING BTREE,
  176. INDEX `NK_MENU_MENU_SORT`(`MENU_SORT`) USING BTREE,
  177. INDEX `NK_MENU_PRODUCT_ID`(`PRODUCT_ID`) USING BTREE
  178. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单信息' ROW_FORMAT = Dynamic;
  179. -- ----------------------------
  180. -- Table structure for saas_product
  181. -- ----------------------------
  182. DROP TABLE IF EXISTS `saas_product`;
  183. CREATE TABLE `saas_product` (
  184. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  185. `APP_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
  186. `PRODUCT_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品类型,0-系统产品,1-标准业务产品,2-IBMS产品',
  187. `PRODUCT_CODE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品编码',
  188. `PRODUCT_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称',
  189. `PRODUCT_ICON` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品图标',
  190. `PRODUCT_STATE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '产品状态,0-建设中,1-已完成,2-已关联',
  191. `PRODUCT_MENU` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '产品是否关联菜单,0-未关联,1-已关联',
  192. `MENU_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单ID',
  193. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  194. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  195. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  196. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  197. PRIMARY KEY (`ID`) USING BTREE,
  198. INDEX `NK_PRODUCT_APP_ID`(`APP_ID`) USING BTREE
  199. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品信息' ROW_FORMAT = Dynamic;
  200. -- ----------------------------
  201. -- Table structure for saas_product_category
  202. -- ----------------------------
  203. DROP TABLE IF EXISTS `saas_product_category`;
  204. CREATE TABLE `saas_product_category` (
  205. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  206. `PARENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级ID',
  207. `CATEGORY_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别名称',
  208. `CATEGORY_ICON` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别图标',
  209. `TERMINAL` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别所属终端',
  210. `TERMINAL_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别所属终端名称',
  211. `PRODUCT_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '此类别所对应的产品类型',
  212. `MENU_TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '此类别所对应的菜单类型',
  213. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  214. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  215. PRIMARY KEY (`ID`) USING BTREE
  216. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品类别信息' ROW_FORMAT = Dynamic;
  217. -- ----------------------------
  218. -- Table structure for saas_product_page
  219. -- ----------------------------
  220. DROP TABLE IF EXISTS `saas_product_page`;
  221. CREATE TABLE `saas_product_page` (
  222. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'PA+雪花',
  223. `PRODUCT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
  224. `PARENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级页面ID',
  225. `PAGE_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面名称',
  226. `PAGE_ICON` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面图标',
  227. `PAGE_URL` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面URL,一般为前端页面跳转链接',
  228. `PAGE_ANGLE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '页面视角,0-集团项目页,1-集团独有页,2-项目独有页,默认0',
  229. `PAGE_FLOOR` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否为落地页,0-非落地页,1-集团落地页,2-项目落地页,3-集团项目落地页',
  230. `PAGE_LEVEL` int(11) NULL DEFAULT NULL COMMENT '页面顺序',
  231. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  232. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  233. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  234. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  235. PRIMARY KEY (`ID`) USING BTREE,
  236. INDEX `NK_PAGE_PRODUCT_ID`(`PRODUCT_ID`) USING BTREE,
  237. INDEX `NK_PAGE_PARENT_ID`(`PARENT_ID`) USING BTREE
  238. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品页面配置' ROW_FORMAT = Dynamic;
  239. -- ----------------------------
  240. -- Table structure for saas_project
  241. -- ----------------------------
  242. DROP TABLE IF EXISTS `saas_project`;
  243. CREATE TABLE `saas_project` (
  244. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  245. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '集团编码',
  246. `PROJECT_ID` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目ID,集团下唯一,业务保证',
  247. `AREA_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目所属区域,必须为最底层的区域',
  248. `PROJECT_LOCAL_ID` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目本地编码,集团下唯一,业务保证',
  249. `PROJECT_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目名称,集团下唯一,业务保证',
  250. `PROVINCE_CODE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目所在省',
  251. `CITY_CODE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目所在市',
  252. `ZONE_CODE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目所在区',
  253. `LOCATION` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目详细地址',
  254. `OPEN_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '项目开业时间',
  255. `PROJECT_FUN` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目功能',
  256. `PROJECT_WEATHER` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目天气',
  257. `PROJECT_IMAGE` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目图标,多个之间,用逗号分隔',
  258. `LONGITUDE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目经度',
  259. `LATITUDE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目纬度',
  260. `MANAGE_ZONE` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团管理分区字段,只做展示用',
  261. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  262. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  263. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  264. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  265. `VALID` tinyint(4) NULL DEFAULT 1 COMMENT '0-不可用,1-可用',
  266. PRIMARY KEY (`ID`) USING BTREE,
  267. INDEX `NK_PROJECT_GROUP_PROJECT`(`VALID`, `GROUP_CODE`, `PROJECT_ID`) USING BTREE,
  268. INDEX `NK_PROJECT_AREA_ID`(`AREA_ID`) USING BTREE,
  269. INDEX `NK_PROJECT_PROJECT_NAME`(`PROJECT_NAME`) USING BTREE
  270. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目信息' ROW_FORMAT = Dynamic;
  271. -- ----------------------------
  272. -- Table structure for saas_project_product
  273. -- ----------------------------
  274. DROP TABLE IF EXISTS `saas_project_product`;
  275. CREATE TABLE `saas_project_product` (
  276. `CONTRACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团签约ID',
  277. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '集团编码',
  278. `PROJECT_ID` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目ID',
  279. `PRODUCT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品ID',
  280. `PRODUCT_CONTRACT` timestamp(0) NULL DEFAULT NULL COMMENT '签约时间',
  281. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  282. UNIQUE INDEX `UK_PROJECT_PRODUCT_ID`(`GROUP_CODE`, `PROJECT_ID`, `PRODUCT_ID`) USING BTREE,
  283. INDEX `NK_PROJECT_PRODUCT_ID`(`PRODUCT_ID`) USING BTREE
  284. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '产品项目签约信息' ROW_FORMAT = Dynamic;
  285. -- ----------------------------
  286. -- Table structure for saas_role
  287. -- ----------------------------
  288. DROP TABLE IF EXISTS `saas_role`;
  289. CREATE TABLE `saas_role` (
  290. `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  291. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  292. `ROLE_CODE` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  293. `ROLE_NAME` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  294. `ROLE_TYPE` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色类型',
  295. `CREATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  296. `UPDATE_TIME` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间',
  297. `UPDATE_USER` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '最后一次操作者ID',
  298. `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  299. `VALID` tinyint(4) NULL DEFAULT 1 COMMENT '0-不可用,1-可用',
  300. PRIMARY KEY (`ID`) USING BTREE,
  301. INDEX `NK_ROLE_GROUP_ROLE_TYPE`(`VALID`, `GROUP_CODE`, `ROLE_TYPE`) USING BTREE
  302. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息' ROW_FORMAT = Dynamic;
  303. -- ----------------------------
  304. -- Table structure for saas_role_menu
  305. -- ----------------------------
  306. DROP TABLE IF EXISTS `saas_role_menu`;
  307. CREATE TABLE `saas_role_menu` (
  308. `GROUP_CODE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  309. `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID',
  310. `MENU_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单ID',
  311. `PAGE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '页面ID',
  312. `FUNCTION_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '功能ID',
  313. INDEX `UK_ROLE_MENU_GROUP_PAGE`(`GROUP_CODE`, `ROLE_ID`, `MENU_ID`, `PAGE_ID`, `FUNCTION_ID`) USING BTREE
  314. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色-菜单功能关联信息' ROW_FORMAT = Dynamic;
  315. SET FOREIGN_KEY_CHECKS = 1;
  316. DELETE FROM `saas_account` WHERE ID = 'AC1372371635352403969';
  317. INSERT INTO `saas_account`(`ID`, `GROUP_CODE`, `TERMINAL`, `USERNAME`, `PASSWORD`, `PHONE_NUM`, `MAIL`, `HEAD_PORTRAIT`, `ACCOUNT_TYPE`, `ACCOUNT_BELONG`, `ACCOUNT_SOURCE`, `LAST_LOGIN_TIME`, `LAST_LOGIN_IP`, `VALID_START_TIME`, `VALID_END_TIME`, `CREATE_TIME`, `UPDATE_TIME`, `UPDATE_USER`, `REMARK`, `VALID`, `VALID_LAST`, `LOGIN_FAIL`)
  318. VALUES ('AC1372371635352403969', NULL, '[\"PC\"]', 'PERSAGYADMIN', '1608B9B21D2794DA3DDFECF1772DA529', NULL, NULL, NULL, '0', '0', NULL, NOW(), NOW(), NOW(), NOW(), NOW(), NOW(), 'AC1372371635352403969', NULL, 1, '1', 0);