Page page = new Page(); page.setPageSize(1000); page.setPageNum(1); do{ //获取所有用户余额 com.github.pagehelper.Page<AccountFinanceBillParam> pages = PageHelper.startPage(page.getPageNum(),page.getPageSize()); List<MemberAccountBean> list = memberBalanceMapper.findMemberBalanceList(); if(list != null && !list.isEmpty()){ List<MemberBalance> balanceList = new ArrayList<MemberBalance>(); for(MemberAccountBean account: list){ MemberBalance entity = new MemberBalance(); entity.setId(UF.getRandomUUID()); entity.setDay(currentDate.toString()); entity.setMemberId(account.getMemberId()); entity.setAmount(account.getUsableAmount()); balanceList.add(entity); } memberBalanceMapper.insert(balanceList); }else{ logger.info("账户统计没有数据了");break; //跳出循环 } // 下一页 page.setPageNum(page.getPageNum() + 1); }while(true);
批量定时任务
最新推荐文章于 2024-07-27 18:55:33 发布