为 DBA 填坑
需要对某本为 int 型字段被设为 String 的补救方法
attrList 为待排序 LIST
ATTR_ID 为排序的字段 ( 我强转 int 了,可以不转 )
List<Map<String,Object>> attrList = pimAttitudeMapper.selectAttr(param);
Collections.sort(attrList, new Comparator<Map<String, Object>>() {
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
int map1value = Integer.parseInt( o1.get("ATTR_ID").toString());
int map2value = Integer.parseInt(o2.get("ATTR_ID").toString());
return map1value - map2value;
}
});