public interface Condition extends ConditionAssistant
| 限定符和类型 | 方法和说明 |
|---|---|
Condition |
and()
默认自动加 'and'.Default will automatically add 'and'.
|
Condition |
between(String field,
Number low,
Number high) |
Condition |
between(String field,
String low,
String high) |
Condition |
forUpdate()
锁定查询的部分记录(仅用于SQL的单个表select)
|
Condition |
groupBy(String field) |
Condition |
having(FunctionType functionType,
String field,
Op Op,
Number value)
eg: having(FunctionType.MIN, "field", Op.ge, 60)-->having min(field)>=60
|
Condition |
having(String expressionStr)
eg:having("count(*)>5") --> having count(*)>5
|
Condition |
lParentheses()
添加左括号.Add left parentheses.
|
Condition |
notBetween(String field,
Number low,
Number high) |
Condition |
notBetween(String field,
String low,
String high) |
Condition |
op(String field,
Op Op,
Object value)
添加一个表达式条件.Add a expression condition.
|
Condition |
or()
添加 'or'.Add 'or'.
|
Condition |
orderBy(FunctionType functionType,
String field,
OrderType orderType)
eg: orderBy(FunctionType.MAX, "total", OrderType.DESC)-->order by max(total) desc
|
Condition |
orderBy(String field)
eg: orderBy("price")-->order by price
|
Condition |
orderBy(String field,
OrderType orderType)
eg: orderBy("price", OrderType.DESC)-->order by price desc
|
Condition |
rParentheses()
添加右括号.Add right parentheses.
|
Condition |
selectField(String fieldList)
指定需要查询的部分字段(仅用于SQL的select).Specify the partial fields to be queried (only for select of SQL).
|
Condition |
set(String fieldNmae,
Number num)
设置需要更新的字段(仅用于SQL的update);当要更新的字段也需要用于where条件时,可用该方法
Set the fields that need to be updated (only for update of SQL ); this method can be used when the set fields also need to be used for the where expression. |
Condition |
set(String fieldNmae,
String value)
设置需要更新的字段(仅用于SQL的update);当要更新的字段也需要用于where条件时,可用该方法
Set the fields that need to be updated (only for update of SQL); this method can be used when the set fields also need to be used for the where expression. |
Condition |
setAdd(String field,
Number num)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setAdd(String field,
String fieldName)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setIncludeType(IncludeType includeType)
设置IncludeType过滤参数.op,between,notBetween方法设置的字段,不受includeType的值影响.Set IncludeType.
|
Condition |
setMultiply(String field,
Number num)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setMultiply(String field,
String fieldName)
设置需要更新的字段(仅用于SQL的update),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
size(Integer size)
添加用于分页时设置每页返回的记录数量(仅用于SQL的select).For setting the size of the page(only for select of SQL).
|
Condition |
start(Integer start)
添加用于分页时设置开始的页数(仅用于SQL的select).For setting the start of the page(only for select of SQL).
|
getFieldSet, getForUpdate, getIncludeType, getSelectField, getUpdatefieldSet, setSuidTypeCondition start(Integer start)
start - 开始下标(从0或1开始,eg:MySQL是0,Oracle是1). start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).Condition size(Integer size)
size - 结果集大小 大于等于1. fetch result size (>0).Condition setIncludeType(IncludeType includeType)
includeType - Condition op(String field, Op Op, Object value)
field - 字段名.field nameOp - 操作符.operator.value - 字段对应的值.value of the field.Condition and()
Condition or()
Condition lParentheses()
Condition rParentheses()
Condition between(String field, Number low, Number high)
field - low - high - Condition notBetween(String field, Number low, Number high)
field - low - high - Condition between(String field, String low, String high)
field - low - high - Condition notBetween(String field, String low, String high)
field - low - high - Condition having(String expressionStr)
expressionStr - 表达式字符串,field不会被转化.
expression string,if contain field,it will not be translated.Condition having(FunctionType functionType, String field, Op Op, Number value)
functionType - 函数类型field - 实体字段,会被命名转换(如果需要).Op - 操作类型value - 值Condition orderBy(String field)
field - 用于排序的字段名.field name.Condition orderBy(String field, OrderType orderType)
field - 用于排序的字段名.field name.orderType - 排序类型(asc或desc). order type(asc or desc)Condition orderBy(FunctionType functionType, String field, OrderType orderType)
functionType - 函数类型.Function type of SQL.field - 用于排序的字段名.field name.orderType - 排序类型(asc或desc). order type(asc or desc)Condition setAdd(String field, Number num)
field - num - Condition setMultiply(String field, Number num)
field - num - Condition setAdd(String field, String fieldName)
field - fieldName - Condition setMultiply(String field, String fieldName)
field - fieldName - another fieldNameCondition set(String fieldNmae, Number num)
fieldNmae - num - Condition set(String fieldNmae, String value)
fieldNmae - value - Condition selectField(String fieldList)
fieldList - 需要查询的字段,多个用逗号隔开. select fields,if more than one,separate with comma.Condition forUpdate()
Copyright © 2020. All rights reserved.