// 两个list 含有一个共同字段,
// 其中listB 数据多,listA 数据少,根据共同字段取差集
List<AlarmArea> listA = new ArrayList<>();
List<jqDataVO> listAB = new ArrayList<>();
List<jqDataVO> dataVOS = listB.stream()
.filter(entity -> !listA.stream()
.map(e -> e.getJqbh())
.collect(Collectors.toList())
.contains(entity.getJqbh()))
.collect(Collectors.toList());
两个list 根据某个字段过滤
最新推荐文章于 2023-12-27 15:55:07 发布