赞
踩
一定要注意,否则会出逻辑错误
Must: and
Should or
public Map<String,Float> queryAllUsersDailyByPage(String startDate,String endDate) { //当前用户的id String userId = UserUtils.getUserId(); Date date1=null; Date date2=null; try { date1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(startDate+" 0:0:0"); date2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endDate+" 23:59:59"); } catch (Exception ex) { } long startTimestamp = date1.getTime(); long endTimestamp = date2.getTime(); QueryBuilder queryBuilder = QueryBuilders.boolQuery() .mustNot(QueryBuilders.termQuery(DEL_FLAG, true)) .must(QueryBuilders.rangeQuery("dailyCreateTime").from(startTimestamp).to(endTimestamp)) .must(QueryBuilders.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。