From 1c8d100cbf2916b797de1a0fde5c29d132ead593 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Fri, 20 Nov 2020 18:00:15 +0800 Subject: [PATCH] 增加自动修补数据定时任务 --- src/main/resources/mapper/HistoryMapper.xml | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/HistoryMapper.xml b/src/main/resources/mapper/HistoryMapper.xml index 80947b2..743b83f 100644 --- a/src/main/resources/mapper/HistoryMapper.xml +++ b/src/main/resources/mapper/HistoryMapper.xml @@ -247,4 +247,20 @@ <update id="deletePartition"> ALTER table history drop PARTITION ${p}; </update> + + <update id="createHistoryTable" parameterType="String"> + CREATE TABLE history_${yearMonthDay} ( + `mac` varchar(20) DEFAULT NULL, + `value` json DEFAULT NULL, + `time` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + KEY `_idx_mac_time` (`mac`,`time`) USING BTREE, + KEY `_idx_mac` (`mac`) USING BTREE, + KEY `_idx_time` (`time`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC + </update> + + <delete id="dropHistoryTable" parameterType="String"> + drop table history_${yearMonthDay} + </delete> </mapper> \ No newline at end of file -- Gitblit v1.8.0