具体代码如下所示:
alletdetailsresp alletdetailsresp = new walletdetailsresp(); list <walletdetailsresp.walletetaildail> list = new arraylist <>(); walletdetailsresp.pageinfobean pageinfobean pageinfobean pageinfobean = new Walletdetailsresp.pagep.pageinfobean inlist < arraylist <>(); types.add(nirncashtype.finisher_add_cutmoney.getCode()); types.add(nillcashtype.finisher_add_add_reward.getCode() ); types.Add(nirncashtype.finisher_sub_withdraw.getCode()); types.add(nirncashtype.finisher_add_withd_withdraw.getcode()); criteria; criteria EATCRITERIA = criteria.Where(“ _ change_type”)。在(类型)和(“ _ downstream_user_id”)。is(userId); sort.order orders; gentregation.project(“ _ canse_money”,“ _ change_type”)。 Aggregation.skip(pageIndex > 1 ? (pageIndex - 1) * pageSize : 0L), Aggregation.limit(pageSize));AggregationResults<BasicDBObject> eatOutputType = mongoTemplate.aggregate(eatAggregation, "inner_cash_change", BasicDBObject.class);for (DBObject obj : eatOutputType) { WalletDetailsresp.walletdetail WalletDetail = new WalletDetailsp.walletdetail(); walletdetail.setChangeType(integer.parseint(obj.get)(“ _ thang_type”)。toString()); walletdetail.setchangemoney(新的bigdecimal(obj.get(“ changemoney”)。tostring())。divide(qrtype.yuan_to_fen)); alletdetail.setchangedate(obj.get(“更改”)。toString()); list.add(walletdetail);} walletdetailsresp.setWalletDetails(list); pageinfobean.setpageIndex(pageindex); pageinfobean.setpagesiz e(pagesize); pageinfobean.setRecordTotal(eatOutputtype.getMappedResults()。size()); walletdetailsresp.setpageinfo(pageinfobean);总结
以上所述是小编给大家介绍的Springboot+MongodB实现按日期分组分页查询功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对武林网网站的支持!,小编会及时回复大家的。在此也非常感谢大家对武林网网站的支持!