|
|
@@ -9,16 +9,25 @@
|
|
|
CREATE TABLE IF NOT EXISTS device_${code}_${guid} using product_${code} TAGS (#{guid})
|
|
|
</update>
|
|
|
|
|
|
- <insert id="insert">
|
|
|
+ <insert id="insertDevice">
|
|
|
INSERT INTO device_${code}_${guid} (ts, line, val, msg_id,reserve, origin_time)
|
|
|
VALUES (#{ts}, #{line}, #{val}, #{msgId}, #{reserve}, #{originTime})
|
|
|
</insert>
|
|
|
- <insert id="batchInsert">
|
|
|
- INSERT INTO device_${code}_${guid} (ts, line, val, msg_id, reserve, origin_time) VALUES
|
|
|
- <foreach collection='list' item='item' index='index' separator=','>
|
|
|
+ <insert id="batchDeviceInsert">
|
|
|
+ INSERT INTO device_${data.table} (ts, line, val, msg_id, reserve, origin_time) VALUES
|
|
|
+ <foreach collection='data.data' item='item' index='index' separator=','>
|
|
|
(#{item.ts}, #{item.line}, #{item.val}, #{item.msgId}, #{item.reserve}, #{item.originTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
+ <insert id="batchDeviceInsertMore">
|
|
|
+ INSERT INTO
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" ">
|
|
|
+ device_${item.table} (ts, line, val, msg_id, reserve, origin_time) VALUES
|
|
|
+ <foreach collection="item.data" item="d" index="didx" separator=" ">
|
|
|
+ (#{d.ts}, #{d.line}, #{d.val}, #{d.msgId}, #{d.reserve}, #{d.originTime})
|
|
|
+ </foreach>
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
|
|
|
<!--源数据-->
|
|
|
<select id="createOriginal" >
|
|
|
@@ -33,13 +42,14 @@
|
|
|
INSERT INTO original_${code}_${guid} (ts, raw_str,msg_id)
|
|
|
VALUES (#{ts}, #{rawStr}, #{msgId})
|
|
|
</insert>
|
|
|
-
|
|
|
- <select id="batchInsertOriginal" resultType="int">
|
|
|
- INSERT INTO original_${code}_${guid} (ts, raw_str,msg_id) VALUES
|
|
|
- <foreach collection='list' item='item' index='index' separator=',' >
|
|
|
+ <insert id="batchInsertOriginal">
|
|
|
+ INSERT INTO
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" ">
|
|
|
+ original_${item.code}_${item.guid} (ts, raw_str,msg_id)
|
|
|
+ VALUES
|
|
|
(#{item.ts}, #{item.rawStr}, #{item.msgId})
|
|
|
</foreach>
|
|
|
- </select>
|
|
|
+ </insert>
|
|
|
|
|
|
<select id="query" resultType="com.middle.platform.data.biz.pojo.PropertyVo">
|
|
|
select line, val, ts as date
|