MybatisPlus之QueryWrapper、LambdaQueryWrapper以及LambdaQueryChainWrapper用法
1、QueryWrapper
.like("email", "24252") //email对应数据库中列名
1 /**
2 * 条件构造器 查询操作
3 */
4 @Test
5 void TestQueryWrapperSelect() {
6 //1、条件用法
7 List<User> userList = userMapper.selectList(new QueryWrapper<User>()
8 .like("email", "24252")
9 .between("age", 20, 22)
10 .or()
11 .eq("name", "zcx")
12 );
13 System.out.println("userList:" + userList);
14
15 //2、排序用法
16 List<User> users = userMapper.selectList(new QueryWrapper<Use