if(CollectionUtils.isNotEmpty(resultList)){
Collections.sort(resultList, new Comparator<Map<String,Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
String total1 = String.valueOf(o1.get("total"));
String total2 = String.valueOf(o2.get("total"));
int total = total2.compareTo(total1);//降序排序
if(total != 0){
return total;
}
String time1 = String.valueOf(o1.get("greateTime"));
String time2 = String.valueOf(o2.get("greateTime"));
return time2.compareTo(time1);//降序排序
}
});
}