结果转map

// 会议
Map<String, EmConfOrigInfoEntity> origConferencePool = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
origConferencePool.putAll(
emConfInfoService
.list(new QueryWrapper()
.select(“id”, “index_md”, “identifier”)
.eq(“fecth_type”, SysConstants.FECTH_TYPE_ORIG)
)
.stream()
.map(o -> Pair.of(o.getIndexMd(), o))
.collect(Collectors.groupingBy(p -> p.getLeft()))
.entrySet()
.stream().collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().get(0).getRight()))
);


文章作者: zrh
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 zrh !
  目录