1,List<Map<String,Object>>格式
//排序 Comparator<Map<String, Object>> comparator = Comparator.comparing(item -> item.get(sortField).toString()); if (Constant.SORT_TYPE_ASC == sortType){ //升序 resourceList.sort(comparator); }else { resourceList.sort(comparator.reversed()); }
2,List<Model>格式
resultList.sort(Comparator.comparing(MetaDataModel::getOrder));
dictVoList.sort(Comparator.comparingInt(DictVo::getOrder));