mybatisplus querywrapper isnull
时间: 2023-09-01 12:12:12 浏览: 127
MyBatis-Plus QueryWrapper provides a convenient way to construct SQL queries in MyBatis, including conditions like "IS NULL". To use the "IS NULL" condition in QueryWrapper, you can use the method `isNull` on the desired column. Here's an example:
```java
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
QueryWrapper<Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.isNull("column_name");
```
In the above example, replace `"column_name"` with the actual name of the column in your entity where you want to check for null values. This will generate a SQL condition for checking if the specified column is null.
You can also combine multiple conditions using other methods provided by QueryWrapper, such as `eq`, `ne`, `gt`, `ge`, `lt`, `le`, etc.
阅读全文