public abstract class BasicQueryCompare<R,T,P> extends BasicLambda<R,T,P> implements QueryCompare<R,P>
| 限定符和类型 | 字段和说明 |
|---|---|
protected List<Object> |
queryParam |
protected MergeSqlSegment |
queryTemplate |
dbType| 构造器和说明 |
|---|
BasicQueryCompare(Class<?> exampleType,
TableMapping<?> tableMapping,
LambdaTemplate jdbcTemplate) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected R |
addCondition(Segment... segments) |
R |
and()
等于条件 查询,类似:'or ...'
|
R |
apply(String sqlString,
Object... args)
拼接 sql
!!
|
R |
between(P property,
Object value1,
Object value2)
between 语句,类似:'col between ?
|
R |
eq(P property,
Object value)
等于条件 查询,类似:'col = ?'
|
protected String |
format(Object param) |
protected Segment |
formatLikeValue(ConditionSqlDialect.SqlLike like,
Object param) |
protected Segment |
formatSegment(Object param) |
protected Segment |
formatValue(Object... params) |
R |
ge(P property,
Object value)
大于等于条件 查询,类似:'col >= ?'
|
R |
gt(P property,
Object value)
大于条件 查询,类似:'col > ?'
|
R |
in(P property,
Collection<?> value)
in 查询,类似:'col in (?
|
R |
isNotNull(P property)
not null 查询,类似:'col is not null'
|
R |
isNull(P property)
is null 查询,类似:'col is null'
|
R |
le(P property,
Object value)
小于等于条件 查询,类似:'col <= ?'
|
R |
like(P property,
Object value)
like 查询,类似:'col like CONCAT('%', ?
|
R |
likeLeft(P property,
Object value)
like 查询,类似:'col like CONCAT('%', ?)'
|
R |
likeRight(P property,
Object value)
like 查询,类似:'col like CONCAT(?
|
protected void |
lockCondition() |
R |
lt(P property,
Object value)
小于条件 查询,类似:'col < ?'
|
R |
ne(P property,
Object value)
不等于条件 查询,类似:'col <> ?'
|
R |
nested(Consumer<R> lambda)
括号方式嵌套一组查询条件
|
R |
notBetween(P property,
Object value1,
Object value2)
not between 语句,类似:'col not between ?
|
R |
notIn(P property,
Collection<?> value)
not in 查询,类似:'col not in (?
|
R |
notLike(P property,
Object value)
not like 查询,类似:'col not like CONCAT('%', ?
|
R |
notLikeLeft(P property,
Object value)
not like 查询,类似:'col not like CONCAT('%', ?)'
|
R |
notLikeRight(P property,
Object value)
not like 查询,类似:'col not like CONCAT(?
|
R |
or()
等于条件 查询,类似:'or ...'
|
buildBoundSql, buildColumnByLambda, buildColumnByProperty, dialect, exampleIsMap, exampleType, getBoundSql, getBoundSql, getJdbcTemplate, getPropertyName, getSelf, getTableMapping, isQualifier, setDialect, useQualifierclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, orprotected MergeSqlSegment queryTemplate
public BasicQueryCompare(Class<?> exampleType, TableMapping<?> tableMapping, LambdaTemplate jdbcTemplate)
public R nested(Consumer<R> lambda)
QueryComparenested 在接口中 QueryCompare<R,P>public R or()
QueryCompareor 在接口中 QueryCompare<R,P>public R and()
QueryCompareand 在接口中 QueryCompare<R,P>public R apply(String sqlString, Object... args)
QueryCompare!! 会有 sql 注入风险 !!
例1: apply("id = 1")
例2: apply("date_format(dateColumn,'%Y-%m-%d') = '2008-08-08'")
例3: apply("date_format(dateColumn,'%Y-%m-%d') = {0}", LocalDate.now())
apply 在接口中 QueryCompare<R,P>protected void lockCondition()
protected Segment formatLikeValue(ConditionSqlDialect.SqlLike like, Object param)
public R eq(P property, Object value)
QueryCompareeq 在接口中 QueryCompare<R,P>public R ne(P property, Object value)
QueryComparene 在接口中 QueryCompare<R,P>public R gt(P property, Object value)
QueryComparegt 在接口中 QueryCompare<R,P>public R ge(P property, Object value)
QueryComparege 在接口中 QueryCompare<R,P>public R lt(P property, Object value)
QueryComparelt 在接口中 QueryCompare<R,P>public R le(P property, Object value)
QueryComparele 在接口中 QueryCompare<R,P>public R like(P property, Object value)
QueryComparelike 在接口中 QueryCompare<R,P>public R notLike(P property, Object value)
QueryComparenotLike 在接口中 QueryCompare<R,P>public R likeRight(P property, Object value)
QueryComparelikeRight 在接口中 QueryCompare<R,P>public R notLikeRight(P property, Object value)
QueryComparenotLikeRight 在接口中 QueryCompare<R,P>public R likeLeft(P property, Object value)
QueryComparelikeLeft 在接口中 QueryCompare<R,P>public R notLikeLeft(P property, Object value)
QueryComparenotLikeLeft 在接口中 QueryCompare<R,P>public R isNull(P property)
QueryCompareisNull 在接口中 QueryCompare<R,P>public R isNotNull(P property)
QueryCompareisNotNull 在接口中 QueryCompare<R,P>public R in(P property, Collection<?> value)
QueryComparein 在接口中 QueryCompare<R,P>public R notIn(P property, Collection<?> value)
QueryComparenotIn 在接口中 QueryCompare<R,P>public R between(P property, Object value1, Object value2)
QueryComparebetween 在接口中 QueryCompare<R,P>public R notBetween(P property, Object value1, Object value2)
QueryComparenotBetween 在接口中 QueryCompare<R,P>Copyright © 2021–2022. All rights reserved.