public interface QueryCompare<R,P>
主动调用or表示紧接着下一个方法不是用and连接!(不调用or则默认为使用and连接)
| 限定符和类型 | 方法和说明 |
|---|---|
R |
and()
等于条件 查询,类似:'or ...'
|
default R |
and(Consumer<R> lambda)
括号方式嵌套一组查询条件,与现有条件为并且关系。
|
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 = ?'
|
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(?
|
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 ...'
|
default R |
or(Consumer<R> lambda)
括号方式嵌套一组查询条件,与现有条件为或关系。
|
R or()
R and()
R apply(String sqlString, Object... args)
!! 会有 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())
R in(P property, Collection<?> value)
R notIn(P property, Collection<?> value)
Copyright © 2021–2022. All rights reserved.