1. 正序: 1,2,3,4,5 list.stream().sorted(Comparator.comparing(Dto::getStateCode)).collect(Collectors.toList()); 2.降序: 5,4,3,2,1 .reversed() list.stream().sorted(Comparator.comparing(Dto::getStateCode).reversed()).collect(Collectors.toList());