QueryWrapper的in
时间: 2023-10-14 07:04:00 浏览: 81
在使用QueryWrapper的in方法时,需要将要查询的值作为一个List参数传入。比如,如果要查询type字段在某个列表中的数据,可以创建一个List<String>类型的变量typeList,并将要查询的值添加到该列表中,然后将该列表作为in方法的参数传入。例如,可以使用以下代码实现:
List<String> typeList = new ArrayList<>();
typeList.add("A");
typeList.add("B");
queryWrapper.in("type", typeList);
这样就可以查询出type字段在typeList列表中的数据了。引用<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [QueryWrapper的用法大全](https://blog.csdn.net/m0_59835914/article/details/129527290)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [mybatisPlus中QueryWrapper的in使用方法](https://blog.csdn.net/hs_shengxiaguangnian/article/details/115274483)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文