微服务根据时间段查询

1.前台controller

if(queryParamList.get("beginTime")!=null){

//queryParamList.addParam("chargeDate",queryParamList.get("beginTime").getValue().toString(),QueryParam.RELATION_GE);
map.put("beginTime", queryParamList.get("beginTime").getValue().toString());
queryParamList.remove("beginTime");

}
if(queryParamList.get("endTime")!=null){
Timestamp endTime = CommonUtil.addDay(Timestamp.valueOf(queryParamList.get("endTime").getValue().toString()), 1);
map.put("endTime", String.valueOf(endTime));
queryParamList.remove("endTime");
}

2.后台controller

String beginTime=map.get("beginTime");
String endTime=map.get("endTime");

if(beginTime!=null&&!"".equal(beginTime)){
queryParamList.addParam("chargeDate",Timestamp.valueOf(beginTime),QueryParam.RELATION_GE);
}
if(endTime!=null!"".equal(beginTime){
queryParamList.addParam("chargeDate",Timestamp.valueOf(endTime),QueryParam.RELATION_LT);
}

posted @ 2018-11-08 15:40  逆水乘舟,不进则退  阅读(245)  评论(0编辑  收藏  举报