list<map<string,object>> 按照某字段排序
List<Map<String,Object>> groupList1 = Lists.newArrayList(); // groupList1 这是你自己用来接受查询出来的数据的集合。 // return (Long)o1.get("score")>(Long)o2.get("score")?1:( (Long)o1.get("score")==(Long)o2.get("score")?0:-1);//这是从小到大 // return (Long)o1.get("score")<(Long)o2.get("score")?1:( (Long)o1.get("score")==(Long)o2.get("score")?0:-1);//这是从大到小 groupList1.sort((o1, o2) -> { double groupScore1 = Double.parseDouble(o1.get("score").toString()); double groupScore2 = Double.parseDouble(o2.get("score").toString()); return Double.compare(groupScore2, groupScore1); });