statistics

This commit is contained in:
xyj 2024-02-20 15:01:35 +08:00
parent fa26dd2418
commit 9621df8711
1 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# 数据库插入类型
import base64
import copy
import time
rfid_type = ["TEXT", "TEXT", "FLOAT", "INT32"]
@ -134,17 +135,19 @@ def is_warning(deviceId, v, t):
def insert_to_warning_sql(deviceId, v, t):
measurements[t].append("reason")
measurements[t].append("solve")
dataTypes[t].append("TEXT")
dataTypes[t].append("TEXT")
ml = copy.deepcopy(measurements[t])
dt = copy.deepcopy(dataTypes[t])
ml.append("reason")
ml.append("solve")
dt.append("TEXT")
dt.append("TEXT")
v.append("")
v.append("")
return {
"devices": ["root.warning." + deviceId],
"timestamps": [int(time.time() * 1000)],
"measurements_list": [measurements[t]],
"data_types_list": [dataTypes[t]],
"measurements_list": [ml],
"data_types_list": [dt],
"values_list": [v],
"is_aligned": False
}