微调
This commit is contained in:
@@ -81,7 +81,7 @@ public class InfluxQueryWrapper {
|
||||
/***
|
||||
* 初始化查询语句
|
||||
*/
|
||||
private void initSql() {
|
||||
public void initSql() {
|
||||
this.selectColumns.clear();
|
||||
this.conditions.clear();
|
||||
this.groupColumn.clear();
|
||||
@@ -95,7 +95,8 @@ public class InfluxQueryWrapper {
|
||||
* @param fieldsStr 属性值
|
||||
* 输出为 select ["influxColumn" as fieldStr]的形式
|
||||
*/
|
||||
public <T, R> InfluxQueryWrapper select(ICFunction<T, R>... fieldsStr) {
|
||||
@SafeVarargs
|
||||
public final <T, R> InfluxQueryWrapper select(ICFunction<T, R>... fieldsStr) {
|
||||
if (ArrayUtil.isNotEmpty(fieldsStr)) {
|
||||
StringBuilder selectFragment = new StringBuilder();
|
||||
Arrays.stream(fieldsStr).forEach(fieldStr -> {
|
||||
@@ -339,7 +340,9 @@ public class InfluxQueryWrapper {
|
||||
StrPool.COMMA +
|
||||
num +
|
||||
InfluxDbSqlConstant.RBK +
|
||||
InfluxDbSqlConstant.AS_VALUE;
|
||||
InfluxDbSqlConstant.AS +
|
||||
this.getColumnName(resultEntity, LambdaUtil.columnToString(columnName)) +
|
||||
StrPool.C_SPACE;
|
||||
selectColumns.add(selectFragment);
|
||||
return this;
|
||||
}
|
||||
@@ -360,7 +363,9 @@ public class InfluxQueryWrapper {
|
||||
StrPool.COMMA +
|
||||
num +
|
||||
InfluxDbSqlConstant.RBK +
|
||||
InfluxDbSqlConstant.AS_VALUE;
|
||||
InfluxDbSqlConstant.AS +
|
||||
this.getColumnName(resultEntity, LambdaUtil.columnToString(columnName)) +
|
||||
StrPool.C_SPACE;
|
||||
selectColumns.add(selectFragment);
|
||||
return this;
|
||||
}
|
||||
@@ -882,8 +887,11 @@ public class InfluxQueryWrapper {
|
||||
* @return InfluxQueryWrapper
|
||||
* 输出 columnName
|
||||
*/
|
||||
public <T, R> InfluxQueryWrapper groupBy(ICFunction<T, R> columnName) {
|
||||
groupColumn.add(this.getColumnName(measurement, LambdaUtil.columnToString(columnName)));
|
||||
@SafeVarargs
|
||||
public final <T, R> InfluxQueryWrapper groupBy(ICFunction<T, R>... columnName) {
|
||||
for (ICFunction<T, R> tricFunction : columnName) {
|
||||
groupColumn.add(this.getColumnName(measurement, LambdaUtil.columnToString(tricFunction)));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user