Commit f3c4426e authored by tianyiming's avatar tianyiming

修改bug

parent 90124160
......@@ -685,7 +685,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private void getParamQuery(String paramKey, String condition, Object value, Boolean isCustom, BoolQueryBuilder boolMust, EnhancedDynamicQueryBuilder builder, String andOr) {
String path = "techParams";
String nestedFieldKey = path + ".paramKey";
String longEnd = ".longValue";
String doubleEnd = ".doubleValue";
String stringEnd = ".strValue";
NestedQueryBuilder keyNestedQuery = QueryBuilders.nestedQuery(
path,
......@@ -750,7 +750,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "gt":
NestedQueryBuilder gtQuery = QueryBuilders.nestedQuery(
path,
QueryBuilders.rangeQuery(path + longEnd).gt(value.toString()),
QueryBuilders.rangeQuery(path + doubleEnd).gt(value.toString()),
ScoreMode.Avg
);
if (isCustom) {
......@@ -762,7 +762,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "gte":
NestedQueryBuilder gteQuery = QueryBuilders.nestedQuery(
path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).gte(value.toString())),
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).gte(value.toString())),
ScoreMode.Avg
);
if (isCustom) {
......@@ -774,7 +774,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "lt":
NestedQueryBuilder ltQuery = QueryBuilders.nestedQuery(
path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).lt(value.toString())),
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).lt(value.toString())),
ScoreMode.Avg
);
if (isCustom) {
......@@ -786,7 +786,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
case "lte":
NestedQueryBuilder lteQuery = QueryBuilders.nestedQuery(
path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).lte(value.toString())),
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).lte(value.toString())),
ScoreMode.Avg
);
if (isCustom) {
......@@ -799,7 +799,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray btValues = (JSONArray) value;
NestedQueryBuilder betweenQuery = QueryBuilders.nestedQuery(
path,
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + longEnd).gte(Double.parseDouble(btValues.get(0).toString())).lte(Double.parseDouble(btValues.get(1).toString()))),
QueryBuilders.boolQuery().must(QueryBuilders.rangeQuery(path + doubleEnd).gte(Double.parseDouble(btValues.get(0).toString())).lte(Double.parseDouble(btValues.get(1).toString()))),
ScoreMode.Avg
);
if (isCustom) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment