用能空调代码提交 终端相关代码修改

This commit is contained in:
2022-07-01 09:17:51 +08:00
parent 7affd72b1d
commit 76ea96e316
38 changed files with 575 additions and 108 deletions

View File

@@ -0,0 +1,33 @@
package com.njcn.influxdb.utils;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* pqs
*
* @author cdf
* @date 2022/7/1
*/
@Component
public class InfluxDBCommUtils {
/**
* 组装为influxdb监测点参数
*
* @param lineIds 监测点参数
* @return StringBuilder
*/
public static StringBuilder assToInfluxParam(List<String> lineIds){
StringBuilder lineIdsStr = new StringBuilder("(");
for (int i = 0; i < lineIds.size(); i++) {
if (lineIds.size() - i != 1) {
lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("' or ");
} else {
lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("') ");
}
}
return lineIdsStr;
}
}