Commit 44bd5fb5 authored by tianyiming's avatar tianyiming

refactor: 添加SUPERVISORY_CODE非空且状态不为特定值的查询条件

parent a2d01ed5
...@@ -1302,6 +1302,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -1302,6 +1302,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE")); pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE"));
pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","")); pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE",""));
SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum(countField).field("pipeLength").missing(0); SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum(countField).field("pipeLength").missing(0);
builder.query(pipeLengthQuery);
builder.aggregation(pipeLengthAgg).size(0); builder.aggregation(pipeLengthAgg).size(0);
request.source(builder); request.source(builder);
try { try {
......
...@@ -486,7 +486,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -486,7 +486,9 @@ public class JGDPStatisticsServiceImpl {
pipeLengthQuery.must(QueryBuilders.existsQuery("pipeLength")); pipeLengthQuery.must(QueryBuilders.existsQuery("pipeLength"));
pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE")); pipeLengthQuery.must(existsQuery("SUPERVISORY_CODE"));
pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", "")); pipeLengthQuery.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE", ""));
pipeLengthQuery.mustNot(QueryBuilders.termsQuery("STATUS", Arrays.asList("草稿", "已拒领", "待认领")));
SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum("pipeLengthSum").field("pipeLength").missing(0); SumAggregationBuilder pipeLengthAgg = AggregationBuilders.sum("pipeLengthSum").field("pipeLength").missing(0);
builder.query(pipeLengthQuery);
builder.aggregation(pipeLengthAgg).size(0); builder.aggregation(pipeLengthAgg).size(0);
request.source(builder); request.source(builder);
try { try {
......
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