mybatis plus的条件构造器

我们在使用条件构造器的时候要使用QueryWrapper或者UpdateWrapper来充当条件语句来进行构造

QueryWrapper(LambdaQueryWrapper) 和 UpdateWrapper(LambdaUpdateWrapper) 的父类
用于生成 sql 的 where 条件, entity 属性也用于生成 sql 的 where 条件

 

 

 

条件 作用 格式
eq 等于 = new QueryWrapper.eq("字段",val)

ne

 不等于

QueryWrapper<表名> 对象 = new QueryWrapper();

对象.ne("字段",val)

gt 大于  
ge 大于等于  
lt 小于  
le 小于等于  
betwen 在...之间  
noBetween 不在....之间  
like 模糊匹配  
noLike    
likeLeft    
likeRight    
isNull    
isNotNull    
in    
notLn    

转载于:https://www.cnblogs.com/zhaoyunlong/p/10853543.html

你可能感兴趣的:(mybatis plus的条件构造器)