List<Map<String, Object>> listMapAboutSGPerson =sgBigScreenMapper.listMapAboutSGPerson(params);
if(listMapAboutSGPerson!=null && listMapAboutSGPerson.size()>0){
for (int i = 0; i < listMapAboutSGPerson.size(); i++) {
Map<String, Object> map = listMapAboutSGPerson.get(i);
// 从当前项的下一项开始检查
for (int j = i + 1; j < listMapAboutSGPerson.size(); j++) {
Map<String, Object> childMap = listMapAboutSGPerson.get(j);
// ID 相等
if (map.get("NAME_AGENTID").equals(childMap.get("NAME_AGENTID"))) {
// 合并,此处需要先 remove
listMapAboutSGPerson.remove(childMap);
map.putAll(childMap);
}
}
}
}