微调
This commit is contained in:
@@ -2,6 +2,7 @@ package com.njcn.influx.base;
|
||||
|
||||
|
||||
import com.njcn.influx.ano.Insert;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -23,4 +24,12 @@ public interface InfluxDbBaseMapper<T> {
|
||||
*/
|
||||
@Insert
|
||||
void insertBatch(List<T> entityList);
|
||||
|
||||
/***
|
||||
* 根据查询条件返回
|
||||
* @author hongawen
|
||||
* @param influxQueryWrapper 查询条件
|
||||
* @return T
|
||||
*/
|
||||
List<T> selectByQueryWrapper(InfluxQueryWrapper influxQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -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