123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- CREATE DATABASE IF NOT EXISTS `saas_platform` DEFAULT CHARACTER SET = utf8mb4;
- Use `saas_platform`;
- SET NAMES utf8mb4;
- SET FOREIGN_KEY_CHECKS = 0;
- -- ----------------------------
- -- Table structure for saas_account
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_account`;
- CREATE TABLE `saas_account` (
- `ID` varchar(64) NOT NULL,
- `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
- `TERMINAL` varchar(100) DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
- `USERNAME` varchar(50) DEFAULT NULL COMMENT '登录用户名,集团下唯一,业务保证',
- `PASSWORD` varchar(128) DEFAULT NULL COMMENT '登录密码',
- `PHONE_NUM` varchar(20) DEFAULT NULL COMMENT '手机号',
- `MAIL` varchar(50) DEFAULT NULL COMMENT '邮箱',
- `HEAD_PORTRAIT` varchar(500) DEFAULT NULL COMMENT '头像,图片URL',
- `ACCOUNT_TYPE` varchar(1) DEFAULT '2' COMMENT '账号类型, 0-超级管理员(所有集团),1-单集团管理员(单集团),2-普通账号',
- `ACCOUNT_BELONG` varchar(1) DEFAULT NULL COMMENT '账号所属, 0-运维系统账号,1-业务账号',
- `ACCOUNT_SOURCE` varchar(20) DEFAULT 'persagy' COMMENT '账号来源, persagy-博锐',
- `LAST_LOGIN_TIME` timestamp NULL DEFAULT NULL COMMENT '账号上一次登录时间',
- `LAST_LOGIN_IP` varchar(100) DEFAULT NULL COMMENT '账号上一次登录IP',
- `VALID_START_TIME` timestamp NULL DEFAULT NULL COMMENT '账号有效期的开始时间',
- `VALID_END_TIME` timestamp NULL DEFAULT NULL COMMENT '账号有效期的结束时间',
- `VALID_LAST` varchar(1) DEFAULT '1' COMMENT '账号有效期,0-期内有效,1-永久有效',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- `VALID` tinyint(4) DEFAULT '1' COMMENT '0-不可用,1-可用',
- PRIMARY KEY (`ID`),
- KEY `NK_ACCOUNT_GROUP_APP` (`GROUP_CODE`,`APP_ID`),
- KEY `NK_ACCOUNT_VALID_NAME` (`VALID`,`USERNAME`),
- KEY `NK_ACCOUNT_UPDATE_TIME` (`UPDATE_TIME`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_group
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_group`;
- CREATE TABLE `saas_group` (
- `GROUP_CODE` varchar(20) NOT NULL COMMENT '集团编码',
- `GROUP_NAME` varchar(50) DEFAULT NULL COMMENT '集团名称,业务保证唯一性',
- `GROUP_ICON` varchar(100) DEFAULT NULL COMMENT '集团图标',
- `GROUP_DESC` varchar(100) DEFAULT NULL COMMENT '集团描述',
- `DEPLOY_MODEL` varchar(1) DEFAULT NULL COMMENT '集团部署方式,0-公有云,1-私有云',
- `SYNC_STATE` varchar(1) DEFAULT '2' COMMENT '数据同步状态,0-数据同步失败,1-数据同步成功,2-未同步',
- `SYNC_TIME` timestamp NULL DEFAULT NULL COMMENT '上次数据同步时间',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- `VALID` tinyint(4) DEFAULT '1' COMMENT '0-不可用,1-可用',
- PRIMARY KEY (`GROUP_CODE`),
- KEY `NK_GROUP_VALID_NAME` (`VALID`,`GROUP_NAME`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '集团信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_project
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_project`;
- CREATE TABLE `saas_project` (
- `ID` varchar(64) NOT NULL,
- `GROUP_CODE` varchar(20) NOT NULL COMMENT '集团编码',
- `PROJECT_ID` varchar(25) NOT NULL COMMENT '项目ID,集团下唯一,业务保证',
- `AREA_ID` varchar(64) NOT NULL COMMENT '项目所属区域,必须为最底层的区域',
- `PROJECT_LOCAL_ID` varchar(20) DEFAULT NULL COMMENT '项目本地编码,集团下唯一,业务保证',
- `PROJECT_NAME` varchar(50) DEFAULT NULL COMMENT '项目名称,集团下唯一,业务保证',
- `PROVINCE_CODE` varchar(30) DEFAULT NULL COMMENT '项目所在省',
- `CITY_CODE` varchar(30) DEFAULT NULL COMMENT '项目所在市',
- `ZONE_CODE` varchar(30) DEFAULT NULL COMMENT '项目所在区',
- `LOCATION` varchar(500) DEFAULT NULL COMMENT '项目详细地址',
- `OPEN_TIME` timestamp NULL DEFAULT NULL COMMENT '项目开业时间',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- `VALID` tinyint(4) DEFAULT '1' COMMENT '0-不可用,1-可用',
- PRIMARY KEY (`ID`),
- KEY `NK_PROJECT_GROUP_PROJECT` (`VALID`,`GROUP_CODE`,`PROJECT_ID`) USING BTREE,
- KEY `NK_PROJECT_AREA_ID` (`AREA_ID`) USING BTREE,
- KEY `NK_PROJECT_PROJECT_NAME` (`PROJECT_NAME`) USING BTREE
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_area
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_area`;
- CREATE TABLE `saas_area` (
- `ID` varchar(64) NOT NULL,
- `GROUP_CODE` varchar(20) NOT NULL COMMENT '集团编码',
- `PARENT_ID` varchar(64) DEFAULT NULL COMMENT '上级区域ID',
- `AREA_CODE` varchar(50) DEFAULT NULL COMMENT '区域编码',
- `AREA_NAME` varchar(50) DEFAULT NULL COMMENT '区域名称',
- `AREA_TYPE` varchar(20) DEFAULT NULL COMMENT '区域类型,0-非最底层区域,1-最底层区域',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- PRIMARY KEY (`ID`),
- KEY `NK_AREA_GROUP_CODE` (`GROUP_CODE`, `AREA_CODE`),
- KEY `NK_AREA_AREA_CODE` (`AREA_TYPE`),
- KEY `NK_AREA_PARENT_ID` (`PARENT_ID`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '区域信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_account_project
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_account_project`;
- CREATE TABLE `saas_account_project` (
- `ACCOUNT_ID` varchar(64) NOT NULL COMMENT '账号ID',
- `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
- `AREA_ID` varchar(64) DEFAULT NULL COMMENT '区域ID',
- `PROJECT_ID` varchar(25) DEFAULT NULL COMMENT '项目ID',
- UNIQUE KEY `UK_ACCOUNT_PROJECT_GROUP` (`ACCOUNT_ID`,`GROUP_CODE`,`PROJECT_ID`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号-集团项目关联信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_account_role
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_account_role`;
- CREATE TABLE `saas_account_role` (
- `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
- `ACCOUNT_ID` varchar(64) NOT NULL COMMENT '账号ID',
- `ROLE_ID` varchar(64) NOT NULL COMMENT '角色ID',
- `CAS_TYPE` varchar(1) DEFAULT NULL COMMENT '关联类型,0-主岗,1-副岗,2-业务超管默认角色',
- UNIQUE KEY `UK_ACCOUNT_ACCOUNT_ROLE` (`ACCOUNT_ID`,`GROUP_CODE`,`ROLE_ID`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '账号-角色关联信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_role
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_role`;
- CREATE TABLE `saas_role` (
- `ID` varchar(64) NOT NULL,
- `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
- `ROLE_CODE` varchar(50) DEFAULT NULL COMMENT '角色编码',
- `ROLE_NAME` varchar(100) DEFAULT NULL COMMENT '角色名称',
- `ROLE_TYPE` varchar(1) DEFAULT '0' COMMENT '角色类型,0-系统角色,1-业务角色, 2-业务超管默认角色',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- `VALID` tinyint(4) DEFAULT '1' COMMENT '0-不可用,1-可用',
- PRIMARY KEY (`ID`),
- KEY `NK_ROLE_GROUP_ROLE_TYPE` (`VALID`, `GROUP_CODE`, `ROLE_TYPE`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_menu
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_menu`;
- CREATE TABLE `saas_menu` (
- `ID` varchar(64) NOT NULL,
- `PARENT_ID` varchar(64) DEFAULT NULL COMMENT '上级菜单ID',
- `APP_ID` varchar(64) DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
- `MENU_CODE` varchar(50) DEFAULT NULL COMMENT '菜单编码',
- `MENU_NAME` varchar(50) DEFAULT NULL COMMENT '菜单名称',
- `MENU_URL` varchar(500) DEFAULT NULL COMMENT '菜单URL',
- `URL_TYPE` varchar(1) DEFAULT NULL COMMENT 'URL类型,0-相对路径,1-绝对路径',
- `MENU_ICON` varchar(100) DEFAULT NULL COMMENT '菜单图标',
- `MENU_SORT` int(11) DEFAULT NULL COMMENT '菜单顺序',
- `MENU_TYPE` varchar(1) DEFAULT NULL COMMENT '菜单类型,0-系统菜单,1-标准业务菜单,2-IBMS菜单,3-APP菜单',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- PRIMARY KEY (`ID`),
- KEY `NK_MENU_MENU_CODE` (`MENU_CODE`),
- KEY `NK_MENU_PARENT_ID` (`PARENT_ID`),
- KEY `NK_MENU_APP_ID` (`APP_ID`),
- KEY `NK_MENU_MENU_SORT` (`MENU_SORT`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '菜单信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_function
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_function`;
- CREATE TABLE `saas_function` (
- `ID` varchar(64) NOT NULL,
- `MENU_ID` varchar(64) NOT NULL COMMENT '菜单ID',
- `FUN_CODE` varchar(50) DEFAULT NULL COMMENT '功能编码',
- `FUN_NAME` varchar(50) DEFAULT NULL COMMENT '功能名称',
- `FUN_URL` varchar(500) DEFAULT NULL COMMENT '功能URL',
- `FUN_SORT` int(11) DEFAULT NULL COMMENT '功能顺序',
- `CREATE_TIME` timestamp NULL DEFAULT NULL COMMENT '创建时间',
- `UPDATE_TIME` timestamp NULL DEFAULT NULL COMMENT '更新时间',
- `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '最后一次操作者ID',
- `REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
- PRIMARY KEY (`ID`),
- KEY `NK_FUN_MENU_ID` (`MENU_ID`),
- KEY `NK_FUN_FUN_CODE` (`FUN_CODE`),
- KEY `NK_FUN_FUN_SORT` (`FUN_SORT`)
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '功能信息' ROW_FORMAT = Dynamic;
- -- ----------------------------
- -- Table structure for saas_role_menu
- -- ----------------------------
- DROP TABLE IF EXISTS `saas_role_menu`;
- CREATE TABLE `saas_role_menu` (
- `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
- `ROLE_ID` varchar(64) NOT NULL COMMENT '角色ID',
- `MENU_ID` varchar(64) NOT NULL COMMENT '菜单ID',
- `FUNCTION_ID` varchar(64) DEFAULT NULL COMMENT '功能ID',
- UNIQUE KEY `UK_FOLE_MENU_GROUP` (`GROUP_CODE`,`ROLE_ID`,`MENU_ID`,`FUNCTION_ID`) USING BTREE
- ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色-菜单功能关联信息' ROW_FORMAT = Dynamic;
- SET FOREIGN_KEY_CHECKS = 1;
|