From e03a3567aa5ae98cf3d17efcf8bae535d13d3860 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 02 四月 2025 20:15:27 +0800 Subject: [PATCH] POINT columnItem.getDataLength() - 1 --- iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 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 354998b..31bcd5a 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 @@ -129,7 +129,7 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='KIO测点表'; CREATE TABLE t_da_point( - `id` VARCHAR(255) NOT NULL COMMENT 'ID' , + `id` VARCHAR(36) NOT NULL COMMENT 'ID' , `point_no` VARCHAR(36) COMMENT '测点编码' , `point_name` VARCHAR(36) COMMENT '测点名称' , `point_type` VARCHAR(10) COMMENT '测点类型' , @@ -169,7 +169,7 @@ CREATE TABLE t_da_math_point( `id` VARCHAR(36) NOT NULL COMMENT 'ID' , `point_id` VARCHAR(36) COMMENT '测点ID' , - `expression` VARCHAR(500) COMMENT '计算公式' , + `expression` VARCHAR(2000) COMMENT '计算公式' , PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计算点表'; @@ -238,7 +238,8 @@ `tag_desc` varchar(64) DEFAULT NULL COMMENT '描述', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_api_tag` (`api_id`, `tag_name`) USING BTREE ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT='接口Tag表'; -- 指标管理------------ @@ -323,6 +324,8 @@ UNIQUE KEY `uk_item_id` (`item_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '派生指标'; +ALTER TABLE t_ind_item_der ADD COLUMN month_start int COMMENT '月周期开始日'; + CREATE TABLE t_ind_item_cal( `id` VARCHAR(36) NOT NULL COMMENT 'ID' , `item_id` VARCHAR(36) COMMENT '指标ID' , @@ -402,10 +405,41 @@ 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 '采集质量', + `point_no` VARCHAR(36) NOT NULL COMMENT '测点编码', + `collect_value` VARCHAR(24) COMMENT '采集值', + `collect_quality` VARCHAR(5) 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 + UNIQUE KEY `uk_point_no` (`point_no`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '测点采集状态表'; + +ALTER TABLE `t_ind_item` ADD COLUMN `solidify_flag` varchar(36) NULL COMMENT '固化标识' AFTER `status`, +MODIFY COLUMN `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' AFTER `create_time`; + +ALTER TABLE `t_ind_item_value` + MODIFY COLUMN `data_time` datetime NULL DEFAULT NULL COMMENT '数据时间' AFTER `item_no`; + +CREATE TABLE `t_arc_data` ( + `id` varchar(36) NOT NULL COMMENT 'id', + `arc_id` varchar(36) DEFAULT NULL COMMENT '归档id', + `code` varchar(30) DEFAULT NULL COMMENT '编码', + `arc_time` varchar(30) DEFAULT NULL COMMENT '归档时间', + `arc_value` DECIMAL(18,6) DEFAULT NULL COMMENT '归档值', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='归档数据表'; + +CREATE TABLE `t_arc_setting` ( + `id` varchar(36) NOT NULL COMMENT 'id', + `code` varchar(30) DEFAULT NULL COMMENT '编码', + `name` varchar(30) DEFAULT NULL COMMENT '名称', + `type` varchar(10) DEFAULT NULL COMMENT '归档周期(shift、day、month、year)', + `point` varchar(36) DEFAULT NULL COMMENT '归档点位', + `calculate` varchar(10) DEFAULT NULL COMMENT '计算方法(none、sum、diff、avg)', + `sort` int COMMENT '排序', + `is_enable` tinyint(1) DEFAULT 1 COMMENT '是否启用', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_code` (`code`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='定时归档设置表'; \ No newline at end of file -- Gitblit v1.9.3