1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| queryWrapper.and(qw -> qw.like("title", searchText).or().like("content", searchText));
queryWrapper.like(StringUtils.isNotBlank(title), "title", title);
【不等于】queryWrapper.ne(ObjectUtils.isNotEmpty(notId), "id", notId); 【等于】queryWrapper.eq(ObjectUtils.isNotEmpty(id), "id", id);
【大于】 queryWrapper.gt("last_name", "values"); -> sql 语句 where last_name >"values" 【大于等于】 queryWrapper.ge("last_name", "values"); -> sql 语句 where last_name>="values" 【小于】 queryWrapper.lt("last_name", "values"); -> sql 语句 where last_name <"values" 【小于等于】 queryWrapper.le("last_name", "values"); -> sql 语句 where last_name <="values"
【在a与b之间】queryWrapper.between("last_name",a,b) -> sql 语句 where last_name (between a and b); 【不在a与b之间】queryWrapper.notBetween("last_name",a,b) -> sql 语句 where last_name (Not between a and b);
【字段值包含】queryWrapper.like("last_name","v") -> sql 语句 where last_name like %v%; 【字段值不包含】 queryWrapper.notlike("last_name","v") -> sql 语句 where last_name notlike %v%; 【字段值开头匹配】 queryWrapper.likeLeft("last_name","v") -> sql 语句 where last_name notlike %v; 【字段值结尾匹配】 queryWrapper.notlike("last_name","v") -> sql 语句 where last_name notlike v%;
【字段值为空的】 queryWrapper.isNull("last_name") -> sql 语句 where last_name is null; 【字段值不为空的】 queryWrapper.isNotNull("last_name") -> sql 语句 where last_name is not null;
【字段值在区间内】 queryWrapper.in("last_name",a,b,c) -> sql 语句 where last_name in(a,b,c); 【字段值不在区间内】 queryWrapper.notin("last_name",a,b,c) -> sql 语句 where last_name not in(a,b,c);
【多条件】 queryWrapper.notin("last_name",a,b,c).or().eq("name","aa");-> sql 语句 where last_name not in(a,b,c) or name = "aa"; queryWrapper.notin("last_name",a,b,c).and().eq("name","aa");-> sql 语句 where last_name not in(a,b,c) and name = "aa";
【正序】 queryWrapper.orderByAsc("id"); -> sql 语句 orderByAsc "id" 【倒序】 queryWrapper.orderByDesc("id"); -> sql 语句 orderByDesc"id"
|