/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50720
 Source Host           : localhost:3306
 Source Schema         : gis_cms

 Target Server Type    : MySQL
 Target Server Version : 50720
 File Encoding         : 65001

 Date: 29/05/2020 15:25:43
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `rec_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态，A：激活，I：禁用',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `parent_id` bigint(50) NULL DEFAULT NULL COMMENT '上级部门id',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_dept
-- ----------------------------
INSERT INTO `sys_dept` VALUES (1, '2020-05-28 16:29:28', 'A', '2020-05-28 16:29:28', NULL, '总经办');
INSERT INTO `sys_dept` VALUES (2, '2020-05-28 16:31:07', 'A', '2020-05-28 16:31:07', 1, '财务部');
INSERT INTO `sys_dept` VALUES (3, '2020-05-28 16:32:06', 'A', '2020-05-28 16:32:06', 1, '市场部');

-- ----------------------------
-- Table structure for sys_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_resource`;
CREATE TABLE `sys_resource`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源描述',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源名称',
  `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源地址',
  `parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父资源id',
  `resource_type` enum('menu','button') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源类型',
  `resource_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源key',
  `rec_status` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '记录的状态，A: 生效，I: 禁用',
  `sort` int(6) NULL DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `FKf5ra2gn0xedeida2op8097sr5`(`parent_id`) USING BTREE,
  CONSTRAINT `FKf5ra2gn0xedeida2op8097sr5` FOREIGN KEY (`parent_id`) REFERENCES `sys_resource` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资源表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_resource
-- ----------------------------
INSERT INTO `sys_resource` VALUES (1, '2018-05-10 17:18:36', '2018-05-10 17:22:42', NULL, '首页', NULL, NULL, 'menu', 'sys', 'A', 1);
INSERT INTO `sys_resource` VALUES (2, '2018-05-11 10:05:41', '2018-12-04 11:22:02', NULL, '部门信息', NULL, NULL, 'menu', 'sys', 'A', 100);
INSERT INTO `sys_resource` VALUES (3, '2018-05-14 14:09:07', '2018-05-14 14:09:10', NULL, '用户管理', NULL, NULL, 'menu', 'sys', 'A', 200);
INSERT INTO `sys_resource` VALUES (4, '2018-05-14 15:08:06', '2018-05-14 15:08:08', NULL, '角色权限', NULL, NULL, 'menu', 'sys', 'A', 300);
INSERT INTO `sys_resource` VALUES (5, '2018-07-27 16:30:51', '2018-07-27 16:30:51', NULL, '场景管理', NULL, NULL, 'menu', 'admin:scene:list', 'I', 400);
INSERT INTO `sys_resource` VALUES (6, '2019-03-29 11:36:57', '2019-03-29 11:36:57', NULL, '数据统计', NULL, NULL, 'menu', 'sys', 'A', 500);
INSERT INTO `sys_resource` VALUES (7, NULL, NULL, NULL, '操作日志', NULL, NULL, 'menu', 'sys', 'A', 600);
INSERT INTO `sys_resource` VALUES (8, NULL, NULL, NULL, '问题反馈', NULL, NULL, 'menu', 'admin:issue:list', 'A', 700);
INSERT INTO `sys_resource` VALUES (9, NULL, NULL, NULL, '个人中心', NULL, NULL, 'menu', 'sys', 'A', 800);
INSERT INTO `sys_resource` VALUES (10, NULL, NULL, NULL, '我的场景', NULL, NULL, 'menu', 'admin:scene:list', 'A', 810);
INSERT INTO `sys_resource` VALUES (11, NULL, NULL, NULL, '我的相机', NULL, NULL, 'menu', 'admin:camera:list', 'A', 820);
INSERT INTO `sys_resource` VALUES (12, NULL, NULL, NULL, '部门新增', NULL, 2, 'button', 'sys', 'A', 101);
INSERT INTO `sys_resource` VALUES (13, NULL, NULL, NULL, '部门删除', NULL, 2, 'button', 'sys', 'A', 102);
INSERT INTO `sys_resource` VALUES (14, NULL, NULL, NULL, '用户新增', NULL, 3, 'button', 'sys', 'A', 201);
INSERT INTO `sys_resource` VALUES (15, NULL, NULL, NULL, '用户编辑', NULL, 3, 'button', 'sys', 'A', 202);
INSERT INTO `sys_resource` VALUES (16, NULL, NULL, NULL, '重置密码', NULL, 3, 'button', 'admin:user:resetPass', 'A', 203);
INSERT INTO `sys_resource` VALUES (17, NULL, NULL, NULL, '角色新增', NULL, 4, 'button', 'sys', 'A', 301);
INSERT INTO `sys_resource` VALUES (18, NULL, NULL, NULL, '角色授权', NULL, 4, 'button', 'sys', 'A', 302);
INSERT INTO `sys_resource` VALUES (19, NULL, NULL, NULL, '问题新增', NULL, 8, 'button', 'admin:issue:add', 'A', 701);
INSERT INTO `sys_resource` VALUES (20, NULL, NULL, NULL, '问题回复', NULL, 8, 'button', 'admin:issue:reply', 'A', 702);
INSERT INTO `sys_resource` VALUES (21, NULL, NULL, NULL, '问题删除', NULL, 8, 'button', 'admin:issue:remove', 'A', 703);
INSERT INTO `sys_resource` VALUES (22, NULL, NULL, NULL, '场景删除', NULL, 10, 'button', 'admin:scene:remove', 'A', 811);
INSERT INTO `sys_resource` VALUES (23, NULL, NULL, NULL, '场景编辑', NULL, 10, 'button', 'admin:scene:edit', 'A', 812);
INSERT INTO `sys_resource` VALUES (24, NULL, NULL, NULL, '新增相机', NULL, 11, 'button', 'admin:camera:add', 'A', 821);
INSERT INTO `sys_resource` VALUES (25, NULL, NULL, NULL, '角色删除', NULL, 4, 'button', 'sys', 'A', 303);
INSERT INTO `sys_resource` VALUES (26, NULL, NULL, NULL, '版本管理', NULL, NULL, 'menu', 'admin:version', 'A', 900);
INSERT INTO `sys_resource` VALUES (27, NULL, NULL, NULL, '版本上传', NULL, 26, 'button', 'admin:version:edit', 'A', 901);
INSERT INTO `sys_resource` VALUES (28, NULL, NULL, NULL, '版本状态', NULL, 26, 'button', 'admin:version:edit', 'A', 902);

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `role_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色描述',
  `role_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名',
  `role_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色key, sys开头是系统表，不能删除',
  `rec_status` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '记录的状态，A: 生效，I: 禁用',
  `sort` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES (1, '2018-05-11 10:02:27', '2019-04-01 16:07:09', '所有权限', '超级管理员', 'sys_admin', 'A', '1');
