/*
 Navicat Premium Data Transfer

 Source Server         : 47.103.213.109
 Source Server Type    : MySQL
 Source Server Version : 50737
 Source Host           : 47.103.213.109:3306
 Source Schema         : zx-java

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

 Date: 06/10/2023 18:14:15
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for zx_celue
-- ----------------------------
DROP TABLE IF EXISTS `zx_celue`;
CREATE TABLE `zx_celue`  (
  `celueid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
  `devid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备id',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '策略名称',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
  `status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '执行状态',
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '启动/关闭指令(开灯/关灯,放电/断电)',
  `triggere_time` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '定时触发条件',
  `trigger_condition` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '触发条件',
  `exe_condition` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行条件',
  `exe_relation` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行条件并列关系(0表示与，1表示或，不带则默认0（与）)',
  `action` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '触发动作',
  `delay_time` bigint(20) NULL DEFAULT NULL COMMENT '动作延迟时间,动作延迟多少秒执行。不填则为0，即不延迟，取值范围为0~86400秒。',
  `start_time` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生效开始时间',
  `end_time` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生效结束时间',
  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`celueid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '策略信息' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of zx_celue
-- ----------------------------
INSERT INTO `zx_celue` VALUES ('1694944920067', '3381bbfeffea3590', 'Cotdffin111', '12311231', '0', '', '0 0 0 * * ? *', NULL, NULL, NULL, NULL, NULL, '', '', NULL, NULL);

-- ----------------------------
-- Table structure for zx_device
-- ----------------------------
DROP TABLE IF EXISTS `zx_device`;
CREATE TABLE `zx_device`  (
  `serial` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备id',
  `terminal_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
  `model_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模型编码',
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备类型',
  PRIMARY KEY (`serial`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of zx_device
-- ----------------------------
INSERT INTO `zx_device` VALUES ('0ac571feff27fd84', '4楼光照强度传感器', 'lux', '照明设备组');
INSERT INTO `zx_device` VALUES ('0cefafd295a4', '比京电信智慧楼宇-4层龙桥华网关', 'gateway', NULL);
INSERT INTO `zx_device` VALUES ('0cefafd2a2ca', '北京电信智慧楼宇-5层会议室龙桥华', 'gateway', NULL);
INSERT INTO `zx_device` VALUES ('0cefafd605f7', '北京电信智慧楼宇-5层龙桥华网关', 'gateway', NULL);
INSERT INTO `zx_device` VALUES ('0e0bfbfeff81f68c', '5楼会议室空气质量传感器', 'aqi', NULL);
INSERT INTO `zx_device` VALUES ('1a3684feff27fd84', '5楼会议室温湿度传感器', 'temp_humid', NULL);
INSERT INTO `zx_device` VALUES ('3381bbfeffea3590', '5楼办公室电源插座右', 'plug', '开关插座设备组');
INSERT INTO `zx_device` VALUES ('439a78feff570f54', '5楼会议室双键开关', 'switch2', '开关插座设备组');
INSERT INTO `zx_device` VALUES ('45d222feff958edc', '5楼办公室人体存在', 'body_exist', NULL);
INSERT INTO `zx_device` VALUES ('48362ffeff958edc', '5楼会议室人体存在传感器', 'body_exist', NULL);
INSERT INTO `zx_device` VALUES ('5a6ac0feffea3590', '5楼办公室电源插座左', 'plug', '开关插座设备组');
INSERT INTO `zx_device` VALUES ('8d2fb9feffea3590', '5楼会议室电源插座', 'plug', '开关插座设备组');
INSERT INTO `zx_device` VALUES ('bjdxzhly-pda-001', '北京电信智慧楼宇-PDA', 'rfidpda', NULL);
INSERT INTO `zx_device` VALUES ('c14b82feff27fd84', '5楼会议室光照强度传感器', 'lux', '照明设备组');
INSERT INTO `zx_device` VALUES ('c49878feff570f54', '5楼办公室双键开关', 'switch2', '开关插座设备组');
INSERT INTO `zx_device` VALUES ('D43D391CD8C0', '会议室墨水屏门牌', 'ink_screen', NULL);
INSERT INTO `zx_device` VALUES ('e7eda5feff81f68c', '5楼办公室空气质量传感器', 'aqi', NULL);
INSERT INTO `zx_device` VALUES ('e826ecfeff81f68c', '5楼办公室光照传感器', 'lux', '照明设备组');
INSERT INTO `zx_device` VALUES ('ef5a91feff27fd84', '4楼智慧书屋温湿度传感器', 'temp_humid', NULL);
INSERT INTO `zx_device` VALUES ('rfidwy', '四楼-rfld无源设备', 'rfidwy', NULL);

-- ----------------------------
-- Table structure for zx_device_method
-- ----------------------------
DROP TABLE IF EXISTS `zx_device_method`;
CREATE TABLE `zx_device_method`  (
  `model_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模型编码',
  `method` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下行方法',
  `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下行方法名称',
  `parameter` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备型号方法' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of zx_device_method
-- ----------------------------
INSERT INTO `zx_device_method` VALUES ('plug', 'controlPlug', '切换开关', 'ctrl_ch0_status');
INSERT INTO `zx_device_method` VALUES ('switch2', 'controlSwitch2', '切换双键开关', 'ctrl_ch0_status,ctrl_ch1_status');

SET FOREIGN_KEY_CHECKS = 1;
