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)
between
|
Condition |
forUpdate()
锁定查询的部分记录(仅用于SQL的单个表select).lock the select record with 'for update'.
|
Condition |
groupBy(String field)
group by
|
Condition |
having(FunctionType functionType,
String field,
Op Op,
Number value)
having
eg: having(FunctionType.MIN, "field", Op.ge, 60)-->having min(field)>=60
|
Condition |
lParentheses()
添加左括号.Add left parentheses.
|
Condition |
notBetween(String field,
Number low,
Number high)
not between
|
Condition |
notBetween(String field,
String low,
String high)
not between
|
Condition |
op(String field,
Op Op,
Object value)
添加一个表达式条件.Add a expression condition.
|
Condition |
opWithField(String field1,
Op Op,
String field2)
添加一个表达式条件.Add a expression condition.
|
Condition |
or()
添加 'or'.Add 'or'.
|
Condition |
orderBy(FunctionType functionType,
String field,
OrderType orderType)
order by
eg: orderBy(FunctionType.MAX, "total", OrderType.DESC)-->order by max(total) desc
|
Condition |
orderBy(String field)
order by
eg: orderBy("price")-->order by price
|
Condition |
orderBy(String field,
OrderType orderType)
order by
eg: orderBy("price", OrderType.DESC)-->order by price desc
|
Condition |
rParentheses()
添加右括号.Add right parentheses.
|
Condition |
selectDistinctField(String fieldName)
设置字段fieldName为distinct(fieldName)
eg: selectDistinctField(fieldName) --> distinct(fieldName)
|
Condition |
selectDistinctField(String fieldName,
String alias)
设置字段fieldName为distinct(fieldName)
eg: selectDistinctField(fieldName,alias) --> distinct(fieldName) as alias
|
Condition |
selectField(String fieldList)
指定需要查询的部分字段(仅用于SQL的select).Specify the partial fields to be queried (only for select of SQL).
|
Condition |
selectFun(FunctionType functionType,
String fieldForFun)
设置使用函数查询结果.set select result with function.
|
Condition |
selectFun(FunctionType functionType,
String fieldForFun,
String alias)
设置使用函数查询结果.set select result with function.
|
Condition |
set(String fieldName,
Number num)
设置需要更新的字段(仅用于SQL的update set);当要更新的字段也需要用于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 fieldName,
String value)
设置需要更新的字段(仅用于SQL的update set);当要更新的字段也需要用于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),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setAdd(String field,
String otherFieldName)
设置需要更新的字段(仅用于SQL的update set),字段在自身基础上变化.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),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setMultiply(String field,
String otherFieldName)
设置需要更新的字段(仅用于SQL的update set),字段在自身基础上变化.Set the fields to be updated (for only update of SQL),and the field change on itself.
|
Condition |
setWithField(String field1,
String field2)
set one field with other field value
eg: setWithField(field1,field2)--> set field1=field2
|
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).
|
getForUpdate, getIncludeType, getSelectField, getUpdatefields, getWhereFields, 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 opWithField(String field1, Op Op, String field2)
field1 - first fieldOp - 操作符.operator.field2 - second fieldCondition 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(FunctionType functionType, String field, Op Op, Number value)
functionType - SQL函数类型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 - SQL函数类型.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 otherFieldName)
field - otherFieldName - Condition setMultiply(String field, String otherFieldName)
field - otherFieldName - other fieldNameCondition set(String fieldName, Number num)
fieldName - field namenum - Condition set(String fieldName, String value)
fieldName - value - Condition setWithField(String field1, String field2)
field1 - first fieldfield2 - second fieldCondition selectField(String fieldList)
fieldList - 需要查询的字段,多个用逗号隔开. select fields,if more than one,separate with comma.Condition selectDistinctField(String fieldName)
fieldName - 要设置为distinct的字段Condition selectDistinctField(String fieldName, String alias)
fieldName - 要设置为distinct的字段alias - 别名Condition selectFun(FunctionType functionType, String fieldForFun)
functionType - SQL函数类型.Function type of SQL.fieldForFun - 用于函数统计的字段名.field name for function.Condition selectFun(FunctionType functionType, String fieldForFun, String alias)
functionType - SQL函数类型.Function type of SQL.fieldForFun - 用于函数统计的字段名.field name for function.alias - 统计结果的别名.alias name for the function result.Condition forUpdate()
Copyright © 2021. All rights reserved.