Query query = new Query();
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//时间格式要与mongodb对应
startDate = format.parse(filter.getValue().toString().replaceAll("-", "/"));
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
endDate = format.parse(filter.getValue().toString().replaceAll("-", "/"));
query.addCriteria(Criteria.where("createtime").gte(startDate).lte(endDate));