/*
 Navicat Premium Data Transfer

 Source Server         : 测试
 Source Server Type    : MariaDB
 Source Server Version : 100318
 Source Host           : test.tall.wiki:3306
 Source Schema         : logisticspark

 Target Server Type    : MariaDB
 Target Server Version : 100318
 File Encoding         : 65001

 Date: 13/05/2021 15:12:01
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_logistics_car_record
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_car_record`;
CREATE TABLE `t_logistics_car_record`  (
  `id` bigint(20) NOT NULL COMMENT '车辆记录id',
  `car_type` tinyint(1) NULL DEFAULT 0 COMMENT '车辆类型(0-小型车,1-中型车,2-大型车)',
  `license_plate` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '车牌号',
  `plate_type` tinyint(1) NULL DEFAULT 0 COMMENT '车牌类型(0-蓝牌,1-绿牌)',
  `files_id` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '车辆照片(最多三张)',
  `car_weight` bigint(20) NULL DEFAULT 0 COMMENT '车辆重量',
  `in_out` tinyint(1) NULL DEFAULT 0 COMMENT '进出类型(0-进,1-出)',
  `car_brand` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '车辆品牌',
  `warehouse_id` bigint(20) NULL DEFAULT 0 COMMENT '厂区id',
  `record_time` bigint(20) NULL DEFAULT 0 COMMENT '记录时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `warehouse_index`(`warehouse_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '厂区车辆记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_logistics_environment_record
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_environment_record`;
CREATE TABLE `t_logistics_environment_record`  (
  `id` bigint(20) NOT NULL COMMENT '环境记录id',
  `num_value` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '测量数值',
  `num_type` tinyint(1) NULL DEFAULT 0 COMMENT '测量类型(0-湿度,1-温度,2-漏水检测)',
  `equipment_id` bigint(20) NULL DEFAULT 0 COMMENT '设备id',
  `warehouse_id` bigint(20) NULL DEFAULT 0 COMMENT '仓库id',
  `equipment_num` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '设备编号',
  `record_time` bigint(20) NULL DEFAULT 0 COMMENT '记录时间',
  `is_alarm` tinyint(1) NULL DEFAULT 0 COMMENT '是否报警(0-否,1-是)',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `warehouse_index`(`warehouse_id`) USING BTREE,
  INDEX `equipment_index`(`equipment_id`) USING BTREE,
  INDEX `num_index`(`equipment_num`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '仓库环境记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_logistics_equipment
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_equipment`;
CREATE TABLE `t_logistics_equipment`  (
  `id` bigint(20) NOT NULL COMMENT '设备id',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '设备名称',
  `equipment_number` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '设备编号',
  `equipment_type` tinyint(2) NULL DEFAULT 0 COMMENT '设备类型(0-摄像头,1-温度测试,2-湿度测试,3-漏水检测)',
  `warehouse_id` bigint(20) NULL DEFAULT 0 COMMENT '仓库id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `equipment_location` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '摄像头地址',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `warehouse_index`(`warehouse_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '仓库设备表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_logistics_heat_imaging_record
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_heat_imaging_record`;
CREATE TABLE `t_logistics_heat_imaging_record`  (
  `id` bigint(20) NOT NULL COMMENT '热成像设备记录id',
  `num_value` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '测量数值',
  `num_type` tinyint(1) NULL DEFAULT 0 COMMENT '测量类型(0-湿度,1-温度)',
  `max_t` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '最高温度',
  `max_tx` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '图像数据最高温度横坐标位置',
  `max_ty` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '图像数据最高温度纵坐标位置',
  `image_data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '图像数据编码',
  `record_time` bigint(20) NULL DEFAULT NULL COMMENT '记录时间',
  `equipment_id` bigint(20) NULL DEFAULT 0 COMMENT '设备id',
  `warehouse_id` bigint(20) NULL DEFAULT 0 COMMENT '仓库id',
  `equipment_num` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '设备编号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `equipment_index`(`equipment_id`) USING BTREE,
  INDEX `warehouse_index`(`warehouse_id`) USING BTREE,
  INDEX `num_index`(`equipment_num`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '热成像记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_logistics_park_equipment
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_park_equipment`;
CREATE TABLE `t_logistics_park_equipment`  (
  `id` bigint(20) NOT NULL COMMENT '设备id',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '设备名称',
  `equipment_number` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '设备编号',
  `equipment_type` tinyint(2) NULL DEFAULT 0 COMMENT '设备类型(0-车辆识别摄像头进,1-车辆识别摄像头出,2-红外识别摄像头,3-4G摄像头)',
  `park_id` bigint(20) NULL DEFAULT 0 COMMENT '园区id',
  `equipment_location` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '摄像头地址',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `park_index`(`park_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '园区设备表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_logistics_warehouse
-- ----------------------------
DROP TABLE IF EXISTS `t_logistics_warehouse`;
CREATE TABLE `t_logistics_warehouse`  (
  `id` bigint(20) NOT NULL COMMENT '仓库id',
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '仓库名',
  `park_id` bigint(20) NULL DEFAULT 0 COMMENT '所属园区id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `park_index`(`park_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '物流园仓库表' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
