
CREATE DATABASE IF NOT EXISTS `xgl_cases` DEFAULT CHARACTER SET utf8mb4;

USE `xgl_cases`;




/*Table structure for table `permission` */
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `permission_id` varchar(20) NOT NULL COMMENT '权限id',
    `name` varchar(100) NOT NULL COMMENT '权限名称',
    `description` varchar(255) DEFAULT NULL COMMENT '权限描述',
    `url` varchar(255) DEFAULT NULL COMMENT '权限访问路径',
    `perms` varchar(255) DEFAULT NULL COMMENT '权限标识',
    `parent_id` int(11) DEFAULT NULL COMMENT '父级权限id',
    `type` int(1) DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
    `order_num` int(3) DEFAULT '0' COMMENT '排序',
    `icon` varchar(50) DEFAULT NULL COMMENT '图标',
    `status` int(1) NOT NULL COMMENT '状态：1有效；2删除',
    `create_time` datetime DEFAULT NULL,
    `update_time` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;

/*Data for the table `permission` */
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (1,'1','工作台','工作台','/workdest','workdest',0,1,1,'fa fa-home',1,'2017-09-27 21:22:02','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (2,'2','权限管理','权限管理','',NULL,0,0,2,'fa fa-th-list',1,'2017-07-13 15:04:42','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (3,'201','用户管理','用户管理','/users','users',2,1,1,'fa fa-circle-o',1,'2017-07-13 15:05:47','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (4,'20101','列表查询','用户列表查询','/user/list','user:list',3,2,0,NULL,1,'2017-07-13 15:09:24','2017-10-09 05:38:29');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (5,'20102','新增','新增用户','/user/add','user:add',3,2,0,NULL,1,'2017-07-13 15:06:50','2018-02-28 17:58:46');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (6,'20103','编辑','编辑用户','/user/edit','user:edit',3,2,0,NULL,1,'2017-07-13 15:08:03','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (7,'20104','删除','删除用户','/user/delete','user:delete',3,2,0,NULL,1,'2017-07-13 15:08:42','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (8,'20105','批量删除','批量删除用户','/user/batch/delete','user:batchDelete',3,2,0,'',1,'2018-07-11 01:53:09','2018-07-11 01:53:09');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (9,'20106','分配角色','分配角色','/user/assign/role','user:assignRole',3,2,0,NULL,1,'2017-07-13 15:09:24','2017-10-09 05:38:29');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (10,'202','角色管理','角色管理','/roles','roles',2,1,2,'fa fa-circle-o',1,'2017-07-17 14:39:09','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (11,'20201','列表查询','角色列表查询','/role/list','role:list',10,2,0,NULL,1,'2017-10-10 15:31:36','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (12,'20202','新增','新增角色','/role/add','role:add',10,2,0,NULL,1,'2017-07-17 14:39:46','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (13,'20203','编辑','编辑角色','/role/edit','role:edit',10,2,0,NULL,1,'2017-07-17 14:40:15','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (14,'20204','删除','删除角色','/role/delete','role:delete',10,2,0,NULL,1,'2017-07-17 14:40:57','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (15,'20205','批量删除','批量删除角色','/role/batch/delete','role:batchDelete',10,2,0,'',1,'2018-07-10 22:20:43','2018-07-10 22:20:43');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (16,'20206','分配权限','分配权限','/role/assign/permission','role:assignPerms',10,2,0,NULL,1,'2017-09-26 07:33:05','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (17,'203','资源管理','资源管理','/permissions','permissions',2,1,3,'fa fa-circle-o',1,'2017-09-26 07:33:51','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (18,'20301','列表查询','资源列表','/permission/list','permission:list',17,2,0,NULL,1,'2018-07-12 16:25:28','2018-07-12 16:25:33');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (19,'20302','新增','新增资源','/permission/add','permission:add',17,2,0,NULL,1,'2017-09-26 08:06:58','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (20,'20303','编辑','编辑资源','/permission/edit','permission:edit',17,2,0,NULL,1,'2017-09-27 21:29:04','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (21,'20304','删除','删除资源','/permission/delete','permission:delete',17,2,0,NULL,1,'2017-09-27 21:29:50','2018-02-27 10:53:14');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (22,'3','运维管理','运维管理','',NULL,0,0,3,'fa fa-th-list',1,'2018-07-06 15:19:26','2018-07-06 15:19:26');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (23,'301','数据监控','数据监控','/database/monitoring','database',22,1,1,'fa fa-circle-o',1,'2018-07-06 15:19:55','2018-09-12 13:14:48');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (24,'4','系统工具','系统工具','',NULL,0,0,4,'fa fa-th-list',1,'2018-07-06 15:20:38','2018-07-06 15:20:38');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (25,'401','图标工具','图标工具','/icons','icons',24,1,1,'fa fa-circle-o',1,'2018-07-06 15:21:00','2018-07-06 15:21:00');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (28,'5','在线用户','在线用户','/online/users','onlineUsers',2,1,4,'fa fa-circle-o',1,'2018-07-18 21:00:38','2018-07-19 12:47:42');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (29,'501','在线用户查询','在线用户查询','/online/user/list','onlineUser:list',28,2,0,NULL,1,'2018-07-18 21:01:25','2018-07-19 12:48:04');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (30,'502','踢出用户','踢出用户','/online/user/kickout','onlineUser:kickout',28,2,0,NULL,1,'2018-07-18 21:41:54','2018-07-19 12:48:25');
insert  into `permission`(`id`,`permission_id`,`name`,`description`,`url`,`perms`,`parent_id`,`type`,`order_num`,`icon`,`status`,`create_time`,`update_time`) values (31,'503','批量踢出','批量踢出','/online/user/batch/kickout','onlineUser:batchKickout',28,2,0,'',1,'2018-07-19 12:49:30','2018-07-19 12:49:30');




/*Table structure for table `role` */
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `role_id` varchar(20) NOT NULL COMMENT '角色id',
    `name` varchar(50) NOT NULL COMMENT '角色名称',
    `description` varchar(255) DEFAULT NULL COMMENT '角色描述',
    `status` int(1) NOT NULL COMMENT '状态：1有效；2删除',
    `create_time` datetime DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;

/*Data for the table `role` */
insert  into `role`(`id`,`role_id`,`name`,`description`,`status`,`create_time`,`update_time`) values (1,'1','超级管理员','超级管理员',1,'2017-06-28 20:30:05','2017-06-28 20:30:10');
insert  into `role`(`id`,`role_id`,`name`,`description`,`status`,`create_time`,`update_time`) values (2,'2','管理员','管理员',1,'2017-06-30 23:35:19','2017-10-11 09:32:33');
insert  into `role`(`id`,`role_id`,`name`,`description`,`status`,`create_time`,`update_time`) values (3,'3','普通用户','普通用户',1,'2017-06-30 23:35:44','2018-07-13 11:44:06');




/*Table structure for table `role_permission` */
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `role_id` varchar(20) NOT NULL COMMENT '角色id',
    `permission_id` varchar(20) NOT NULL COMMENT '权限id',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;

/*Data for the table `role_permission` */
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (1,'1','1');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (2,'1','2');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (3,'1','201');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (4,'1','20101');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (5,'1','20102');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (6,'1','20103');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (7,'1','20104');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (8,'1','20105');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (9,'1','20106');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (10,'1','202');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (11,'1','20201');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (12,'1','20202');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (13,'1','20203');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (14,'1','20204');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (15,'1','20205');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (16,'1','20206');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (17,'1','203');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (18,'1','20301');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (19,'1','20302');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (20,'1','20303');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (21,'1','20304');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (22,'1','5');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (23,'1','501');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (24,'1','502');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (25,'1','503');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (26,'1','3');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (27,'1','301');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (28,'1','4');
insert  into `role_permission`(`id`,`role_id`,`permission_id`) values (29,'1','401');




/*Table structure for table `user` */
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` varchar(20) NOT NULL COMMENT '用户id',
    `username` varchar(50) NOT NULL COMMENT '用户名',
    `password` varchar(50) NOT NULL,
    `salt` varchar(128) DEFAULT NULL COMMENT '加密盐值',
    `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
    `phone` varchar(50) DEFAULT NULL COMMENT '联系方式',
    `sex` int(255) DEFAULT NULL COMMENT '年龄：1男2女',
    `age` int(3) DEFAULT NULL COMMENT '年龄',
    `status` int(1) NOT NULL COMMENT '用户状态：1有效; 2删除',
    `create_time` datetime DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime DEFAULT NULL COMMENT '更新时间',
    `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
    PRIMARY KEY (`id`,`user_id`)
) ENGINE=InnoDB;

/*Data for the table `user` */
insert  into `user`(`id`,`user_id`,`username`,`password`,`salt`,`status`,`create_time`,`update_time`)
values (1,'1','admin','64b4f7f481befa153d4be6273a5a9743','8ec2761c3ec31c4100884553abf1221b',1,'2019-12-01 12:00:00','2019-12-01 12:00:00');




/*Table structure for table `user_role` */
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` varchar(20) NOT NULL COMMENT '用户id',
    `role_id` varchar(20) NOT NULL COMMENT '角色id',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;

/*Data for the table `user_role` */
insert  into `user_role`(`id`,`user_id`,`role_id`) values (1,'1','1');





-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log`  (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID, 主键,自增',
  `createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `type` int(10) NOT NULL COMMENT '日志类型(1：系统管理；2：登录日志；3：字典管理；4：案例管理)',
  `operator` varchar(100) DEFAULT NULL COMMENT '操作者',
  `ipaddr` varchar(150) DEFAULT NULL COMMENT 'IP地址',
  `description` varchar(255) NOT NULL COMMENT '描述',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB COMMENT='系统日志表';






