/*
 Navicat Premium Data Transfer

 Source Server         : linux_testmysql
 Source Server Type    : MySQL
 Source Server Version : 50726
 Source Host           : 192.168.2.244:3306
 Source Schema         : cneeds_server

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

 Date: 28/08/2020 16:39:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for DATABASECHANGELOG
-- ----------------------------
DROP TABLE IF EXISTS `DATABASECHANGELOG`;
CREATE TABLE `DATABASECHANGELOG`  (
  `ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `AUTHOR` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `FILENAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `DATEEXECUTED` datetime(0) NOT NULL,
  `ORDEREXECUTED` int(11) NOT NULL,
  `EXECTYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `MD5SUM` varchar(35) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `DESCRIPTION` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `COMMENTS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `TAG` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `LIQUIBASE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `CONTEXTS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `LABELS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `DEPLOYMENT_ID` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of DATABASECHANGELOG
-- ----------------------------
INSERT INTO `DATABASECHANGELOG` VALUES ('0', 'zzr', 'classpath:/db/changelog/db_changelog_master.yaml', '2020-08-05 11:30:59', 1, 'EXECUTED', '7:d41d8cd98f00b204e9800998ecf8427e', 'empty', '', NULL, '3.5.4', NULL, NULL, '6598259577');
INSERT INTO `DATABASECHANGELOG` VALUES ('1', 'zzr', 'classpath:/db/changelog/db_changelog_master.yaml', '2020-08-05 16:47:55', 2, 'EXECUTED', '7:5c572d2727d6918931b5ab1164b27091', 'sqlFile', '', NULL, '3.5.4', NULL, NULL, '6617275962');
INSERT INTO `DATABASECHANGELOG` VALUES ('2', 'zzr', 'classpath:/db/changelog/db_changelog_master.yaml', '2020-08-05 20:00:56', 3, 'EXECUTED', '7:b7e9f0dc5146d0523338a3ddb521f22d', 'sqlFile', '', NULL, '3.5.4', NULL, NULL, '6628856806');
INSERT INTO `DATABASECHANGELOG` VALUES ('3', 'zzr', 'classpath:/db/changelog/db_changelog_master.yaml', '2020-08-19 15:35:09', 4, 'EXECUTED', '7:d39175a13627926fc60e67ee81405b9b', 'sqlFile', '', NULL, '3.5.4', NULL, NULL, '7822515543');

-- ----------------------------
-- Table structure for DATABASECHANGELOGLOCK
-- ----------------------------
DROP TABLE IF EXISTS `DATABASECHANGELOGLOCK`;
CREATE TABLE `DATABASECHANGELOGLOCK`  (
  `ID` int(11) NOT NULL,
  `LOCKED` bit(1) NOT NULL,
  `LOCKGRANTED` datetime(0) DEFAULT NULL,
  `LOCKEDBY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of DATABASECHANGELOGLOCK
-- ----------------------------
INSERT INTO `DATABASECHANGELOGLOCK` VALUES (1, b'0', NULL, NULL);

-- ----------------------------
-- Table structure for device_car_type
-- ----------------------------
DROP TABLE IF EXISTS `device_car_type`;
CREATE TABLE `device_car_type`  (
  `car_type_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '车型Id',
  `brand` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '品牌',
  `car_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '车系',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '介绍',
  `update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`car_type_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_car_type
-- ----------------------------
INSERT INTO `device_car_type` VALUES (2, NULL, NULL, NULL, '2020-08-20 05:54:01');
INSERT INTO `device_car_type` VALUES (3, '1111', '111', '1', '2020-08-20 05:54:50');

-- ----------------------------
-- Table structure for device_channel
-- ----------------------------
DROP TABLE IF EXISTS `device_channel`;
CREATE TABLE `device_channel`  (
  `channel_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `channel_num` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '渠道号',
  `update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
  `car_type_id` bigint(20) DEFAULT NULL COMMENT '车型Id',
  PRIMARY KEY (`channel_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_channel
-- ----------------------------
INSERT INTO `device_channel` VALUES (2, '123123', '2020-05-13 02:37:21', NULL);
INSERT INTO `device_channel` VALUES (3, '123123123123123123123', '2020-05-14 03:17:41', NULL);

-- ----------------------------
-- Table structure for device_info
-- ----------------------------
DROP TABLE IF EXISTS `device_info`;
CREATE TABLE `device_info`  (
  `device_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '设备id',
  `dept_id` bigint(20) DEFAULT NULL,
  `imei` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'imei',
  `iccid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'iccid',
  `active_status` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '状态0未激活，1已激活',
  `device_version` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '设备版本',
  `series_id` bigint(20) DEFAULT NULL COMMENT '产品系列',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `active_time` datetime(0) DEFAULT NULL COMMENT '激活时间',
  `channel_nums_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '渠道号提示信息',
  `channel_rules` int(255) DEFAULT 1 COMMENT '0:白名单，1:黑名单',
  `sn` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'sn号',
  `ca_certificate_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '-1' COMMENT 'ca证书状态 -1 未下载，0 已下载 类型：非量产 1 已下载 类型：量产，2 已下载 类型：非量产，未验证 3 已下载 类型：量产，未验证',
  `update_time` datetime(0) DEFAULT NULL,
  PRIMARY KEY (`device_id`) USING BTREE,
  UNIQUE INDEX `IMEI_UNIQUE`(`imei`) USING BTREE COMMENT 'imei唯一'
) ENGINE = InnoDB AUTO_INCREMENT = 65 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_info
-- ----------------------------
INSERT INTO `device_info` VALUES (1, 1, '123123', NULL, NULL, 'V 2.1.2.12', 3, '2020-03-19 15:28:49', '2020-03-19 15:28:53', '11111', 0, NULL, NULL, NULL);
INSERT INTO `device_info` VALUES (2, 1, '123456', NULL, NULL, 'V 2.1.2.12', 1, '2020-04-16 18:29:05', '2020-04-16 18:29:12', '未设置', 1, NULL, NULL, NULL);
INSERT INTO `device_info` VALUES (24, 4, '201909241012052', '123456', '0', 'V 2.1.2.12', 4, '2020-04-27 21:50:38', NULL, '测试', 0, '123456', '0', NULL);
INSERT INTO `device_info` VALUES (57, 1, '12313123123123', NULL, NULL, NULL, 1, '2020-05-29 03:07:30', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `device_info` VALUES (58, 1, '12345123123', '123456', '0', NULL, 1, '2020-07-21 04:14:34', NULL, '', 1, NULL, '-1', NULL);
INSERT INTO `device_info` VALUES (59, 1, '11111112312312311111111', '111111', '0', NULL, 1, '2020-07-21 04:14:34', NULL, '', 1, NULL, '-1', NULL);
INSERT INTO `device_info` VALUES (62, 0, '2019092410120521', '123456', '0', NULL, 1, '2020-08-04 02:24:00', NULL, '', 1, NULL, '-1', NULL);
INSERT INTO `device_info` VALUES (63, 0, '1234512312311111111', '111111', '0', NULL, 1, '2020-08-04 02:24:00', NULL, '', 1, NULL, '-1', NULL);
INSERT INTO `device_info` VALUES (64, 0, '1111111231231231111111111', '111111', '0', NULL, 1, '2020-08-04 02:24:00', NULL, '', 1, NULL, '-1', NULL);

-- ----------------------------
-- Table structure for device_info_channel
-- ----------------------------
DROP TABLE IF EXISTS `device_info_channel`;
CREATE TABLE `device_info_channel`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `device_id` bigint(20) DEFAULT NULL,
  `channel_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 71 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_info_channel
-- ----------------------------
INSERT INTO `device_info_channel` VALUES (63, 1, 2);
INSERT INTO `device_info_channel` VALUES (64, 1, 3);
INSERT INTO `device_info_channel` VALUES (66, 1, 2);
INSERT INTO `device_info_channel` VALUES (67, 1, 2);
INSERT INTO `device_info_channel` VALUES (68, 1, 3);

-- ----------------------------
-- Table structure for device_info_export
-- ----------------------------
DROP TABLE IF EXISTS `device_info_export`;
CREATE TABLE `device_info_export`  (
  `device_info_export_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '名字',
  `filepath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '路径',
  `status` int(10) DEFAULT NULL COMMENT '状态：0未完成，1完成',
  `update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`device_info_export_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_info_export
-- ----------------------------
INSERT INTO `device_info_export` VALUES (1, 'zz', NULL, 1, '2020-07-29 15:38:57');
INSERT INTO `device_info_export` VALUES (2, '2020-07-29-16:41:56.xlsx', NULL, -1, '2020-07-29 03:41:56');
INSERT INTO `device_info_export` VALUES (3, '2020-07-29-16-50-31.xlsx', '/cneedsFile/deviceInfoExportFilePath/3695/2020-07-29-16-50-31.xlsx', 1, '2020-07-29 03:50:32');
INSERT INTO `device_info_export` VALUES (7, '2020-08-04-14-40-48.xlsx', '/cneedsFile/deviceInfoExportFilePath/3650/2020-08-04-14-40-48.xlsx', 1, '2020-08-04 01:40:48');
INSERT INTO `device_info_export` VALUES (8, '2020-08-04-14-46-23.xlsx', NULL, -1, '2020-08-04 01:46:24');

-- ----------------------------
-- Table structure for device_link_protocols
-- ----------------------------
DROP TABLE IF EXISTS `device_link_protocols`;
CREATE TABLE `device_link_protocols`  (
  `link_protocols_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '连接协议Id',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '连接协议名称',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '介绍',
  `update_time` datetime(0) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`link_protocols_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_link_protocols
-- ----------------------------
INSERT INTO `device_link_protocols` VALUES (1, NULL, NULL, '2020-08-20 06:11:42');
INSERT INTO `device_link_protocols` VALUES (2, NULL, NULL, '2020-08-20 06:13:20');
INSERT INTO `device_link_protocols` VALUES (3, NULL, NULL, '2020-08-20 06:13:40');
INSERT INTO `device_link_protocols` VALUES (4, NULL, NULL, '2020-08-20 06:15:42');
INSERT INTO `device_link_protocols` VALUES (5, NULL, NULL, '2020-08-20 06:15:43');
INSERT INTO `device_link_protocols` VALUES (6, NULL, NULL, '2020-08-20 06:16:28');
INSERT INTO `device_link_protocols` VALUES (7, NULL, NULL, '2020-08-20 06:17:24');
INSERT INTO `device_link_protocols` VALUES (8, NULL, NULL, '2020-08-20 06:20:09');
INSERT INTO `device_link_protocols` VALUES (9, '111', '11', '2020-08-20 06:20:56');

-- ----------------------------
-- Table structure for device_log
-- ----------------------------
DROP TABLE IF EXISTS `device_log`;
CREATE TABLE `device_log`  (
  `log_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `log_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'bug名字',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  `device_id` bigint(20) DEFAULT NULL COMMENT '设备id',
  `status` int(11) DEFAULT NULL COMMENT '情况-1不可用 0未处理,1已处理',
  `create_username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人名字',
  `user_id` bigint(20) DEFAULT NULL,
  `repetition_steps` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '复现步骤',
  `logfile_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '日志文件存放路径',
  `logfile_size` bigint(20) DEFAULT NULL COMMENT '日志文件大小',
  `logfile_status` int(11) DEFAULT NULL COMMENT '日志文件上传状态,-1,失败,0上传中,1完成',
  `repetition_probability` int(10) DEFAULT NULL,
  `log_accept_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '移动端日志标识符',
  `device_version` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '设备版本号',
  PRIMARY KEY (`log_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '测试上传的日志表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_log
-- ----------------------------
INSERT INTO `device_log` VALUES (1, 'bug', '2020-04-03 15:43:34', 1, 1, 'admin', 1, '1231245', NULL, NULL, NULL, 100, NULL, NULL);
INSERT INTO `device_log` VALUES (6, 'bug标题', '2020-04-24 01:59:23', 1, -1, 'admin', 1, '步骤一 步骤二', '/cneedsFile/LogFilePath/12345123123/mqtt调研.pdf', NULL, NULL, 100, '12345123123', NULL);
INSERT INTO `device_log` VALUES (7, NULL, '2020-04-26 21:29:23', 1, 0, NULL, NULL, NULL, '/cneedsFile/LogFilePath/780758437543/testlog.zip', 0, 1, NULL, '780758437543', NULL);
INSERT INTO `device_log` VALUES (10, NULL, '2020-04-28 03:40:53', 1, -1, NULL, NULL, NULL, '/cneedsFile/LogFilePath/12345123123111123/testlog.zip', 4194304, NULL, NULL, '12345123123111123', NULL);
INSERT INTO `device_log` VALUES (11, 'bug', '2020-04-29 06:31:06', 1, -1, 'admin', 1, 'sdadasdas', NULL, NULL, NULL, 88, '123123123', NULL);

-- ----------------------------
-- Table structure for device_logmedia
-- ----------------------------
DROP TABLE IF EXISTS `device_logmedia`;
CREATE TABLE `device_logmedia`  (
  `logmedia_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `location_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '音频路径',
  `log_id` bigint(20) DEFAULT NULL,
  `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '格式',
  `file_size` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`logmedia_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '日志音频表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of device_logmedia
-- ----------------------------
INSERT INTO `device_logmedia` VALUES (4, '/cneedsFile/LogFilePath/12345123123/接口文档.docx', 6, '.docx', NULL);
INSERT INTO `device_logmedia` VALUES (5, '/cneedsFile/LogFilePath/12345123123/接口文档.docx', 6, '.docx', NULL);
INSERT INTO `device_logmedia` VALUES (6, '/cneedsFile/LogFilePath/12345123123/接口文档.docx', 6, '.docx', NULL);
INSERT INTO `device_logmedia` VALUES (7, '/cneedsFile/LogFilePath/12345123123/内存.md', 6, '.md', NULL);
INSERT INTO `device_logmedia` VALUES (8, '/cneedsFile/LogFilePath/12345123123/接口文档.docx', 6, '.docx', NULL);
INSERT INTO `device_logmedia` VALUES (9, '/cneedsFile/LogFilePath/12345123123/内存.md', 6, '.md', NULL);
INSERT INTO `device_logmedia` VALUES (10, '/cneedsFile/LogFilePath/12345123123/接口文档.docx', 6, '.docx', NULL);
INSERT INTO `device_logmedia` VALUES (11, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (12, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (13, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (14, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (15, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (16, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (17, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (18, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (19, '/cneedsFile/LogFilePath/12345123123111123/file.png', 10, 'png', 627712);
INSERT INTO `device_logmedia` VALUES (20, '/cneedsFile/LogFilePath/12345123123111123/20528.txt', 10, 'txt', 20528);
INSERT INTO `device_logmedia` VALUES (21, '/cneedsFile/LogFilePath/12345123123111123/20528.txt', 10, 'txt', 20528);
INSERT INTO `device_logmedia` VALUES (22, '/cneedsFile/LogFilePath/12345123123111123/20528.txt', 10, 'txt', 20528);

-- ----------------------------
-- Table structure for device_logsetting
-- ----------------------------
DROP TABLE IF EXISTS `device_logsetting`;
CREATE TABLE `device_logsetting`  (
  `logsetting_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `log_size` bigint(20) DEFAULT NULL COMMENT '日志容量（MB）',
  `device_id` bigint(20) DEFAULT NULL COMMENT '设备Id',
  PRIMARY KEY (`logsetting_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备日志设置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for product_series
-- ----------------------------
DROP TABLE IF EXISTS `product_series`;
CREATE TABLE `product_series`  (
  `series_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '系列id',
  `series_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品系列号',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '产品系列详情',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`series_id`) USING BTREE,
  UNIQUE INDEX `SERIES_NUM_UNIQUE`(`series_num`) USING BTREE COMMENT '系列号唯一'
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of product_series
-- ----------------------------
INSERT INTO `product_series` VALUES (1, '123123', '美行', NULL);
INSERT INTO `product_series` VALUES (3, '1111111', 'test1', '2020-03-23 04:48:52');
INSERT INTO `product_series` VALUES (4, '300468', 'carlife旋钮版标准版', '2020-04-27 21:49:53');
INSERT INTO `product_series` VALUES (5, '12312311111111111', '12312312', '2020-05-12 06:01:59');

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept`  (
  `dept_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL COMMENT '上级部门ID，一级部门为0',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '部门名称',
  `del_flag` int(11) DEFAULT NULL COMMENT '是否删除  -1：已删除  0：正常',
  `distributor_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '渠道商号',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`dept_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_dept
-- ----------------------------
INSERT INTO `sys_dept` VALUES (0, NULL, '根', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (1, 0, '美行集团', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (2, 1, '长沙分公司', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (3, 1, '上海分公司', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (4, 3, '技术部', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (5, 3, '销售部', 0, NULL, NULL);
INSERT INTO `sys_dept` VALUES (8, NULL, NULL, NULL, NULL, '123');
INSERT INTO `sys_dept` VALUES (9, NULL, NULL, NULL, NULL, '123');
INSERT INTO `sys_dept` VALUES (10, NULL, NULL, NULL, NULL, '123');

-- ----------------------------
-- Table structure for sys_func
-- ----------------------------
DROP TABLE IF EXISTS `sys_func`;
CREATE TABLE `sys_func`  (
  `func_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) NOT NULL,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `url` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `perms` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `order_num` int(11) DEFAULT NULL,
  PRIMARY KEY (`func_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 69 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '功能表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_func
-- ----------------------------
INSERT INTO `sys_func` VALUES (1, 0, '系统管理', NULL, 'sys', 1, 1);
INSERT INTO `sys_func` VALUES (2, 1, '用户管理', 'modules/sys/user.html', 'sys:user', 1, 1);
INSERT INTO `sys_func` VALUES (3, 1, '角色管理', 'modules/sys/role.html', 'sys:role', 1, 2);
INSERT INTO `sys_func` VALUES (4, 1, '菜单管理', 'modules/sys/menu.html', 'sys:module', 1, 3);
INSERT INTO `sys_func` VALUES (15, 2, '查看', NULL, 'sys:user:list', 2, 0);
INSERT INTO `sys_func` VALUES (16, 2, '新增', NULL, 'sys:user:add', 2, 0);
INSERT INTO `sys_func` VALUES (17, 2, '修改', NULL, 'sys:user:edit', 2, 0);
INSERT INTO `sys_func` VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, 0);
INSERT INTO `sys_func` VALUES (19, 3, '查看', NULL, 'sys:role:list', 2, 0);
INSERT INTO `sys_func` VALUES (20, 3, '新增', NULL, 'sys:role:add', 2, 0);
INSERT INTO `sys_func` VALUES (21, 3, '修改', NULL, 'sys:role:edit', 2, 0);
INSERT INTO `sys_func` VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, 0);
INSERT INTO `sys_func` VALUES (23, 4, '查看', NULL, 'sys:module:list', 2, 0);
INSERT INTO `sys_func` VALUES (31, 1, '部门管理', 'modules/sys/dept.html', 'sys:dept', 1, 1);
INSERT INTO `sys_func` VALUES (32, 31, '查看', NULL, 'sys:dept:list', 2, 0);
INSERT INTO `sys_func` VALUES (33, 31, '新增', NULL, 'sys:dept:add', 2, 0);
INSERT INTO `sys_func` VALUES (34, 31, '修改', NULL, 'sys:dept:edit', 2, 0);
INSERT INTO `sys_func` VALUES (35, 31, '删除', NULL, 'sys:dept:delete', 2, 0);
INSERT INTO `sys_func` VALUES (36, 0, '配置管理', NULL, 'configManagement', 1, 1);
INSERT INTO `sys_func` VALUES (37, 36, '产品系列管理', NULL, 'configManagement:productSeries', 1, 1);
INSERT INTO `sys_func` VALUES (38, 37, '查询产品系列', NULL, 'configManagement:productSeries:list', 2, 0);
INSERT INTO `sys_func` VALUES (39, 37, '添加产品系列', NULL, 'configManagement:productSeries:add', 2, 0);
INSERT INTO `sys_func` VALUES (40, 37, '修改产品系列', NULL, 'configManagement:productSeries:edit', 2, 0);
INSERT INTO `sys_func` VALUES (41, 37, '删除产品系列', NULL, 'configManagement:productSeries:delete', 2, 0);
INSERT INTO `sys_func` VALUES (42, 36, '渠道号管理', NULL, 'configManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (43, 42, '查询渠道号', NULL, 'configManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (44, 42, '添加渠道号', NULL, 'configManagement:deviceChannel:add', 2, 0);
INSERT INTO `sys_func` VALUES (45, 42, '修改渠道号', NULL, 'configManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (46, 42, '删除渠道号', NULL, 'configManagement:deviceChannel:delete', 2, 0);
INSERT INTO `sys_func` VALUES (47, 0, '设备控制', NULL, 'deviceManagement', 1, 1);
INSERT INTO `sys_func` VALUES (48, 47, '设备管理', NULL, 'deviceManagement:device', 1, 1);
INSERT INTO `sys_func` VALUES (49, 48, '查询设备', NULL, 'deviceManagement:device:list', 1, 1);
INSERT INTO `sys_func` VALUES (50, 48, '导入设备,批量导入', NULL, 'deviceManagement:device:add', 2, 0);
INSERT INTO `sys_func` VALUES (51, 48, '适配配置,批量配置', NULL, 'deviceManagement:device:edit', 2, 0);
INSERT INTO `sys_func` VALUES (52, 48, '删除设备', NULL, 'deviceManagement:device:delete', 2, 0);
INSERT INTO `sys_func` VALUES (53, 47, '渠道号查询,渠道号配置', NULL, 'deviceManagement:deviceChannel', 1, 1);
INSERT INTO `sys_func` VALUES (54, 53, '查询渠道号查询,渠道号配置', NULL, 'deviceManagement:deviceChannel:list', 2, 0);
INSERT INTO `sys_func` VALUES (55, 0, '远程日志', NULL, 'remotelog', 1, 1);
INSERT INTO `sys_func` VALUES (56, 55, '日志列表', NULL, 'remotelog:logfile', 1, 1);
INSERT INTO `sys_func` VALUES (57, 56, '查询日志', NULL, 'remotelog:logfile:list', 2, 0);
INSERT INTO `sys_func` VALUES (58, 56, '修改日志', NULL, 'remotelog:logfile:edit', 2, 0);
INSERT INTO `sys_func` VALUES (59, 56, '删除日志', NULL, 'remotelog:logfile:delete', 2, 0);
INSERT INTO `sys_func` VALUES (60, 55, '设备控制', NULL, 'remotelog:controlDevice', 1, 1);
INSERT INTO `sys_func` VALUES (61, 60, '查询状态', NULL, 'remotelog:controlDevice:list', 2, 0);
INSERT INTO `sys_func` VALUES (62, 0, '设备统计', NULL, 'deviceStatistical', 1, 1);
INSERT INTO `sys_func` VALUES (63, 62, '设备信息', NULL, 'deviceStatistical:deviceInfo', 1, 1);
INSERT INTO `sys_func` VALUES (64, 63, '查询设备信息', NULL, 'deviceStatistical:deviceInfo:list', 2, 0);
INSERT INTO `sys_func` VALUES (65, 62, '设备信息导出', NULL, 'deviceStatistical:deviceInfoExport', 1, 1);
INSERT INTO `sys_func` VALUES (66, 65, '查询设备信息导出(默认拥有下载导出权限)', NULL, 'deviceStatistical:deviceInfoExport:list', 1, 1);
INSERT INTO `sys_func` VALUES (67, 53, '修改渠道号配置', NULL, 'deviceManagement:deviceChannel:edit', 2, 0);
INSERT INTO `sys_func` VALUES (68, 53, '删除渠道号查询,渠道号配置', NULL, 'deviceManagement:deviceChannel:delete', 2, 0);

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role`  (
  `role_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '角色名称',
  `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门Id',
  `create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES (1, '管理员', '描述', 1, '2020-03-10 12:06:37');
INSERT INTO `sys_role` VALUES (27, 'zzr123123', '123123123123', 1, '2020-03-18 04:23:32');

-- ----------------------------
-- Table structure for sys_role_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dept`;
CREATE TABLE `sys_role_dept`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 484 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门与角色映射表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_role_dept
-- ----------------------------
INSERT INTO `sys_role_dept` VALUES (469, 27, 3);
INSERT INTO `sys_role_dept` VALUES (470, 27, 4);
INSERT INTO `sys_role_dept` VALUES (471, 27, 5);
INSERT INTO `sys_role_dept` VALUES (478, 1, 0);
INSERT INTO `sys_role_dept` VALUES (479, 1, 1);
INSERT INTO `sys_role_dept` VALUES (480, 1, 2);
INSERT INTO `sys_role_dept` VALUES (481, 1, 3);
INSERT INTO `sys_role_dept` VALUES (482, 1, 4);
INSERT INTO `sys_role_dept` VALUES (483, 1, 5);

-- ----------------------------
-- Table structure for sys_role_func
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_func`;
CREATE TABLE `sys_role_func`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色Id',
  `func_id` bigint(20) DEFAULT NULL COMMENT '功能Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 546 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '功能与角色映射表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`  (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
  `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机',
  `status` int(11) DEFAULT NULL COMMENT '账户状态',
  `create_time` date DEFAULT NULL COMMENT '创建时间',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES (0, 'admin', '$2a$10$e.YpBjJEys4fd9fnnZGX..4MXR37Ud9QhvHi1QWXZ8qxWhO6lmUya', 'root@cneeds.com.cn', '123456', 1, '2020-07-21', 0, '');
INSERT INTO `sys_user` VALUES (25, 'zzr', '$2a$10$GIh4www8MdelsCPv.eic2.ns.aIR.c6ky16EFB7qwsxDJ52.62pYq', '12345', '123456', 1, '2020-06-05', 1, '123456');

-- ----------------------------
-- Table structure for sys_user_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_dept`;
CREATE TABLE `sys_user_dept`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 576 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门与角色映射表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user_dept
-- ----------------------------
INSERT INTO `sys_user_dept` VALUES (529, 1, 3);
INSERT INTO `sys_user_dept` VALUES (530, 1, 4);
INSERT INTO `sys_user_dept` VALUES (531, 1, 5);
INSERT INTO `sys_user_dept` VALUES (570, 25, 0);
INSERT INTO `sys_user_dept` VALUES (571, 25, 1);
INSERT INTO `sys_user_dept` VALUES (572, 25, 2);
INSERT INTO `sys_user_dept` VALUES (573, 25, 3);
INSERT INTO `sys_user_dept` VALUES (574, 25, 4);
INSERT INTO `sys_user_dept` VALUES (575, 25, 5);

-- ----------------------------
-- Table structure for sys_user_func
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_func`;
CREATE TABLE `sys_user_func`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户Id',
  `func_id` bigint(20) DEFAULT NULL COMMENT '功能Id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 833 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '功能与角色映射表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user_func
-- ----------------------------
INSERT INTO `sys_user_func` VALUES (805, 25, 1);
INSERT INTO `sys_user_func` VALUES (806, 25, 2);
INSERT INTO `sys_user_func` VALUES (807, 25, 15);
INSERT INTO `sys_user_func` VALUES (808, 25, 3);
INSERT INTO `sys_user_func` VALUES (809, 25, 19);
INSERT INTO `sys_user_func` VALUES (810, 25, 4);
INSERT INTO `sys_user_func` VALUES (811, 25, 23);
INSERT INTO `sys_user_func` VALUES (812, 25, 31);
INSERT INTO `sys_user_func` VALUES (813, 25, 32);
INSERT INTO `sys_user_func` VALUES (814, 25, 36);
INSERT INTO `sys_user_func` VALUES (815, 25, 37);
INSERT INTO `sys_user_func` VALUES (816, 25, 38);
INSERT INTO `sys_user_func` VALUES (817, 25, 43);
INSERT INTO `sys_user_func` VALUES (818, 25, 47);
INSERT INTO `sys_user_func` VALUES (819, 25, 48);
INSERT INTO `sys_user_func` VALUES (820, 25, 49);
INSERT INTO `sys_user_func` VALUES (821, 25, 53);
INSERT INTO `sys_user_func` VALUES (822, 25, 54);
INSERT INTO `sys_user_func` VALUES (823, 25, 55);
INSERT INTO `sys_user_func` VALUES (824, 25, 56);
INSERT INTO `sys_user_func` VALUES (825, 25, 57);
INSERT INTO `sys_user_func` VALUES (826, 25, 60);
INSERT INTO `sys_user_func` VALUES (827, 25, 61);
INSERT INTO `sys_user_func` VALUES (828, 25, 62);
INSERT INTO `sys_user_func` VALUES (829, 25, 63);
INSERT INTO `sys_user_func` VALUES (830, 25, 64);
INSERT INTO `sys_user_func` VALUES (831, 25, 65);
INSERT INTO `sys_user_func` VALUES (832, 25, 66);

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `role_id` bigint(20) DEFAULT NULL COMMENT '权限id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色用户映射表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES (1, 2, 1);
INSERT INTO `sys_user_role` VALUES (4, 5, 1);
INSERT INTO `sys_user_role` VALUES (5, 6, 1);
INSERT INTO `sys_user_role` VALUES (6, 7, 1);
INSERT INTO `sys_user_role` VALUES (7, 8, 1);
INSERT INTO `sys_user_role` VALUES (8, 9, 1);
INSERT INTO `sys_user_role` VALUES (13, 14, 1);
INSERT INTO `sys_user_role` VALUES (14, 15, 1);
INSERT INTO `sys_user_role` VALUES (15, 16, 1);
INSERT INTO `sys_user_role` VALUES (24, 25, 1);

SET FOREIGN_KEY_CHECKS = 1;
