List<CustomerAppDatasVo> dataslist = customerItemService.getPagegetdatas4( customerItem, customerSystemUser);
Double Yzgmv = dataslist.stream().filter(v ->v.getYzgmv()!=null).mapToDouble(CustomerAppDatasVo::getYzgmv).sum();
Integer sum = list.stream().mapToInt(User::getAge).sum();
System.out.println("年龄总和:" +sum);
Integer max = list.stream().mapToInt(User::getAge).max().orElse(0);
System.out.println("年龄 最大:" + max);
Integer min = list.stream().mapToInt(User::getAge).min().orElse(0);
System.out.println("年龄 最小:" + min);
Double average = list.stream().mapToInt(User::getAge).average().orElse(0l);
System.out.println("年龄 平均:" + df.format(average));
filter 是条件 v 是list 里元素 ==CustomerAppDatasVo , sum 是求和
详细介绍
https://blog.csdn.net/Bulldozer_GD/article/details/120282028