List<Object>集合获取指定属性最大值的对象
List<Vo> list = dao.selectList();
if(CollectionUtils.isNotEmpty(list)) {
Optional<Vo> max = list.stream().filter(obj->ObjectUtils.isNotEmpty(obj) && ObjectUtils.isNotEmpty(obj.getPavementWidth())).max(Comparator.comparing(Vo::getPavementWidth));
if (max != null && max.isPresent()) {
BigDecimal pavementWidth = max.get().getPavementWidth();
roadTechEvaluation.setWidth(pavementWidth);
}else {
roadTechEvaluation.setWidth(new BigDecimal("4.5"));
}
}