添加公共参数和方法
This commit is contained in:
@@ -131,5 +131,29 @@ public interface InfluxDbSqlConstant {
|
||||
*/
|
||||
String TIME = "time" + StrPool.C_SPACE;
|
||||
|
||||
/**
|
||||
* 谐波电压含有率前缀
|
||||
*/
|
||||
String V = "v_";
|
||||
|
||||
/**
|
||||
* 谐波电流幅值前缀
|
||||
*/
|
||||
String I = "i_";
|
||||
|
||||
/**
|
||||
* 有功功率前缀
|
||||
*/
|
||||
String P = "p_";
|
||||
|
||||
/**
|
||||
* 无功功率前缀
|
||||
*/
|
||||
String Q = "q_";
|
||||
|
||||
/**
|
||||
* 视在功率前缀
|
||||
*/
|
||||
String S = "s_";
|
||||
|
||||
}
|
||||
|
||||
@@ -924,6 +924,26 @@ public class InfluxQueryWrapper {
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* 批量返回field key较大的百分之N的值。
|
||||
* @author xuyang
|
||||
* @param prefix 表字段名
|
||||
* @param suffix 映射名称
|
||||
* @return InfluxQueryWrapper
|
||||
* 输出 percentile(prefix+diffContent+suffix) as prefix+diffContent+suffix
|
||||
*/
|
||||
public InfluxQueryWrapper percentileSamePrefixAndSuffix(String prefix, String suffix, List<Object> diffContent, int percent) {
|
||||
if (CollectionUtil.isEmpty(diffContent)) {
|
||||
throw new RuntimeException("查询数值集合为空,请校验!");
|
||||
}
|
||||
for (Object obj : diffContent) {
|
||||
String fieldName = prefix + obj + suffix;
|
||||
this.percentile(fieldName, percent);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**************************自定义查询条件,比如between、>、<、=、>=、<=等等**************************/
|
||||
|
||||
/***
|
||||
|
||||
Reference in New Issue
Block a user