mybatis-plus .or
时间: 2023-09-20 22:13:01 浏览: 115
MyBatis-plus 模糊查询的使用
在MyBatis-Plus中,.or()方法用于在条件构造器中使用or连接条件。当我们需要在查询条件中使用or时,可以通过调用.or()方法来实现。例如,使用.eq("id",1).or().eq("name","老王")表示查询id等于1或者name等于"老王"的记录。\[3\]这样的查询语句会生成类似于"select * from user where id = 1 or name = '老王'"的SQL语句。
#### 引用[.reference_title]
- *1* [Mybatis-Plus中and()和or()的使用与原理详解](https://blog.csdn.net/gb4215287/article/details/127420644)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Mybatis-Plus使用或“or”问题,及使用方法](https://blog.csdn.net/Ying_ph/article/details/126262500)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [MyBatisplus or使用](https://blog.csdn.net/weixin_43932663/article/details/121078402)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文