1. List<对象>过滤id数据为 List<Integer>
// 试卷id和 试卷_题库id 过滤
exPapers.forEach(paper -> {
List<ExPaperQuestion> exPaperQuestions = exPaperQuestionMapper
.selectList(Wrappers.<ExPaperQuestion>lambdaQuery().eq(ExPaperQuestion::getPaperId, paper.getId()));
// 过滤出题库id
List<Integer> questionIds = exPaperQuestions.stream()
.map(ExPaperQuestion::getQuestionId)
.collect(Collectors.toList());
2. 过滤出需要的id集合
// 过滤出需要的ID
List<ExQuestion> filteredQuestions = exQuestions.stream()
.filter(question -> questionIds.contains(question.getId()))
.collect(Collectors.toList());