public List<ZmxxNew> getGateList() {
List<ZmxxNew> list = gateDao.findAll();
List<ZmxxNew> unique =
list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ZmxxNew::getStcd))), ArrayList::new));
return unique;
}
自定义对象list,指定字段去重
最新推荐文章于 2024-03-29 11:59:32 发布