在 Mybatis Plus 的單表操作中 in 的相關問題

之前寫過一篇關於 in 與 not in 問題的文章(結合 Mybatis,探討 Oracle 中 in 與 not in 的陷阱),現在在擴展一下,談談 Mybatis Plus 單表操作時 in(not in) 的相關問題。

先用一個簡單的例子說明下問題,比如我們要查一年級所有同學的信息。經常會有下面這樣的寫法:

// 獲取班級ID集合
List<String> classIdList = classMapper.selectList().stream()
                    .map(Class::getClassId)
                    .collect(Collectors.toList());
// 獲取學生信息
List<Student> studentL

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章