@@ -57,19 +67,9 @@ public class DemoController extends BaseController {
...
@@ -57,19 +67,9 @@ public class DemoController extends BaseController {
@ApiOperation(value="demo测试influxdb")
@ApiOperation(value="demo测试influxdb")
@GetMapping("/test3")
@GetMapping("/test3")
publicvoiddemoTest2(){
publicvoiddemoTest2(){
QueryResultquery=influxDbConnection.query("select * from iot_data where time> now()-1s");
Stringsql="SELECT createdTime ,gatewayId,address,valueLabel FROM \"iot_data\" WHERE equipmentSpecificName=~/.*27风机.*/ and gatewayId='1668801435891929089' GROUP BY equipmentIndex ORDER BY time desc LIMIT 600";
Stringquerysql="SELECT createdTime ,gatewayId,address,valueLabel FROM iot_data WHERE equipmentSpecificName=~/.*"+deviceDto.getNumberName()+".*/ and gatewayId='"+deviceDto.getGateway()+"' GROUP BY equipmentIndex ORDER BY time desc LIMIT 600";
QueryResultquery=influxDbConnection.query("SELECT * FROM iot_data where \"equipmentSpecificName\" =~/.*"+deviceDto.getNumberName()+".*/ and \"gatewayId\" =~/"+deviceDto.getGateway()+"/ group by \"equipmentsIdx\" limit 1");