添加方法
This commit is contained in:
@@ -132,7 +132,19 @@ public class InfluxQueryWrapper {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public <T, R> InfluxQueryWrapper select(String columnName,String resultColumnName) {
|
||||
StringBuilder selectFragment = new StringBuilder();
|
||||
|
||||
selectFragment.append(StrPool.C_SPACE)
|
||||
.append(columnName)
|
||||
.append(StrPool.C_SPACE)
|
||||
.append(InfluxDbSqlConstant.AS)
|
||||
.append(StrPool.C_SPACE)
|
||||
.append(resultColumnName)
|
||||
.append(StrPool.C_SPACE);
|
||||
selectColumns.add(selectFragment+"");
|
||||
return this;
|
||||
}
|
||||
|
||||
// /***
|
||||
// * 查询的结果属性
|
||||
@@ -160,6 +172,7 @@ public class InfluxQueryWrapper {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/************常见的简单函数处理比如max/min/mean/percentile****************/
|
||||
|
||||
/***
|
||||
@@ -917,6 +930,34 @@ public class InfluxQueryWrapper {
|
||||
return this;
|
||||
}
|
||||
|
||||
public <T, R> InfluxQueryWrapper between(String fieldName, Object val1, Object val2) {
|
||||
StringBuilder selectFragment = new StringBuilder();
|
||||
selectFragment.append(StrPool.C_SPACE)
|
||||
.append(fieldName)
|
||||
.append(InfluxDbSqlConstant.GE);
|
||||
|
||||
if (val1 instanceof String) {
|
||||
//需要用单引号包装下
|
||||
selectFragment.append(InfluxDbSqlConstant.QM)
|
||||
.append(val1)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(fieldName)
|
||||
.append(InfluxDbSqlConstant.LE)
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(val2)
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
} else {
|
||||
selectFragment.append(val1)
|
||||
.append(InfluxDbSqlConstant.AND)
|
||||
.append(fieldName)
|
||||
.append(InfluxDbSqlConstant.LE)
|
||||
.append(val2);
|
||||
}
|
||||
this.conditions.add(selectFragment.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 指定字段等于某个值
|
||||
@@ -1267,6 +1308,13 @@ public class InfluxQueryWrapper {
|
||||
return this;
|
||||
}
|
||||
|
||||
public final <T, R> InfluxQueryWrapper groupBy(String columnName) {
|
||||
|
||||
groupColumn.add(columnName);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 指定字段降序
|
||||
|
||||
Reference in New Issue
Block a user