From 2228b6c64ef12326e46186b301ecd4ac1a649234 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 13 十二月 2024 17:06:56 +0800
Subject: [PATCH] 更新采集状态

---
 iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql |   75 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
index 660929d..354998b 100644
--- a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
+++ b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -159,7 +159,8 @@
                                  `source_type` VARCHAR(10)   COMMENT '数据源类型',
                                  `source_id` VARCHAR(36)   COMMENT '数据源ID',
                                  `tag_no` VARCHAR(64)   COMMENT '测点Tag',
-                                 `dimension` INT   COMMENT '尺度' ,
+                                 `dimension` INT   COMMENT '平滑尺度(min)' ,
+                                 `value_type` VARCHAR(36)   COMMENT '值类型(数字量,模拟量)',
                                  PRIMARY KEY (id) USING BTREE,
                                  UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE,
                                  KEY `uk_tag_no` (`tag_no`) USING BTREE
@@ -283,7 +284,7 @@
                            `item_no` VARCHAR(36)   COMMENT '指标编码' ,
                            `item_name` VARCHAR(36)   COMMENT '指标名称' ,
                            `item_type` VARCHAR(20)   COMMENT '指标类型' ,
-                           `item_category` VARCHAR(20)   COMMENT '指标分类' ,
+                           `item_category` VARCHAR(36)   COMMENT '指标分类' ,
                            `coefficient` decimal(10, 4) COMMENT '转换系数',
                            `precision` int COMMENT '指标精度',
                            `time_granularity` VARCHAR(10)   COMMENT '时间粒度' ,
@@ -339,4 +340,72 @@
                                   PRIMARY KEY (`id`) USING BTREE,
                                   KEY `idx_item_no` (`item_no`) USING BTREE,
                                   KEY `idx_data_time` (`data_time`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='指标值表';
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='指标值表';
+
+
+-- 计划数据------------
+CREATE TABLE t_plan_data_set(
+                               `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
+                               `name` VARCHAR(30) NOT NULL   COMMENT '名称' ,
+                               `data_source` VARCHAR(64) NOT NULL   COMMENT '数据源ID',
+                               `query_sql` VARCHAR(300) NOT NULL   COMMENT '查询语句',
+                               `remark` VARCHAR(100)   COMMENT '备注',
+                               `sort` int   COMMENT '排序',
+                               `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者',
+                               `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+                               `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
+                               `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+                               PRIMARY KEY (id) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计划数据集';
+
+
+CREATE TABLE t_plan_item_category(
+                                    `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
+                                    `label` VARCHAR(20)   COMMENT '标签' ,
+                                    `pid` VARCHAR(36)   COMMENT '父ID',
+                                    `sort` int   COMMENT '排序',
+                                    `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者',
+                                    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+                                    `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
+                                    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+                                    PRIMARY KEY (id) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计划数据分类';
+
+CREATE TABLE t_plan_item(
+                           `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
+                           `item_no` VARCHAR(36)   COMMENT '指标编码' ,
+                           `item_name` VARCHAR(36)   COMMENT '指标名称' ,
+                           `item_category` VARCHAR(36)   COMMENT '指标分类',
+                           `time_granularity` VARCHAR(10)   COMMENT '时间粒度',
+                           `data_set` VARCHAR(64)   COMMENT '数据集',
+                           `remark` VARCHAR(255)   COMMENT '备注' ,
+                           `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
+                           `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者',
+                           `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+                           `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
+                           `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+                           PRIMARY KEY (id) USING BTREE,
+                           UNIQUE INDEX `uk_item_no` (`item_no`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计划数据项';
+
+CREATE TABLE t_da_cumulate_point(
+                                   `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
+                                   `point_id` VARCHAR(36)   COMMENT '测点ID' ,
+                                   `moment_point` VARCHAR(36)   COMMENT '瞬时测点' ,
+                                   `length` int COMMENT '累计长度',
+                                   `divisor` int COMMENT '除数',
+                                   PRIMARY KEY (id) USING BTREE,
+                                   UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '累计点表';
+INSERT INTO `t_da_sequence_num` (`id`, `code`, `name`, `sequence_num`, `prefix`) VALUES ('8', 'POINT_L', '累计点编码', 100001, 'L');
+INSERT INTO `iailab_plat_system`.`system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1673, 4, '累计点', 'CUMULATE', 'data_point_type', 0, '', '', '', '142', '2024-12-10 10:13:12', '142', '2024-12-10 10:13:12', b'0');
+
+CREATE TABLE t_da_point_collect_status(
+                           `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
+                           `point_id` VARCHAR(36) NOT NULL   COMMENT '测点ID',
+                           `collect_value` VARCHAR(36)   COMMENT '采集值',
+                           `collect_quality` VARCHAR(36)   COMMENT '采集质量',
+                           `collect_time` DATETIME   COMMENT '采集时间' ,
+                           PRIMARY KEY (id) USING BTREE,
+                           UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '测点采集状态表';
\ No newline at end of file

--
Gitblit v1.9.3