list = totallogService.retrieve();
if (list.size() > 0) {
totallog = new Totallog();
int handled = 0;
int reported = 0;
int unassigned = 0;
int untreated = 0;
for (int i = 0; i < list.size(); i++) {
handled += list.get(i).getHandled();
reported += list.get(i).getReported();
unassigned += list.get(i).getUnassigned();
untreated += list.get(i).getUntreated();
totallog.setLastTime(list.get(i).getLastTime());
}
totallog.setHandled(handled);
totallog.setReported(reported);
totallog.setUnassigned(unassigned);
totallog.setUntreated(untreated);
list.add(totallog);
}
Java汇总List数据
最新推荐文章于 2024-07-13 02:41:55 发布