问题:

Criteria criteria = new Criteria();
criteria.where("shopId")
.is(request.getShopId())
.and("tradeDate").gte(request.getBeginTradeDate())
.lte(request.getEndTradeDate());
List<ReportInfo> reportInfoList = reportMongoTemplate.
find(new Query(criteria), ReportInfo.class,"rept_wallet_refundAndPay");

原因:

MongoTemplate 源码

    public static Criteria where(String key) {
return new Criteria(key);
}

修改

Criteria criteria = Criteria.where("shopId")
.is(request.getShopId())
.and("tradeDate").gte(request.getBeginTradeDate())
.lte(request.getEndTradeDate());
List<ReportInfo> reportInfoList = reportMongoTemplate.
find(new Query(criteria), ReportInfo.class,"rept_wallet_refundAndPay");

总结:

05-28 22:41