赞
踩
1、sql语句为A or B , A and B这种简单连接:
//A and B:
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>()
.eq("name",name)
.eq("age",age);
A or B:
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>()
.eq("name",name)
.or()
.eq("age",age);
2、复杂有优先级的的连接
//A and ( B or C) and D:
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>()
.eq("name", name)
.and(qr -> qr.ne("age", age).or().isNull("age")
.and(qr -> qr.eq("subject", subject));
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。