微调
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.text.StrPool;
|
import cn.hutool.core.text.StrPool;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
import com.njcn.influx.support.ICFunction;
|
import com.njcn.influx.support.ICFunction;
|
||||||
import com.njcn.influx.utils.LambdaUtil;
|
import com.njcn.influx.utils.LambdaUtil;
|
||||||
@@ -854,6 +855,26 @@ public class InfluxQueryWrapper {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* @author hongawen
|
||||||
|
* @param fieldName 表字段名
|
||||||
|
* @param columnValues 数值集合
|
||||||
|
* @return InfluxQueryWrapper
|
||||||
|
* 输出 columnName=正则表达式
|
||||||
|
*/
|
||||||
|
public <T, R> InfluxQueryWrapper regular(ICFunction<T, R> fieldName, String columnValues) {
|
||||||
|
if (StrUtil.isEmpty(columnValues)) {
|
||||||
|
throw new RuntimeException("查询数值为空,请校验!");
|
||||||
|
}
|
||||||
|
String columnName = this.getColumnName(measurement, LambdaUtil.columnToString(fieldName));
|
||||||
|
String conditionSql = columnName + InfluxDbSqlConstant.EQ;
|
||||||
|
conditionSql = conditionSql + InfluxDbSqlConstant.REGULAR_PREFIX
|
||||||
|
+ columnValues
|
||||||
|
+ InfluxDbSqlConstant.REGULAR_SUFFIX;
|
||||||
|
conditions.add(conditionSql);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 查询条件有多个选项时,效果等同于关系型数据库的in,同时or的内容如果超过100个选项时
|
* 查询条件有多个选项时,效果等同于关系型数据库的in,同时or的内容如果超过100个选项时
|
||||||
* 会带来严重的性能问题,查询很慢
|
* 会带来严重的性能问题,查询很慢
|
||||||
@@ -878,6 +899,8 @@ public class InfluxQueryWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************* [WHERE_clause] [GROUP_BY_clause] [ORDER_BY_clause] [LIMIT_clause] [OFFSET_clause] [SLIMIT_clause] [SOFFSET_clause]*********************/
|
/********************* [WHERE_clause] [GROUP_BY_clause] [ORDER_BY_clause] [LIMIT_clause] [OFFSET_clause] [SLIMIT_clause] [SOFFSET_clause]*********************/
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|||||||
Reference in New Issue
Block a user