If you want to query using between condition with null value using MyBatis Plus's lambda query, you can use the following code snippet:

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

// ...

QueryWrapper<User> queryWrapper = Wrappers.<User>lambdaQuery();
queryWrapper.between(User::getAge, null, null);

List<User> userList = userMapper.selectList(queryWrapper);

In the above code, User is the entity class for the database table. The User::getAge represents the column name on which you want to apply the between condition. By passing null as the start and end values, it will effectively select all rows without any specific range limitation.

Note that you need to replace User with your actual entity class and User::getAge with the appropriate column in your case. Also, make sure you have the necessary imports in your code

mybatisplus lambdaQuery between User= null

原文地址: https://www.cveoy.top/t/topic/hPtH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录