| 查询方法 | 说明 |
|---|---|
| eq | 等于= |
| ne | 不等于<> |
| gt | 大于> |
| ge | 大于等于>= |
| lt | 小于< |
| le | 小于等于<= |
| between | BETWEEN 值1 AND 值2 |
| notBetween | NOT BETWEEN 值1 AND 值2 |
| like | LIKE '%值%' |
| notLike | NOT LIKE '%值%' |
| in | IN (值1,值2...) |
| notIn | NOT IN (值1,值2...) |
| isNull | 字段 IS NULL |
| isNotNull | 字段 IS NOT NULL |
| allEq | 所有等于查询 |
| or | OR条件查询 |
| orderByAsc | 升序排序 |
| orderByDesc | 降序排序 |
希望在SQL语句中的添加括号
where name = 'xxx' and section = 12 or dept = 5
这里实际希望的语句是
where name = 'xxx' and (section = 12 or dept = 5)
在 QueryWrapper 中可以用 and 来处理
QueryWrapper<Member> q = new QueryWrapper<>();
q.eq("name", "xxx");
q.and(e-> e.eq("section",12)
.or().eq("dept",5));