比如查询出了所有学生的各科成绩列表,再按学生分组求
Map<Integer, Double> collect = testList.stream() .collect(Collectors.groupingBy(UserEntity::getUserId, Collectors.summingDouble(f -> Double.parseDouble(f.getScore()))));