Java Stream 计算总和 Stream聚合函数对数据求和、最大、最小、平均
BigDecimal total = tOrderOrders.stream() .map(TOrderOrder::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
list.stream().mapToDouble(User::getHeight).sum()//和 list.stream().mapToDouble(User::getHeight).max()//最大 list.stream().mapToDouble(User::getHeight).min()//最小 list.stream().mapToDouble(User::getHeight).average()//平均值