text: use gulimall_admin;
  -- 菜单
  CREATE TABLE `sys_menu` (
                              `menu_id` bigint NOT NULL AUTO_INCREMENT,
                              `parent_id` bigint COMMENT '父菜单ID，一级菜单为0',
                              `name` varchar(50) COMMENT '菜单名称',
                              `url` varchar(200) COMMENT '菜单URL',
                              `perms` varchar(500) COMMENT '授权(多个用逗号分隔，如：user:list,user:create)',
                              `type` int COMMENT '类型   0：目录   1：菜单   2：按钮',
                              `icon` varchar(50) COMMENT '菜单图标',
                              `order_num` int COMMENT '排序',
                              PRIMARY KEY (`menu_id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='菜单管理';
  
  -- 系统用户
  CREATE TABLE `sys_user` (
                              `user_id` bigint NOT NULL AUTO_INCREMENT,
                              `username` varchar(50) NOT NULL COMMENT '用户名',
                              `password` varchar(100) COMMENT '密码',
                              `salt` varchar(20) COMMENT '盐',
                              `email` varchar(100) COMMENT '邮箱',
                              `mobile` varchar(100) COMMENT '手机号',
                              `status` tinyint COMMENT '状态  0：禁用   1：正常',
                              `create_user_id` bigint(20) COMMENT '创建者ID',
                              `create_time` datetime COMMENT '创建时间',
                              PRIMARY KEY (`user_id`),
                              UNIQUE INDEX (`username`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户';
  
  -- 系统用户Token
  CREATE TABLE `sys_user_token` (
                                    `user_id` bigint(20) NOT NULL,
                                    `token` varchar(100) NOT NULL COMMENT 'token',
                                    `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
                                    `update_time` datetime DEFAULT NULL COMMENT '更新时间',
                                    PRIMARY KEY (`user_id`),
                                    UNIQUE KEY `token` (`token`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户Token';
  
  -- 系统验证码
  CREATE TABLE `sys_captcha` (
                                 `uuid` char(36) NOT NULL COMMENT 'uuid',
                                 `code` varchar(6) NOT NULL COMMENT '验证码',
                                 `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
                                 PRIMARY KEY (`uuid`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统验证码';
  
  -- 角色
  CREATE TABLE `sys_role` (
                              `role_id` bigint NOT NULL AUTO_INCREMENT,
                              `role_name` varchar(100) COMMENT '角色名称',
                              `remark` varchar(100) COMMENT '备注',
                              `create_user_id` bigint(20) COMMENT '创建者ID',
                              `create_time` datetime COMMENT '创建时间',
                              PRIMARY KEY (`role_id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色';
  
  -- 用户与角色对应关系
  CREATE TABLE `sys_user_role` (
                                   `id` bigint NOT NULL AUTO_INCREMENT,
                                   `user_id` bigint COMMENT '用户ID',
                                   `role_id` bigint COMMENT '角色ID',
                                   PRIMARY KEY (`id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户与角色对应关系';
  
  -- 角色与菜单对应关系
  CREATE TABLE `sys_role_menu` (
                                   `id` bigint NOT NULL AUTO_INCREMENT,
                                   `role_id` bigint COMMENT '角色ID',
                                   `menu_id` bigint COMMENT '菜单ID',
                                   PRIMARY KEY (`id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色与菜单对应关系';
  
  -- 系统配置信息
  CREATE TABLE `sys_config` (
                                `id` bigint NOT NULL AUTO_INCREMENT,
                                `param_key` varchar(50) COMMENT 'key',
                                `param_value` varchar(2000) COMMENT 'value',
                                `status` tinyint DEFAULT 1 COMMENT '状态   0：隐藏   1：显示',
                                `remark` varchar(500) COMMENT '备注',
                                PRIMARY KEY (`id`),
                                UNIQUE INDEX (`param_key`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统配置信息表';
  
  
  -- 系统日志
  CREATE TABLE `sys_log` (
                             `id` bigint(20) NOT NULL AUTO_INCREMENT,
                             `username` varchar(50) COMMENT '用户名',
                             `operation` varchar(50) COMMENT '用户操作',
                             `method` varchar(200) COMMENT '请求方法',
                             `params` varchar(5000) COMMENT '请求参数',
                             `time` bigint NOT NULL COMMENT '执行时长(毫秒)',
                             `ip` varchar(64) COMMENT 'IP地址',
                             `create_date` datetime COMMENT '创建时间',
                             PRIMARY KEY (`id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统日志';
  
  
  -- 文件上传
  CREATE TABLE `sys_oss` (
                             `id` bigint(20) NOT NULL AUTO_INCREMENT,
                             `url` varchar(200) COMMENT 'URL地址',
                             `create_date` datetime COMMENT '创建时间',
                             PRIMARY KEY (`id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='文件上传';
  
  
  -- 定时任务
  CREATE TABLE `schedule_job` (
                                  `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
                                  `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
                                  `params` varchar(2000) DEFAULT NULL COMMENT '参数',
                                  `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式',
                                  `status` tinyint(4) DEFAULT NULL COMMENT '任务状态  0：正常  1：暂停',
                                  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
                                  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                                  PRIMARY KEY (`job_id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务';
  
  -- 定时任务日志
  CREATE TABLE `schedule_job_log` (
                                      `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
                                      `job_id` bigint(20) NOT NULL COMMENT '任务id',
                                      `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
                                      `params` varchar(2000) DEFAULT NULL COMMENT '参数',
                                      `status` tinyint(4) NOT NULL COMMENT '任务状态    0：成功    1：失败',
                                      `error` varchar(2000) DEFAULT NULL COMMENT '失败信息',
                                      `times` int(11) NOT NULL COMMENT '耗时(单位：毫秒)',
                                      `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                                      PRIMARY KEY (`log_id`),
                                      KEY `job_id` (`job_id`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务日志';
  
  
  
  -- 用户表
  CREATE TABLE `tb_user` (
                             `user_id` bigint NOT NULL AUTO_INCREMENT,
                             `username` varchar(50) NOT NULL COMMENT '用户名',
                             `mobile` varchar(20) NOT NULL COMMENT '手机号',
                             `password` varchar(64) COMMENT '密码',
                             `create_time` datetime COMMENT '创建时间',
                             PRIMARY KEY (`user_id`),
                             UNIQUE INDEX (`username`)
  ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户';
  
  
  
  
  
  
  -- 初始数据
  INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `email`, `mobile`, `status`, `create_user_id`, `create_time`) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11');
  
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7);
  INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6);
  
  INSERT INTO `sys_config` (`param_key`, `param_value`, `status`, `remark`) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', '0', '云存储配置信息');
  INSERT INTO `schedule_job` (`bean_name`, `params`, `cron_expression`, `status`, `remark`, `create_time`) VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', now());
  
  
  -- 账号：13612345678  密码：admin
  INSERT INTO `tb_user` (`username`, `mobile`, `password`, `create_time`) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');
  
  
  
  
  
  
  
  
  --  quartz自带表结构
  CREATE TABLE QRTZ_JOB_DETAILS(
                                   SCHED_NAME VARCHAR(120) NOT NULL,
                                   JOB_NAME VARCHAR(200) NOT NULL,
                                   JOB_GROUP VARCHAR(200) NOT NULL,
                                   DESCRIPTION VARCHAR(250) NULL,
                                   JOB_CLASS_NAME VARCHAR(250) NOT NULL,
                                   IS_DURABLE VARCHAR(1) NOT NULL,
                                   IS_NONCONCURRENT VARCHAR(1) NOT NULL,
                                   IS_UPDATE_DATA VARCHAR(1) NOT NULL,
                                   REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
                                   JOB_DATA BLOB NULL,
                                   PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_TRIGGERS (
                                 SCHED_NAME VARCHAR(120) NOT NULL,
                                 TRIGGER_NAME VARCHAR(200) NOT NULL,
                                 TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                 JOB_NAME VARCHAR(200) NOT NULL,
                                 JOB_GROUP VARCHAR(200) NOT NULL,
                                 DESCRIPTION VARCHAR(250) NULL,
                                 NEXT_FIRE_TIME BIGINT(13) NULL,
                                 PREV_FIRE_TIME BIGINT(13) NULL,
                                 PRIORITY INTEGER NULL,
                                 TRIGGER_STATE VARCHAR(16) NOT NULL,
                                 TRIGGER_TYPE VARCHAR(8) NOT NULL,
                                 START_TIME BIGINT(13) NOT NULL,
                                 END_TIME BIGINT(13) NULL,
                                 CALENDAR_NAME VARCHAR(200) NULL,
                                 MISFIRE_INSTR SMALLINT(2) NULL,
                                 JOB_DATA BLOB NULL,
                                 PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
                                 FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
                                     REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
                                        SCHED_NAME VARCHAR(120) NOT NULL,
                                        TRIGGER_NAME VARCHAR(200) NOT NULL,
                                        TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                        REPEAT_COUNT BIGINT(7) NOT NULL,
                                        REPEAT_INTERVAL BIGINT(12) NOT NULL,
                                        TIMES_TRIGGERED BIGINT(10) NOT NULL,
                                        PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
                                        FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
                                            REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_CRON_TRIGGERS (
                                      SCHED_NAME VARCHAR(120) NOT NULL,
                                      TRIGGER_NAME VARCHAR(200) NOT NULL,
                                      TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                      CRON_EXPRESSION VARCHAR(120) NOT NULL,
                                      TIME_ZONE_ID VARCHAR(80),
                                      PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
                                      FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
                                          REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_SIMPROP_TRIGGERS
  (
      SCHED_NAME VARCHAR(120) NOT NULL,
      TRIGGER_NAME VARCHAR(200) NOT NULL,
      TRIGGER_GROUP VARCHAR(200) NOT NULL,
      STR_PROP_1 VARCHAR(512) NULL,
      STR_PROP_2 VARCHAR(512) NULL,
      STR_PROP_3 VARCHAR(512) NULL,
      INT_PROP_1 INT NULL,
      INT_PROP_2 INT NULL,
      LONG_PROP_1 BIGINT NULL,
      LONG_PROP_2 BIGINT NULL,
      DEC_PROP_1 NUMERIC(13,4) NULL,
      DEC_PROP_2 NUMERIC(13,4) NULL,
      BOOL_PROP_1 VARCHAR(1) NULL,
      BOOL_PROP_2 VARCHAR(1) NULL,
      PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
      FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
          REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_BLOB_TRIGGERS (
                                      SCHED_NAME VARCHAR(120) NOT NULL,
                                      TRIGGER_NAME VARCHAR(200) NOT NULL,
                                      TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                      BLOB_DATA BLOB NULL,
                                      PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
                                      INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
                                      FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
                                          REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_CALENDARS (
                                  SCHED_NAME VARCHAR(120) NOT NULL,
                                  CALENDAR_NAME VARCHAR(200) NOT NULL,
                                  CALENDAR BLOB NOT NULL,
                                  PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
                                            SCHED_NAME VARCHAR(120) NOT NULL,
                                            TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                            PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_FIRED_TRIGGERS (
                                       SCHED_NAME VARCHAR(120) NOT NULL,
                                       ENTRY_ID VARCHAR(95) NOT NULL,
                                       TRIGGER_NAME VARCHAR(200) NOT NULL,
                                       TRIGGER_GROUP VARCHAR(200) NOT NULL,
                                       INSTANCE_NAME VARCHAR(200) NOT NULL,
                                       FIRED_TIME BIGINT(13) NOT NULL,
                                       SCHED_TIME BIGINT(13) NOT NULL,
                                       PRIORITY INTEGER NOT NULL,
                                       STATE VARCHAR(16) NOT NULL,
                                       JOB_NAME VARCHAR(200) NULL,
                                       JOB_GROUP VARCHAR(200) NULL,
                                       IS_NONCONCURRENT VARCHAR(1) NULL,
                                       REQUESTS_RECOVERY VARCHAR(1) NULL,
                                       PRIMARY KEY (SCHED_NAME,ENTRY_ID))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_SCHEDULER_STATE (
                                        SCHED_NAME VARCHAR(120) NOT NULL,
                                        INSTANCE_NAME VARCHAR(200) NOT NULL,
                                        LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
                                        CHECKIN_INTERVAL BIGINT(13) NOT NULL,
                                        PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE QRTZ_LOCKS (
                              SCHED_NAME VARCHAR(120) NOT NULL,
                              LOCK_NAME VARCHAR(40) NOT NULL,
                              PRIMARY KEY (SCHED_NAME,LOCK_NAME))
      ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
  CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
  
  CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
  CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
  CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
  CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
  CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
  CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
  CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
  CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
  
  CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
  CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
  CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
  CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  
  
  -- 初始化sys_menu
  /*Table structure for table `sys_menu` */
  
  DROP TABLE IF EXISTS `sys_menu`;
  
  CREATE TABLE `sys_menu` (
                              `menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
                              `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID，一级菜单为0',
                              `name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
                              `url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
                              `perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔，如：user:list,user:create)',
                              `type` int(11) DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
                              `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标',
                              `order_num` int(11) DEFAULT NULL COMMENT '排序',
                              PRIMARY KEY (`menu_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb4 COMMENT='菜单管理';
  
  /*Data for the table `sys_menu` */
  
  insert  into `sys_menu`(`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`) values (1,0,'系统管理',NULL,NULL,0,'system',0),(2,1,'管理员列表','sys/user',NULL,1,'admin',1),(3,1,'角色管理','sys/role',NULL,1,'role',2),(4,1,'菜单管理','sys/menu',NULL,1,'menu',3),(5,1,'SQL监控','http://localhost:8080/renren-fast/druid/sql.html',NULL,1,'sql',4),(6,1,'定时任务','job/schedule',NULL,1,'job',5),(7,6,'查看',NULL,'sys:schedule:list,sys:schedule:info',2,NULL,0),(8,6,'新增',NULL,'sys:schedule:save',2,NULL,0),(9,6,'修改',NULL,'sys:schedule:update',2,NULL,0),(10,6,'删除',NULL,'sys:schedule:delete',2,NULL,0),(11,6,'暂停',NULL,'sys:schedule:pause',2,NULL,0),(12,6,'恢复',NULL,'sys:schedule:resume',2,NULL,0),(13,6,'立即执行',NULL,'sys:schedule:run',2,NULL,0),(14,6,'日志列表',NULL,'sys:schedule:log',2,NULL,0),(15,2,'查看',NULL,'sys:user:list,sys:user:info',2,NULL,0),(16,2,'新增',NULL,'sys:user:save,sys:role:select',2,NULL,0),(17,2,'修改',NULL,'sys:user:update,sys:role:select',2,NULL,0),(18,2,'删除',NULL,'sys:user:delete',2,NULL,0),(19,3,'查看',NULL,'sys:role:list,sys:role:info',2,NULL,0),(20,3,'新增',NULL,'sys:role:save,sys:menu:list',2,NULL,0),(21,3,'修改',NULL,'sys:role:update,sys:menu:list',2,NULL,0),(22,3,'删除',NULL,'sys:role:delete',2,NULL,0),(23,4,'查看',NULL,'sys:menu:list,sys:menu:info',2,NULL,0),(24,4,'新增',NULL,'sys:menu:save,sys:menu:select',2,NULL,0),(25,4,'修改',NULL,'sys:menu:update,sys:menu:select',2,NULL,0),(26,4,'删除',NULL,'sys:menu:delete',2,NULL,0),(27,1,'参数管理','sys/config','sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',1,'config',6),(29,1,'系统日志','sys/log','sys:log:list',1,'log',7),(30,1,'文件上传','oss/oss','sys:oss:all',1,'oss',6),(31,0,'商品系统','','',0,'editor',0),(32,31,'分类维护','product/category','',1,'menu',0),(34,31,'品牌管理','product/brand','',1,'editor',0),(37,31,'平台属性','','',0,'system',0),(38,37,'属性分组','product/attrgroup','',1,'tubiao',0),(39,37,'规格参数','product/baseattr','',1,'log',0),(40,37,'销售属性','product/saleattr','',1,'zonghe',0),(41,31,'商品维护','product/spu','',0,'zonghe',0),(42,0,'优惠营销','','',0,'mudedi',0),(43,0,'库存系统','','',0,'shouye',0),(44,0,'订单系统','','',0,'config',0),(45,0,'用户系统','','',0,'admin',0),(46,0,'内容管理','','',0,'sousuo',0),(47,42,'优惠券管理','coupon/coupon','',1,'zhedie',0),(48,42,'发放记录','coupon/history','',1,'sql',0),(49,42,'专题活动','coupon/subject','',1,'tixing',0),(50,42,'秒杀活动','coupon/seckill','',1,'daohang',0),(51,42,'积分维护','coupon/bounds','',1,'geren',0),(52,42,'满减折扣','coupon/full','',1,'shoucang',0),(53,43,'仓库维护','ware/wareinfo','',1,'shouye',0),(54,43,'库存工作单','ware/task','',1,'log',0),(55,43,'商品库存','ware/sku','',1,'jiesuo',0),(56,44,'订单查询','order/order','',1,'zhedie',0),(57,44,'退货单处理','order/return','',1,'shanchu',0),(58,44,'等级规则','order/settings','',1,'system',0),(59,44,'支付流水查询','order/payment','',1,'job',0),(60,44,'退款流水查询','order/refund','',1,'mudedi',0),(61,45,'会员列表','member/member','',1,'geren',0),(62,45,'会员等级','member/level','',1,'tubiao',0),(63,45,'积分变化','member/growth','',1,'bianji',0),(64,45,'统计信息','member/statistics','',1,'sql',0),(65,46,'首页推荐','content/index','',1,'shouye',0),(66,46,'分类热门','content/category','',1,'zhedie',0),(67,46,'评论管理','content/comments','',1,'pinglun',0),(68,41,'spu管理','product/spu','',1,'config',0),(69,41,'发布商品','product/spuadd','',1,'bianji',0),(70,43,'采购单维护','','',0,'tubiao',0),(71,70,'采购需求','ware/purchaseitem','',1,'editor',0),(72,70,'采购单','ware/purchase','',1,'menu',0),(73,41,'商品管理','product/manager','',1,'zonghe',0),(74,42,'会员价格','coupon/memberprice','',1,'admin',0),(75,42,'每日秒杀','coupon/seckillsession','',1,'job',0);