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"));
}
}
标签:getPavementWidth,obj,max,最大值,List,list,isNotEmpty,属性 From: https://www.cnblogs.com/myself1012/p/17072636.html