|
|
@ -1,119 +0,0 @@ |
|
|
|
/* |
|
|
|
Date: 22/04/2020 12:13:38 |
|
|
|
*/ |
|
|
|
|
|
|
|
-- SET NAMES utf8mb4; |
|
|
|
-- #SET FOREIGN_KEY_CHECKS = 0; |
|
|
|
|
|
|
|
CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; |
|
|
|
|
|
|
|
-- DROP TABLE IF EXISTS `permission_scope`; |
|
|
|
CREATE TABLE `operation_scope` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', |
|
|
|
`SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', |
|
|
|
`SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', |
|
|
|
`SCOPE_INDEX` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围序号', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', |
|
|
|
PRIMARY KEY (`ID`) USING BTREE |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限范围表' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
-- ---------------------------- |
|
|
|
-- Table structure for resource_ope |
|
|
|
-- ---------------------------- |
|
|
|
-- DROP TABLE IF EXISTS `operation`; |
|
|
|
CREATE TABLE `operation` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
|
|
|
`OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
|
|
|
`OPERATION_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作简介', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL, |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL, |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
PRIMARY KEY (`ID`) USING BTREE |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作类型表' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
-- ---------------------------- |
|
|
|
-- Table structure for role_operation |
|
|
|
-- ---------------------------- |
|
|
|
-- DROP TABLE IF EXISTS `role_operation`; |
|
|
|
CREATE TABLE `role_operation` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
|
|
|
`ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', |
|
|
|
`OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作key', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', |
|
|
|
PRIMARY KEY (`ID`) USING BTREE |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能进行那些操作' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
-- ---------------------------- |
|
|
|
-- Table structure for role_scope |
|
|
|
-- ---------------------------- |
|
|
|
-- DROP TABLE IF EXISTS `role_scope`; |
|
|
|
CREATE TABLE `role_scope` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
|
|
|
`ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', |
|
|
|
`OPERATION_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作Key', |
|
|
|
`SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', |
|
|
|
PRIMARY KEY (`ID`) USING BTREE |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
-- SET FOREIGN_KEY_CHECKS = 1; |
|
|
|
|
|
|
|
-- 2020.04.29 wxz |
|
|
|
CREATE TABLE `access_setting` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', |
|
|
|
`ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色ID', |
|
|
|
`OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作key', |
|
|
|
`SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', |
|
|
|
`SETTING_VALUE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL, |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL, |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
PRIMARY KEY (`ID`) USING BTREE, |
|
|
|
UNIQUE INDEX `uni_access_setting_role_key_opt`(`ROLE_ID`, `OPERATION_KEY`, `SETTING_KEY`) USING BTREE |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE `access_setting_options` ( |
|
|
|
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', |
|
|
|
`SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', |
|
|
|
`SETTING_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置name', |
|
|
|
`BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简介', |
|
|
|
`DEL_FLAG` tinyint(1) NULL DEFAULT NULL, |
|
|
|
`REVISION` int(10) NULL DEFAULT NULL, |
|
|
|
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`CREATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, |
|
|
|
`UPDATED_TIME` datetime(0) NULL DEFAULT NULL, |
|
|
|
PRIMARY KEY (`ID`) USING BTREE, |
|
|
|
UNIQUE INDEX `uni_access_setting_opts`(`SETTING_KEY`) USING BTREE COMMENT '配置KEY不能重复' |
|
|
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置选项' ROW_FORMAT = Dynamic; |
|
|
|
|
|
|
|
-- ---------------------------- |
|
|
|
-- Records of access_setting_options |
|
|
|
-- ---------------------------- |
|
|
|
INSERT INTO `access_setting_options` VALUES ('1', 'I_CREATED', '我发起的', '我发起的条件过滤。ON为开启,OFF为关闭', 0, 0, NULL, NULL, NULL, NULL); |
|
|
|
INSERT INTO `access_setting_options` VALUES ('2', 'I_PART', '我参与的', '我参与的条件过滤', 0, 0, NULL, NULL, NULL, NULL); |
|
|
|
INSERT INTO `access_setting_options` VALUES ('3', 'IN_GRID', '网格内', '网格内', 0, 0, NULL, NULL, NULL, NULL); |
|
|
|
INSERT INTO `access_setting_options` VALUES ('4', 'IN_DEPARTMENT', '部门内', '部门内', 0, 0, NULL, NULL, NULL, NULL); |