添加历史记录创建时间,如某一天的历史记录查询字段
This commit is contained in:
+10
-1
@@ -47,12 +47,20 @@ public class HistoryFlightDataController {
|
|||||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
|
||||||
|
|
||||||
//获取前一天的历史数据 根据实际时间
|
//获取前一天的历史数据 根据实际时间
|
||||||
|
|
||||||
|
String hstFLightTime = conditions.getHstFLightTime();
|
||||||
String hitStartTime = DateUtils.getNewDateOfDayMixOrMaxTime(new Date(), "Day", -1, "MIN");
|
String hitStartTime = DateUtils.getNewDateOfDayMixOrMaxTime(new Date(), "Day", -1, "MIN");
|
||||||
String hitEndTime = DateUtils.getNewDateOfDayMixOrMaxTime(new Date(), "Day", -1, "MAX");
|
String hitEndTime = DateUtils.getNewDateOfDayMixOrMaxTime(new Date(), "Day", -1, "MAX");
|
||||||
|
if(!StringUtils.isEmpty(conditions.getHstFLightTime())){
|
||||||
|
hitStartTime = DateUtils.swichTimeToEn_ddMMMyyHHmm(hstFLightTime +" 00:00:00");
|
||||||
|
hitEndTime = DateUtils.swichTimeToEn_ddMMMyyHHmm(hstFLightTime +" 23:59:59");
|
||||||
|
}
|
||||||
|
|
||||||
boolQuery.must(QueryBuilders.rangeQuery("ACTT")
|
//历史创建使劲
|
||||||
|
boolQuery.must(QueryBuilders.rangeQuery("SODT")
|
||||||
.gte(hitStartTime).lte(hitEndTime));
|
.gte(hitStartTime).lte(hitEndTime));
|
||||||
|
|
||||||
|
//计划开始结束时间
|
||||||
if(!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)){
|
if(!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)){
|
||||||
boolQuery.must(QueryBuilders.rangeQuery("SODT")
|
boolQuery.must(QueryBuilders.rangeQuery("SODT")
|
||||||
.gte(startTime).lte(endTime));
|
.gte(startTime).lte(endTime));
|
||||||
@@ -65,6 +73,7 @@ public class HistoryFlightDataController {
|
|||||||
boolQuery.must(QueryBuilders.rangeQuery("SODT")
|
boolQuery.must(QueryBuilders.rangeQuery("SODT")
|
||||||
.lte(startTime));
|
.lte(startTime));
|
||||||
}
|
}
|
||||||
|
//到达or离港
|
||||||
if(!StringUtils.isEmpty(MVIN)){
|
if(!StringUtils.isEmpty(MVIN)){
|
||||||
boolQuery.must(QueryBuilders.termQuery("MVIN", MVIN));
|
boolQuery.must(QueryBuilders.termQuery("MVIN", MVIN));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,21 @@ public class HistoryFilghtConditionDto {
|
|||||||
@ApiModelProperty(value="出发/到达",example="到达/出发(进港/出港)标志,A-到达、D-出发")
|
@ApiModelProperty(value="出发/到达",example="到达/出发(进港/出港)标志,A-到达、D-出发")
|
||||||
private String MVIN;
|
private String MVIN;
|
||||||
|
|
||||||
@ApiModelProperty(value="开始时间",example="开始时间(yyyy-mm-dd HH:mm)")
|
@ApiModelProperty(value="计划开始时间",example="开始时间(yyyy-mm-dd HH:mm)")
|
||||||
private String startSODT;
|
private String startSODT;
|
||||||
@ApiModelProperty(value="结束时间",example="结束时间(yyyy-mm-dd HH:mm)")
|
@ApiModelProperty(value="计划结束时间",example="结束时间(yyyy-mm-dd HH:mm)")
|
||||||
private String endSODT;
|
private String endSODT;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="历史时间",example="查询某天的计划(yyyy-mm-dd),默认查询昨天的历史")
|
||||||
|
private String hstFLightTime;
|
||||||
|
|
||||||
|
|
||||||
|
public String getHstFLightTime() {
|
||||||
|
return hstFLightTime;
|
||||||
|
}
|
||||||
|
public void setHstFLightTime(String hstFLightTime) {
|
||||||
|
this.hstFLightTime = hstFLightTime;
|
||||||
|
}
|
||||||
public String getMVIN() {
|
public String getMVIN() {
|
||||||
return MVIN;
|
return MVIN;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user