/*
 Navicat Premium Data Transfer

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 80033
 Source Host           : localhost:3306
 Source Schema         : data_center_new

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

 Date: 08/12/2023 15:30:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for data_alarm_device_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_device_rel`;
CREATE TABLE `data_alarm_device_rel`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '局部告警的设备id',
  `access_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '设备接入id',
  `sn` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '设备SN',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '局部告警的设备数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_device_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_log
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_log`;
CREATE TABLE `data_alarm_log`  (
  `id` bigint(0) NOT NULL,
  `ts` datetime(0) NULL DEFAULT NULL,
  `alarm_value` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `level` tinyint(0) NULL DEFAULT NULL,
  `tenant_id` bigint(0) NULL DEFAULT NULL,
  `application_id` bigint(0) NULL DEFAULT NULL,
  `indicator_id` bigint(0) NULL DEFAULT NULL,
  `monitor_point_id` bigint(0) NULL DEFAULT NULL,
  `alarm_key` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_type` tinyint(0) NULL DEFAULT NULL,
  `status` tinyint(0) NULL DEFAULT NULL,
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `device_id` bigint(0) NULL DEFAULT NULL,
  `whether_push` tinyint(0) NULL DEFAULT NULL,
  `alarm_msg` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_device_type` tinyint(0) NULL DEFAULT NULL,
  `trigger_type` tinyint(0) NULL DEFAULT NULL,
  `alarm_object` tinyint(0) NULL DEFAULT 1,
  `application_ids` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `trigger_elements` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_log
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push`;
CREATE TABLE `data_alarm_push`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `push_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '通知名称',
  `push_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `push_type_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警通知方式，系统消息，邮件，短信',
  `popup_type` tinyint(1) NULL DEFAULT NULL COMMENT '弹窗方式：1：手动关闭 2：自动关闭',
  `popup_audio` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '弹窗音频地址',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `tenant_id` bigint(0) NULL DEFAULT NULL,
  `always_push` tinyint(1) NULL DEFAULT NULL COMMENT '每次都推送，0：否，1：是',
  `cycle_number` int(0) NULL DEFAULT NULL COMMENT '每多少条推送一次',
  `max_number` int(0) NULL DEFAULT NULL COMMENT '最多多少条（结合ignore_number）',
  `interval_minutes` int(0) NULL DEFAULT NULL COMMENT '间隔分钟数',
  `alarm_push_template_id` bigint(0) NULL DEFAULT NULL,
  `enable` tinyint(1) NULL DEFAULT NULL COMMENT '是否可用，0禁用，1可用',
  `push_rule` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '告警规则',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '局部告警的设备数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_condition
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_condition`;
CREATE TABLE `data_alarm_push_condition`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `push_content` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '推送内容',
  `level` tinyint(0) UNSIGNED NULL DEFAULT 1 COMMENT '等级',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `push_type` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '推送类型0 短信 1邮箱',
  `contact_info` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '联系方式 json数组格式，只能存在手机或者邮箱一种',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id 水库用',
  `rule_id` bigint(0) NULL DEFAULT NULL COMMENT '规则id',
  `alarm_status` tinyint(0) UNSIGNED NULL DEFAULT 1 COMMENT '告警状态 1告警状态 0解除告警',
  `push_status` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '推送状态，用于处理恢复时每条规则都推送情况 0未推送1已推送',
  `push_object` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '推送对象，用于设备管家回显',
  `tiger_num` int(0) UNSIGNED NULL DEFAULT 1 COMMENT '多少次报警触发',
  `sent_num` int(0) UNSIGNED NULL DEFAULT 1 COMMENT '发送次数（发送对应次数后使用）',
  `interval_time` decimal(5, 2) UNSIGNED NULL DEFAULT NULL COMMENT '间隔时间（小时）',
  `alarm_num` int(0) NULL DEFAULT 0 COMMENT '告警次数，用于统计多少次告警了',
  `has_sent_num` int(0) UNSIGNED NULL DEFAULT 0 COMMENT '已经发送次数',
  `push_param` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '推送参数',
  `service_provider` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '服务方',
  `create_at` bigint(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_at` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '需要告警后推送的条件' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_condition
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_log
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_log`;
CREATE TABLE `data_alarm_push_log`  (
  `id` bigint(0) NOT NULL,
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `alarm_push_id` bigint(0) NULL DEFAULT NULL COMMENT '告警推送配置id',
  `alarm_push_template_id` bigint(0) NULL DEFAULT NULL COMMENT '告警推送模板id',
  `push_content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '推送内容',
  `push_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '推送类型，system，sms，email',
  `status` tinyint(1) NULL DEFAULT NULL COMMENT '推送状态，0：失败；1：成功',
  `indicator_id` bigint(0) NULL DEFAULT NULL COMMENT '监测指标id',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `device_id` bigint(0) NULL DEFAULT NULL,
  `trigger_type` tinyint(1) NULL DEFAULT NULL COMMENT '触发器类型，0：设备离线；1：设备失联；2：监测要素；3：监测指标；4：特征值告警；5：设备离线比例',
  `level` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '告警等级',
  `push_time` datetime(0) NULL DEFAULT NULL COMMENT '告警推送时间',
  `user_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名称',
  `real_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `phone_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号',
  `email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `user_id` bigint(0) NULL DEFAULT NULL,
  `wait_number` int(0) NULL DEFAULT 0,
  `create_at` bigint(0) NULL DEFAULT NULL COMMENT '推送时间',
  `update_at` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_log
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_record
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_record`;
CREATE TABLE `data_alarm_push_record`  (
  `id` bigint(0) NOT NULL,
  `push_content` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '推送内容',
  `push_type` tinyint(1) NULL DEFAULT NULL COMMENT '推送类型',
  `status` tinyint(1) NULL DEFAULT NULL COMMENT '推送状态',
  `monitor_indicator` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '监测指标',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `level` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '告警等级',
  `reservoir_id` bigint(0) NULL DEFAULT NULL COMMENT '水库id',
  `alarm_type` tinyint(1) NULL DEFAULT NULL COMMENT '告警类型',
  `push_condition_id` bigint(0) NULL DEFAULT NULL COMMENT '推送条件id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `alarm_time` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警时间',
  `alarm_key` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警key',
  `push_rule` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '推送规则',
  `alarm_value` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警value',
  `contact_add` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '联系地址',
  `alarm_rule` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '告警规则',
  `create_at` bigint(0) NULL DEFAULT NULL COMMENT '推送时间',
  `update_at` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_record
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_tag_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_tag_rel`;
CREATE TABLE `data_alarm_push_tag_rel`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `tag_key` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标签key',
  `tag_value` bigint(0) NULL DEFAULT NULL COMMENT '标签值',
  `alarm_push_id` bigint(0) NULL DEFAULT NULL COMMENT '告警推送id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_tag_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_template
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_template`;
CREATE TABLE `data_alarm_push_template`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `push_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `push_type_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警通知方式，系统消息，邮件，短信',
  `push_template_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `push_template_content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL,
  `enable` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用1启用 0关闭',
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `tenant_id` bigint(0) NULL DEFAULT NULL,
  `create_at` datetime(0) NULL DEFAULT NULL,
  `update_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '局部告警的设备数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_template
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_template_tag_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_template_tag_rel`;
CREATE TABLE `data_alarm_push_template_tag_rel`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `tag_key` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标签key',
  `tag_value` bigint(0) NULL DEFAULT NULL COMMENT '标签值',
  `alarm_push_template_id` bigint(0) NULL DEFAULT NULL COMMENT '告警推送模板id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_template_tag_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_push_user
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_push_user`;
CREATE TABLE `data_alarm_push_user`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `user_id` bigint(0) NULL DEFAULT NULL,
  `user_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `real_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `phone_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_push_id` bigint(0) NULL DEFAULT NULL COMMENT '告警推送id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  `tenant_id` bigint(0) NULL DEFAULT NULL,
  `application_id` bigint(0) NULL DEFAULT NULL,
  `user_center_super` tinyint(1) NULL DEFAULT NULL,
  `application_super` tinyint(1) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_push_user
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_rule
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_rule`;
CREATE TABLE `data_alarm_rule`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `unique_id` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `template_id` bigint(0) NULL DEFAULT NULL COMMENT '模板id',
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `product_id` bigint(0) NULL DEFAULT NULL,
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `alarm_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警名称',
  `global_flag` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '使用范围 默认0全局 1局部',
  `enable` tinyint(1) NULL DEFAULT 1 COMMENT '是否启用1启用 0关闭',
  `alarm_object` tinyint(1) NULL DEFAULT 1 COMMENT '告警对象，0：设备；1：测点。',
  `line_type` tinyint(1) NULL DEFAULT 0 COMMENT '组合形式，0：按等级排序；1：and；2：or。',
  `alarm_device_type` tinyint(1) NULL DEFAULT 0 COMMENT '告警设备类型，0：具体设备；1：同产品型号设备；2：同租户设备；3：同应用设备；4：同设备模板设备',
  `trigger_type` tinyint(1) NULL DEFAULT 0 COMMENT '触发器类型，0：设备离线；1：设备失联；2：监测要素；3：监测指标；4：特征值告警；5：设备离线比例',
  `user_name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `whether_summary` bigint(0) NULL DEFAULT NULL COMMENT '是否汇总',
  `alarm_msg` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `create_at` datetime(0) NULL DEFAULT NULL,
  `update_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用于设定监测的告警类型、推送规则以及相关规则' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_rule
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_rule_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_rule_rel`;
CREATE TABLE `data_alarm_rule_rel`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `monitor_alarm_id` bigint(0) NULL DEFAULT NULL COMMENT '告警规则 json格式',
  `alarm_type` tinyint(0) UNSIGNED NULL DEFAULT NULL COMMENT '告警类型 0设备离线、1设备失联、2监测要素、3监测指标',
  `level` tinyint(1) NULL DEFAULT 1 COMMENT '告警等级',
  `alarm_rule` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '具体告警配置',
  `aviator` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '规则表达式',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_rule_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_sub_rule
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_sub_rule`;
CREATE TABLE `data_alarm_sub_rule`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL COMMENT '告警规则 json格式',
  `level` tinyint(1) NULL DEFAULT 1 COMMENT '告警等级',
  `alarm_rule` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '具体告警配置',
  `dead_zone` double NULL DEFAULT NULL COMMENT '死区',
  `offline_duration` int(0) NULL DEFAULT NULL COMMENT '离线时长检测',
  `duration` int(0) NULL DEFAULT NULL,
  `offline_times` int(0) NULL DEFAULT NULL,
  `offline_percent` int(0) NULL DEFAULT NULL,
  `aviator` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '规则表达式',
  `ignore_aviator` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '死区、步长设置，用于判断数据是否忽略告警',
  `alarm_value_field` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_sub_rule
-- ----------------------------

-- ----------------------------
-- Table structure for data_alarm_summary
-- ----------------------------
DROP TABLE IF EXISTS `data_alarm_summary`;
CREATE TABLE `data_alarm_summary`  (
  `id` bigint(0) UNSIGNED NOT NULL,
  `ts` timestamp(0) NULL DEFAULT NULL,
  `alarm_rule_id` bigint(0) NULL DEFAULT NULL,
  `alarm_end_time` timestamp(0) NULL DEFAULT NULL,
  `new_ts` timestamp(0) NULL DEFAULT NULL,
  `release_time` timestamp(0) NULL DEFAULT NULL,
  `alarm_key` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_value` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_type` tinyint(0) NULL DEFAULT NULL,
  `status` tinyint(0) NULL DEFAULT NULL,
  `flow_status` tinyint(0) NULL DEFAULT 0 COMMENT '流转状态,1:已流转;0:未流转',
  `level` tinyint(0) NULL DEFAULT NULL,
  `device_id` bigint(0) NULL DEFAULT NULL,
  `monitor_point_id` bigint(0) NULL DEFAULT NULL,
  `monitor_point_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `alarm_rule` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `push_condition_id` bigint(0) NULL DEFAULT NULL,
  `monitor_tags_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `indicator_id` bigint(0) NULL DEFAULT NULL,
  `application_id` bigint(0) NULL DEFAULT NULL,
  `tenant_id` bigint(0) NULL DEFAULT NULL,
  `last_one` int(0) NULL DEFAULT 1,
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_alarm_summary
-- ----------------------------

-- ----------------------------
-- Table structure for data_device_alarm_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_device_alarm_rel`;
CREATE TABLE `data_device_alarm_rel`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备id',
  `device_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '设备名称',
  `alarm_time` datetime(0) NULL DEFAULT NULL COMMENT '告警时间',
  `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 0:未处理;1:已处理',
  `alarm_key` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警键值',
  `alarm_value` double NULL DEFAULT NULL COMMENT '告警数据',
  `alarm_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警名称',
  `handle_user` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '处理人',
  `handle_time` datetime(0) NULL DEFAULT NULL COMMENT '处理时间',
  `handle_remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '处理备注',
  `application_ids` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '应用ids',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '预警广播设备告警数据表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_device_alarm_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_device_monitor_formula
-- ----------------------------
DROP TABLE IF EXISTS `data_device_monitor_formula`;
CREATE TABLE `data_device_monitor_formula`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `formula` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '计算公式',
  `indicator` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '计算获取的指标 多个逗号隔开',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `parameter` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '计算参数 多个逗号隔开',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `type` tinyint(1) NULL DEFAULT NULL COMMENT '类型 0EL 1外部接口 ',
  `formula_param` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公式参数json',
  `request_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '请求地址',
  `init_json` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '初始值(json)',
  `init_flag` tinyint(1) NULL DEFAULT NULL COMMENT '初值是否已经使用1使用 0未使用',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_device_monitor_formula
-- ----------------------------

-- ----------------------------
-- Table structure for data_device_monitor_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_device_monitor_rel`;
CREATE TABLE `data_device_monitor_rel`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `server_code` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '服务编码',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备id',
  `template_id` bigint(0) NULL DEFAULT NULL COMMENT '模板id',
  `template_field` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模板字段',
  `monitor_indicator` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '监测指标',
  `monitor_field` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '监测指标对应的要素',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `monitor_point_name` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '测点名称',
  `monitor_tags_name` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '水库名称 结构名称',
  `base_point` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '是否为基站点0否1是 默认是，数据不做处理',
  `base_id` bigint(0) NULL DEFAULT NULL COMMENT '基站点ID 不为基站点时才有',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `INDEX_UK_MONITORID_FIELD`(`monitor_field`, `monitor_point_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_device_monitor_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_constant
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_constant`;
CREATE TABLE `data_indicator_constant`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `indicator_id` bigint(0) NULL DEFAULT NULL,
  `server_code` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `constant_key` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '监测指标常量key',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_constant
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_output_formula
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_output_formula`;
CREATE TABLE `data_indicator_output_formula`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `indicator_id` bigint(0) NULL DEFAULT NULL,
  `server_code` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `formula_type` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公式类型：raw原始值,aviator动态公式,fixed固定公式',
  `method_annotation` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '方法标注：hourly_sum小时累积,daily_sum日累积,monthly_sum月累积,annually_sum年累积,hourly_average小时平均,daily_average日平均,monthly_average月平均,annually_average年平均',
  `formula_content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '公式内容',
  `output_indicator` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '输出指标要素',
  `field_group` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '字段组，多个固定方法需要存储于同一张表时使用',
  `base_point_logic` tinyint(1) NULL DEFAULT 0 COMMENT '1有基站点逻辑 0无基站点逻辑',
  `element_precision` int(0) NULL DEFAULT 4 COMMENT '精度',
  `remark` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '字段备注',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_output_formula
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_output_formula_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_output_formula_rel`;
CREATE TABLE `data_indicator_output_formula_rel`  (
  `id` bigint(0) NOT NULL COMMENT 'id',
  `sever_formula_id` bigint(0) NULL DEFAULT NULL,
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_output_formula_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_point
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_point`;
CREATE TABLE `data_indicator_point`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `server_code` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '服务编码',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `indicator_id` bigint(0) NULL DEFAULT NULL COMMENT '监测指标id',
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备id',
  `template_id` bigint(0) NULL DEFAULT NULL COMMENT '模板id',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `monitor_point_name` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '测点名称',
  `base_point` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '是否为基站点0否1是 默认是，数据不做处理',
  `base_id` bigint(0) NULL DEFAULT NULL COMMENT '基站点ID 不为基站点时才有',
  `monitor_tags_name` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '水库名称 结构名称',
  `init_json` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT '初始化参数,json格式',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_point
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_point_device_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_point_device_rel`;
CREATE TABLE `data_indicator_point_device_rel`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `template_field` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模板字段',
  `monitor_field` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '监测指标对应的要素',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `INDEX_UK_MONITORID_FIELD`(`monitor_field`, `monitor_point_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_point_device_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_indicator_point_tag_rel
-- ----------------------------
DROP TABLE IF EXISTS `data_indicator_point_tag_rel`;
CREATE TABLE `data_indicator_point_tag_rel`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `tag_key` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标签key',
  `tag_value` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标签值',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `INDEX_UK_MONITORID_FIELD`(`tag_value`, `monitor_point_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '设备的模板以及监测指标之间标识的关系' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_indicator_point_tag_rel
-- ----------------------------

-- ----------------------------
-- Table structure for data_monitor_alarm_rule
-- ----------------------------
DROP TABLE IF EXISTS `data_monitor_alarm_rule`;
CREATE TABLE `data_monitor_alarm_rule`  (
  `id` bigint(0) UNSIGNED NOT NULL COMMENT 'id',
  `application_id` bigint(0) NULL DEFAULT NULL COMMENT '应用id',
  `template_id` bigint(0) NULL DEFAULT NULL COMMENT '模板id',
  `device_id` bigint(0) NULL DEFAULT NULL COMMENT '设备id',
  `tenant_id` bigint(0) NULL DEFAULT NULL COMMENT '租户id',
  `monitor_point_id` bigint(0) NULL DEFAULT NULL COMMENT '测点id',
  `alarm_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '告警名称',
  `global_flag` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '使用范围 默认0全局 1局部',
  `enable` tinyint(1) NULL DEFAULT 1 COMMENT '是否启用1启用 0关闭',
  `push_rule_id` bigint(0) NULL DEFAULT NULL COMMENT '推送规则id',
  `create_at` bigint(0) NULL DEFAULT NULL,
  `update_at` bigint(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用于设定监测的告警类型、推送规则以及相关规则' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_monitor_alarm_rule
-- ----------------------------

-- ----------------------------
-- Table structure for data_push_file_message
-- ----------------------------
DROP TABLE IF EXISTS `data_push_file_message`;
CREATE TABLE `data_push_file_message`  (
  `id` bigint(0) NOT NULL,
  `even_json` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL COMMENT 'json',
  `file_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '文件名称',
  `deal_flag` tinyint(0) UNSIGNED NULL DEFAULT 0 COMMENT '1已处理0未处理',
  `create_at` bigint(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_at` bigint(0) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of data_push_file_message
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
