一.Wapper介绍
1.查询书名包含a,年龄到20-30,邮箱不为null
模糊查询 like,区间查询 between ,判断查询 isNotNull
```// 构造器
QueryWrapper wrapper=new QueryWrapper<>();
// 查询书名包含a,年龄到20-30,邮箱不为null
wrapper.like("bookname","高")
.between("age",20,30)
.isNotNull("email");
List books = bookMapper.selectList(wrapper);
books.forEach(System.out::println);
###2.排序条件
orderByDesc:降序 orderByAsc:升序
```QueryWrapper<Book> wrapper=new QueryWrapper<>();
//按照年龄降序排序,相同的话,再按照id升序
wrapper.orderByDesc("age")
.orderByAsc("id");
List<Book> books = bookMapper.selectList(wrapper);
books.forEach(System.out::println);
3.更新 好处是不用再new实体类了
//名字包含高 并且(id大于4或者detail为null) UpdateWrapper<Book> wrapper=new UpdateWrapper<>(); wrapper.like("bookname","高") .and(i->i.gt("bookid",4).or().isNull("detail")); wrapper.set("bookcounts",40); int update = bookMapper.update(null,wrapper); System.out.println(update);