QueryWrapper summary :

       
Also known as conditional constructor , Inherited from AbstractWrapper, Internal properties of itself entity, Also used to generate where Conditions and LambdaQueryWapper, Can pass new
QueryWrapper().lambda() Method acquisition
QueryWrapper<Employee> wrapper = new QueryWrapper<>() QueryWrapper Common usage
Function name Description example
eq be equal to =eq("name"," Spongebob ")  →  name=" Spongebob "
ne Not equal to <>ne("name"," Spongebob ")  →  name<>" Spongebob "
gt greater than >gt("age","18")   →  age>18
ge Greater than or equal to >=ge("age","18")  →  age>=18
le Less than or equal to <=le("age","18")  →  age<=18
lt less than <lt("age","18")  →  age<18
betweenBETWEEN value 1 and value 2between("age",18,30)  →  age between 18 and 30
notBetweenNOT BETWEEN value 1 and value 2between("age",18,30)  →  age not between 18 and
30
likeLIKE '% value %'like("name"," sea ")  →  name like "% sea %"
notLikeNOT LIKE '% value %'not like("name"," sea ")  →  name like "% sea %"
likeLeftLIKE '% value 'leftLlike("name"," sea ")  →  name like "% sea "
likeRightLIKE ' value %'rightLlike("name"," sea ")  →  name like " sea %"
isNull field IS NULLisNull("name")  →  name is null
isNotNull field IS NOT NULLis Not Null("name")  →  name is not null
in field IN(v0,v1,v2,...)in("age",{1,2,3})  →  age in (1,2,3)
notIn field NOT IN(v0,v1,v2,...)notIn("age",{1,2,3})  →  age not in (1,2,3)
inSql field IN(sql sentence )inSql("id","select id from table where id<3") 
→  age in(select id from table where id<3) 
notInSql field NOT IN(sql sentence )notInSql("id","select id from table where id<3") 
→  age not in(select id from table where id<3) 
groupBy grouping :groupBygroupBy("id","name")  →  group by id,name
orderByAsc Positive sort orderByAsc("id","name")  →  order by id Asc,name Asc
orderByDesc Reverse sort orderByDesc("id","name") → order by id Desc,name Desc
orderBy sort   :ODER BY field orderBy(true,true,"id","name")→ order by id Asc,name Asc
havingHAVING(sql sentence )having("sum(age) > {0}",11) →  having sum(age) >11
or Splicing OReq("id",1).or().eq("name"," Patrick Star ")
→  id=1 or name=" Patrick Star "
andAND Nesting for nesting
apply Splicing sql Functions for database , commonly having Rarely used
last Ignore the rules and splice directly to sql Can only be called once at the end of   last("limit 1")
exists Splicing EXISTS(sql sentence )exists("select id from table where age = 1")
→exists("select id from table where age = 1")
notExists Splicing NOT EXISTS(sql sentence )notExists("select id from table where age = 1")
→not exists("select id from table where age = 1")

Technology
©2019-2020 Toolsou All rights reserved,
C++ of string of compare usage Python Study notes ( one )evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possibleRISC-V_GD32VF103-TIMER0 timer interrupt java Array subscript variable _Java Basic grammar : array be based on stm32 Control four-wheel trolley motor drive ( one ) be based on redis Design of liking function Software engineering career planning mysql Query random data by conditions _MySQL Random query of several qualified records centos7 install RabbitMq