public interface Join<Children> extends Serializable
拼接
| 限定符和类型 | 方法和说明 |
|---|---|
Children |
apply(boolean condition,
String applySql,
Object... value)
拼接 sql
!!
|
default Children |
apply(String applySql,
Object... value)
ignore
|
Children |
exists(boolean condition,
String existsSql)
拼接 EXISTS ( sql语句 )
!!
|
default Children |
exists(String existsSql)
ignore
|
Children |
last(boolean condition,
String lastSql)
无视优化规则直接拼接到 sql 的最后(有sql注入的风险,请谨慎使用)
例: last("limit 1")
注意只能调用一次,多次调用以最后一次为准
|
default Children |
last(String lastSql)
ignore
|
Children |
notExists(boolean condition,
String notExistsSql)
拼接 NOT EXISTS ( sql语句 )
!!
|
default Children |
notExists(String notExistsSql)
ignore
|
default Children |
or()
ignore
|
Children |
or(boolean condition)
拼接 OR
|
default Children or()
Children or(boolean condition)
condition - 执行条件Children apply(boolean condition, String applySql, Object... value)
!! 会有 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())
condition - 执行条件Children last(boolean condition, String lastSql)
例: last("limit 1")
注意只能调用一次,多次调用以最后一次为准
condition - 执行条件lastSql - sql语句Children exists(boolean condition, String existsSql)
!! sql 注入方法 !!
例: exists("select id from table where age = 1")
condition - 执行条件existsSql - sql语句