Map<String,List<String>> 心已赠人 2022-10-12 01:32 155阅读 0赞 List<Map<String,String>> jiaoXueJiHuaList = testMapper.selectJiaoXueJiHuaList(); Map<String,List<String>> jiaoXueJiHuaMap = new HashMap<>(); for (Map<String, String> map : jiaoXueJiHuaList) { List<String> kchList = new ArrayList<>(); jiaoXueJiHuaMap.put(map.get("id"),kchList); } List<Map<String,String>> jHuaKeChengList = testMapper.selectJiaoXueJiHuaKeChengList() ; for (Map<String, String> map : jHuaKeChengList ) { List<String> kchList = jiaoXueJiHuaMap.get(map.get("id")); kchList.add(map.get("kch")); jiaoXueJiHuaMap.put(map.get("id"),kchList); } List<Map<String,String>> mxOldList = testMapper.getMxOldList(); Map<String, List<String>> mxKchMap = new HashMap<>(); for (Map<String, String> map : mxOldList) { String xh = map.get("xh"); List<String> mxKchList = mxKchMap.get(xh); if (mxKchList != null && mxKchList.size()>0){ mxKchList.add(map.get("kch")); }else{ mxKchList = new ArrayList<>(); mxKchList.add(map.get("kch")); } mxKchMap.put(xh,mxKchList); }
还没有评论,来说两句吧...