(influxdb 降采样)
//按3分钟间隔带分页 查询数据
from (bucket: "testdata" ) //buckets 数据库
|> range(start:2022-07-14T11:55:00Z, stop:2022-07-16T11:05:00Z)
|> filter(fn: (r) => r._measurement == "Data_Info" and r.InfoGuid == "d339d9f2-5f5c-eb11-a223-98ac5e6c6524")
|> pivot(rowKey: [ "_time" ], columnKey: [ "_field" ], valueColumn: "_value" )
|> group(columns: [ "Data_Info"], mode: "by")
|> map(fn: (r) => ({r with _remaindervalue: float(v:(int(v: r._time)- int(v:r._start)))%180000000000.0}))
|> filter(fn: (r) => r._ remaindervalue == 0 )
|> sort(columns: ["_time"], desc: true)
|> limit(n:" + pagesize + ", offset: " + (page - 1) * pagesize + ")
|> yield()