/*
 Navicat MySQL Data Transfer

 Source Server         : nx-2
 Source Server Type    : MySQL
 Source Server Version : 80026
 Source Host           : 192.168.31.219:3306
 Source Schema         : gsdDB

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

 Date: 18/07/2022 15:38:33
*/

# Create Database

CREATE DATABASE IF NOT EXISTS gsdDB DEFAULT CHARACTER SET = utf8mb4;
Use gsdDB;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for DataSources
-- ----------------------------
DROP TABLE IF EXISTS `DataSources`;
CREATE TABLE `DataSources`  (
  `Id` int(0) NOT NULL AUTO_INCREMENT,
  `uuid` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `Uri` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `RecognitionRange` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
  `Play` int(0) NOT NULL,
  `Del` int(0) NOT NULL,
  `DataTime` datetime(0) NULL DEFAULT NULL,
  `Num` int(0) NOT NULL,
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `dv_Id` int(0) NOT NULL,
  `addTime` datetime(0) NULL DEFAULT NULL,
  `updateTime` datetime(0) NULL DEFAULT NULL,
  `IP` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '摄像头IP',
  `finish` int(0) NULL DEFAULT NULL,
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 71 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of DataSources
-- ----------------------------
INSERT INTO `DataSources` VALUES (1, '1', 'rtsp://admin:sunwin2021@192.168.31.130:554/h264/ch1/main/av_stream', '[]', 1, 0, '2022-07-18 10:23:57', 0, '1', 1, NULL, NULL, NULL, NULL);

-- ----------------------------
-- Table structure for DeviceList
-- ----------------------------
DROP TABLE IF EXISTS `DeviceList`;
CREATE TABLE `DeviceList`  (
  `Id` int(0) NOT NULL AUTO_INCREMENT,
  `DeviceId` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `DeviceToken` tinyint(0) NOT NULL,
  `DeviceType` tinyint(0) NOT NULL,
  `ServerIp` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `ServerCname` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `ServerCpwd` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `UpdateTime` datetime(0) NOT NULL,
  `ISDELETE` int(0) NOT NULL,
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for DeviceState
-- ----------------------------
DROP TABLE IF EXISTS `DeviceState`;
CREATE TABLE `DeviceState`  (
  `Id` int(0) NOT NULL AUTO_INCREMENT,
  `CpuUsage` int(0) NOT NULL,
  `GpuUsage` int(0) NOT NULL,
  `MemoryUsage` int(0) NOT NULL,
  `CpuTemp` int(0) NOT NULL,
  `GpuTemp` int(0) NOT NULL,
  `FdUsage` int(0) NOT NULL,
  `AUXTemp` int(0) NOT NULL,
  `A0Temp` int(0) NOT NULL,
  `ThermalTemp` int(0) NOT NULL,
  `updateTime` datetime(0) NOT NULL,
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of DeviceState
-- ----------------------------
INSERT INTO `DeviceState` VALUES (1, 0, 0, 3000, 85, 0, 0, 0, 0, 0, '2022-07-05 10:08:08');

-- ----------------------------
-- Table structure for HistoryVideo
-- ----------------------------
DROP TABLE IF EXISTS `HistoryVideo`;
CREATE TABLE `HistoryVideo`  (
  `Id` bigint(0) NOT NULL AUTO_INCREMENT,
  `fileName` varchar(900) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `UpdateTime` datetime(0) NOT NULL,
  `ISDELETE` int(0) NOT NULL,
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 71 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for InferData
-- ----------------------------
DROP TABLE IF EXISTS `InferData`;
CREATE TABLE `InferData`  (
  `ID` int(0) NOT NULL AUTO_INCREMENT,
  `ClassId` int(0) NOT NULL,
  `Num` int(0) NOT NULL,
  `Remark` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `ImageBase64` longtext CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
  `WarningTime` datetime(0) NOT NULL,
  `VideoPath` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
  `attr1` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
  `attr2` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
  `attr3` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL,
  `Warn` tinyint(0) NOT NULL,
  `uuid` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `ISDELETE` int(0) NOT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
