--
-- Table structure for table `sys_role`
--
CREATE TABLE IF NOT EXISTS `sys_role` (
  `role_id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称',
  `role_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色键值',
  `role_sort` int NULL DEFAULT 0 COMMENT '显示顺序',
  `data_scope` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '5' COMMENT '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限 5：仅本人数据权限）',
  `menu_check_strictly` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '菜单树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示）',
  `dept_check_strictly` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '部门树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示 ）',
  `status_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '角色状态（0停用 1正常）',
  `del_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标记（0存在 1删除）',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` bigint NULL DEFAULT 0 COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` bigint NULL DEFAULT 0 COMMENT '更新时间',
  `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统_角色信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- COLUMN for sys_user
-- ----------------------------
ALTER TABLE `sys_role` DROP COLUMN `status`;
ALTER TABLE `sys_role` MODIFY COLUMN `role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称' AFTER `role_id`;
ALTER TABLE `sys_role` MODIFY COLUMN `role_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色键值' AFTER `role_name`;
ALTER TABLE `sys_role` MODIFY COLUMN `data_scope` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '5' COMMENT '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限 5：仅本人数据权限）' AFTER `role_sort`;
ALTER TABLE `sys_role` MODIFY COLUMN `menu_check_strictly` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '菜单树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示）' AFTER `data_scope`;
ALTER TABLE `sys_role` MODIFY COLUMN `dept_check_strictly` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '部门树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示 ）' AFTER `menu_check_strictly`;
ALTER TABLE `sys_role` ADD COLUMN `status_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '角色状态（0停用 1正常）' AFTER `dept_check_strictly`;
ALTER TABLE `sys_role` MODIFY COLUMN `del_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标记（0存在 1删除）' AFTER `status_flag`;
ALTER TABLE `sys_role` MODIFY COLUMN `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者' AFTER `del_flag`;
ALTER TABLE `sys_role` MODIFY COLUMN `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者' AFTER `create_time`;
ALTER TABLE `sys_role` MODIFY COLUMN `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注' AFTER `update_time`;
ALTER TABLE `sys_role` COMMENT = '系统_角色信息表';

-- ----------------------------
-- Data for sys_user
-- ----------------------------
INSERT IGNORE INTO `sys_role` VALUES (1, 'role.system', 'system', 1, '1', '1', '1', '1', '0', 'system', 1697091437683, 'system', 1697091437683, 'role.systemRemark');
INSERT IGNORE INTO `sys_role` VALUES (2, 'role.admin', 'admin', 2, '1', '1', '1', '1', '0', 'system', 1697091437683, 'system', 1697091437683, 'role.adminRemark');
INSERT IGNORE INTO `sys_role` VALUES (3, 'role.operator', 'operator', 3, '1', '1', '1', '1', '0', 'system', 1697091437683, 'system', 1697091437683, 'role.operatorRemark');
INSERT IGNORE INTO `sys_role` VALUES (4, 'role.monitor', 'monitor', 4, '1', '1', '1', '1', '0', 'system', 1697091437683, 'system', 1697091437683, 'role.monitorRemark');
INSERT IGNORE INTO `sys_role` VALUES (5, 'role.vistor', 'vistor', 5, '1', '1', '1', '1', '0', 'system', 1697091437683, 'system', 1697091437683, 'role.vistorRemark');
UPDATE `sys_role` SET `status_flag` = '1' WHERE `role_id` in (1,2,3,4,5);

-- Dump completed on 2025-02-14 15:26:56
