QueryWrapper中常⽤⽅法,⽤法⼤全AbstractWrapper 下的及使⽤
exists的用法@H__13@
名说明使⽤
allEq(Map<R,V>
params)
全部 =(或个别 isNull)allEq(params,true)
eq=eq(“real_name”,“王昭君”)
ne<>ne(“nick_name”,“空想 4”)
gt>gt(“age”,21)
ge>=ge(“age”,22)
lt<lt(“age”,22)
le<=le(“age”,21")
between cloum between ? and ?between(“age”,21)
notBetween cloum between ? and ?notBetween(“age”,21)
like cloum like ‘% 王 %’like(“real_name”,“王”)
notLike not like ‘% 王 %’notLike(“real_name”,“王”)
likeLeft like ‘% 王’likeLeft(“real_name”,“昭”)
likeRight like ‘王 %’likeRight(“real_name”,“昭”)
isNull is null isNull(“gender”)
isNotNull is not null isNotNull(“gender”)
in in (1,2,3)in(“nick_name”,lists)
age not in (1,3)(“nick_name”,lists)
in age in (1,3,4,5,6)in(“nick_name”,"‘空想 4’,‘空想 5’,‘空想 6’") age not in (1,6)(“nick_name”,‘空想 6’")
groupBy group by id,name groupBy(“nick_name”,“age”)
orderByAsc order by id ASC,name ASC orderByAsc(“nick_name”,“age”)
orderByDesc order by id DESC,name DESC orderByDesc(“age”)
orderBy order by id ASC,name ASC orderBy(true,true,“age”)
having having sum(age) > 10having(“sum(age) > 10”)
or id = 1 or name = ‘⽼王’eq(“nick_name”,“空想 4”).or(i->i.eq(“age”,21) eq(“nick_name”,“空想4”).or().eq(“nick_name”,“空想 5”)
and and (name = ‘李⽩’ and status
<> ‘活着’)
and(i->i.eq(“age”,21))
nested (name = ‘李⽩’ and status <>
‘活着’)nested(i->i.eq(“age”,21).eq(“nick_name”,“空想 4”))
apply id = 1apply(“nick_name = ‘空想 4’”)
last 最后多个以最后的为准,有  注⼊风
last(“limit 1”)
名说明使⽤
exists拼接 EXISTS ( 语句)exists(“select id from table where age = 1”)
notExists拼接 NOT EXISTS ( 语句)notExists(“select id from table where age = 1”) QueryWrapper
继承⾃ AbstractWrapper,⾃⾝的内部 entity 也⽤于 where 条件
及 LambdaQueryWrapper,可以通过 new QueryWrapper().lambda()
@H__13@
名说明使⽤
select select(i -> i.get.startsWith(“test”))select(“id”,“name”,“age”) UpdateWrapper
继承⾃ AbstractWrapper,⾃⾝的内部 entity 也⽤于 where 条件
及 LambdaUpdateWrapper,可以通过 new UpdateWrapper().lambda() !
@H__13@
名说明使⽤
set set(“name”,“⽼李头”)set(“name”,“”)
set set(“name = ‘⽼李头’”)set(String )
参考于blog.csdn/qq_43399077/article/details/104061760
总结
以上是为你收集整理的全部内容,希望⽂章能够帮你解决所遇到的程序开发问题。
如果觉得⽹站内容还不错,欢迎将推荐给程序员好友。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。