1、ibatis 层
<select id="getByUid" resultMap="UserComment" parameterClass="map">
{"content":{"22001":{"uid":"585012","aliasNamePinyin":"ce^shi^a^a^a^a^a","friendId":"22001","aliasName":"\u6D4B\u8BD5\u554A\u554A\u554A\u554Aa"},"22002":{"uid":"585012","aliasNamePinyin":"ce^shi^b^b","friendId":"22002","aliasName":"\u6D4B\u8BD5bb"},"22003":{"uid":"585012","aliasNamePinyin":"ce^shi^c^2","friendId":"22003","aliasName":"\u6D4B\u8BD5c2"}},"resubmitToken":"035d0af2a6ab8add7204335c66fee974","submitToken":"035d0af2a6ab8add7204335c66fee974","hasError":false}
6、返回的map结果如何使用
Map<String, UserComment> comments = this.lwUserService.getComments(securityContext.getCurrentUserId()); List<ConnectionVO> users = new ArrayList<ConnectionVO>(friends.size()); UserComment uc = null; for (BaseProfile friend : friends) { ConnectionVO connectionVO = new ConnectionVO(); connectionVO.setName(friend.getName()); connectionVO.setAvatar(friend.getAvatar()); connectionVO.setPinyin(friend.getNamePinyin()); connectionVO.setId(friend.getUid()); uc = comments.get(friend.getUid()); connectionVO.setAliasName(uc == null ? null : uc.getAliasName()); connectionVO.setAliasNamePinyin(uc == null ? null : uc.getAliasNamePinyin()); users.add(connectionVO); }// end for