INSERT INTO `sys_role` VALUES (2, '2019-11-12 09:10:25', '2020-04-09 10:15:37', '部门所有权限', '部门经理', 'manager', 'A', '2');
INSERT INTO `sys_role` VALUES (6, '2020-04-03 10:57:42', '2020-04-13 14:23:26', '测试相关权限', '测试权限', '', 'A', NULL);
INSERT INTO `sys_role` VALUES (7, '2020-05-19 12:23:27', '2020-05-19 12:50:04', '看所有场景，但没有删除权限', '部门经理', '', 'A', '3');
INSERT INTO `sys_role` VALUES (8, '2020-05-28 17:26:21', '2020-05-28 17:26:21', '', '总经理', NULL, 'A', NULL);

-- ----------------------------
-- Table structure for sys_role_resource
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_resource`;
CREATE TABLE `sys_role_resource`  (
  `role_id` bigint(20) NOT NULL COMMENT '角色表id',
  `resource_id` bigint(20) NOT NULL COMMENT '资源表id',
  PRIMARY KEY (`role_id`, `resource_id`) USING BTREE,
  INDEX `FK868kc8iic48ilv5npa80ut6qo`(`resource_id`) USING BTREE,
  CONSTRAINT `sys_role_resource_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sys_role_resource_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `sys_resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色资源关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_role_resource
-- ----------------------------
INSERT INTO `sys_role_resource` VALUES (1, 1);
INSERT INTO `sys_role_resource` VALUES (2, 1);
INSERT INTO `sys_role_resource` VALUES (7, 1);
INSERT INTO `sys_role_resource` VALUES (1, 2);
INSERT INTO `sys_role_resource` VALUES (1, 3);
INSERT INTO `sys_role_resource` VALUES (1, 4);
INSERT INTO `sys_role_resource` VALUES (1, 6);
INSERT INTO `sys_role_resource` VALUES (1, 7);
INSERT INTO `sys_role_resource` VALUES (1, 8);
INSERT INTO `sys_role_resource` VALUES (2, 8);
INSERT INTO `sys_role_resource` VALUES (6, 8);
INSERT INTO `sys_role_resource` VALUES (7, 8);
INSERT INTO `sys_role_resource` VALUES (1, 9);
INSERT INTO `sys_role_resource` VALUES (2, 9);
INSERT INTO `sys_role_resource` VALUES (6, 9);
INSERT INTO `sys_role_resource` VALUES (7, 9);
INSERT INTO `sys_role_resource` VALUES (1, 10);
INSERT INTO `sys_role_resource` VALUES (2, 10);
INSERT INTO `sys_role_resource` VALUES (6, 10);
INSERT INTO `sys_role_resource` VALUES (7, 10);
INSERT INTO `sys_role_resource` VALUES (1, 11);
INSERT INTO `sys_role_resource` VALUES (2, 11);
INSERT INTO `sys_role_resource` VALUES (6, 11);
INSERT INTO `sys_role_resource` VALUES (7, 11);
INSERT INTO `sys_role_resource` VALUES (1, 12);
INSERT INTO `sys_role_resource` VALUES (1, 13);
INSERT INTO `sys_role_resource` VALUES (1, 14);
INSERT INTO `sys_role_resource` VALUES (1, 15);
INSERT INTO `sys_role_resource` VALUES (1, 16);
INSERT INTO `sys_role_resource` VALUES (1, 17);
INSERT INTO `sys_role_resource` VALUES (1, 18);
INSERT INTO `sys_role_resource` VALUES (1, 19);
INSERT INTO `sys_role_resource` VALUES (2, 19);
INSERT INTO `sys_role_resource` VALUES (6, 19);
INSERT INTO `sys_role_resource` VALUES (7, 19);
INSERT INTO `sys_role_resource` VALUES (1, 20);
INSERT INTO `sys_role_resource` VALUES (2, 20);
INSERT INTO `sys_role_resource` VALUES (1, 21);
INSERT INTO `sys_role_resource` VALUES (2, 21);
INSERT INTO `sys_role_resource` VALUES (6, 21);
INSERT INTO `sys_role_resource` VALUES (1, 22);
INSERT INTO `sys_role_resource` VALUES (2, 22);
INSERT INTO `sys_role_resource` VALUES (6, 22);
INSERT INTO `sys_role_resource` VALUES (1, 23);
INSERT INTO `sys_role_resource` VALUES (2, 23);
INSERT INTO `sys_role_resource` VALUES (7, 23);
INSERT INTO `sys_role_resource` VALUES (1, 24);
INSERT INTO `sys_role_resource` VALUES (2, 24);
INSERT INTO `sys_role_resource` VALUES (6, 24);
INSERT INTO `sys_role_resource` VALUES (7, 24);
INSERT INTO `sys_role_resource` VALUES (1, 25);
INSERT INTO `sys_role_resource` VALUES (1, 26);
INSERT INTO `sys_role_resource` VALUES (7, 26);
INSERT INTO `sys_role_resource` VALUES (1, 27);
INSERT INTO `sys_role_resource` VALUES (7, 27);
INSERT INTO `sys_role_resource` VALUES (1, 28);
INSERT INTO `sys_role_resource` VALUES (7, 28);

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `rec_status` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态，0：激活，1：禁用',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录密码',
  `real_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号，用户号',
  `dept_id` bigint(20) NULL DEFAULT NULL COMMENT '部门id',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  `user_num` int(255) NULL DEFAULT NULL COMMENT '用户代号',
  `sex` tinyint(4) NULL DEFAULT NULL COMMENT '性别， 0：男， 1：女',
  `status` int(11) NULL DEFAULT NULL,
  `view_count` int(11) NULL DEFAULT 0 COMMENT '登录次数',
  `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `manager` int(255) NULL DEFAULT NULL COMMENT '管理者，0：是， 1：否',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `dept_id`(`dept_id`) USING BTREE,
  CONSTRAINT `sys_user_ibfk_1` FOREIGN KEY (`dept_id`) REFERENCES `sys_dept` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES (1, '2020-04-13 08:57:41', 'A', '2020-04-13 08:57:41', 'c44b01947c9e6e3f', '超级管理员', 'admin', 1, '38@qq.com', 9, 0, 0, 0, '15012345678', 0);
INSERT INTO `sys_user` VALUES (2, '2020-03-17 15:19:23', 'A', '2020-05-19 12:48:39', '970e6cd78216ca8c', '伟浩(超级管理员)', 'owen', 2, '', 5, 0, 0, 103, '15015981234', NULL);
INSERT INTO `sys_user` VALUES (3, '2020-04-01 18:31:57', 'A', '2020-05-19 14:04:46', '3e84c6e71f37cf6c', '浩(普通员工)', 'hao', 3, '38@qqq.com', 8, 1, 0, 40, '15088881234', 1);
INSERT INTO `sys_user` VALUES (32, '2020-03-25 14:51:00', 'A', '2020-05-25 18:40:50', '41d3b2e18ba7c7fc', '志广', 'zhiguang', 2, '38@qq.com', 7, 0, 0, 79, '137000000', NULL);

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role`  (
  `user_id` bigint(20) NOT NULL COMMENT '用户表id',
  `role_id` bigint(20) NOT NULL COMMENT '角色表id',
  PRIMARY KEY (`user_id`, `role_id`) USING BTREE,
  INDEX `role_id`(`role_id`) USING BTREE,
  CONSTRAINT `sys_user_role_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sys_user_role_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户角色关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES (1, 1);
INSERT INTO `sys_user_role` VALUES (2, 1);
INSERT INTO `sys_user_role` VALUES (32, 1);
INSERT INTO `sys_user_role` VALUES (38, 7);

-- ----------------------------
-- Table structure for tb_goods
-- ----------------------------
DROP TABLE IF EXISTS `tb_goods`;
CREATE TABLE `tb_goods`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `rec_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态，A：激活，I：禁用',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  CONSTRAINT `tb_goods_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of tb_goods
-- ----------------------------
INSERT INTO `tb_goods` VALUES (1, '2020-05-28 16:29:28', 'A', '2020-05-28 16:29:28', '总经办', 2);
INSERT INTO `tb_goods` VALUES (2, '2020-05-28 16:31:07', 'A', '2020-05-28 16:31:07', '财务部', 3);
INSERT INTO `tb_goods` VALUES (3, '2020-05-28 16:32:06', 'A', '2020-05-28 16:32:06', '市场部', NULL);

-- ----------------------------
-- Table structure for tb_news
-- ----------------------------
DROP TABLE IF EXISTS `tb_news`;
CREATE TABLE `tb_news`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `rec_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态，A：激活，I：禁用',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '商品名称',
  `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of tb_news
-- ----------------------------
INSERT INTO `tb_news` VALUES (1, '2020-05-28 16:29:28', 'A', '2020-05-28 16:29:28', '总经办', NULL);
INSERT INTO `tb_news` VALUES (2, '2020-05-28 16:31:07', 'A', '2020-05-28 16:31:07', '财务部', NULL);
INSERT INTO `tb_news` VALUES (3, '2020-05-28 16:32:06', 'A', '2020-05-28 16:32:06', '市场部', NULL);

SET FOREIGN_KEY_CHECKS = 1;
