mybatisplus or()
时间: 2023-10-03 18:02:47 浏览: 131
mybatisplus
MyBatis Plus does not have a direct "or()" method like in traditional SQL queries. However, you can achieve similar functionality using the QueryWrapper class provided by MyBatis Plus.
You can use the or() method in QueryWrapper to build complex queries with OR conditions. Here's an example:
```java
QueryWrapper<Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column1", value1)
.or()
.eq("column2", value2)
.or()
.like("column3", value3);
```
In this example, we are building a query where "column1" is equal to "value1" OR "column2" is equal to "value2" OR "column3" contains "value3".
You can chain multiple or() methods to create more complex OR conditions in your query.
阅读全文