Class UpdateWrapper<T>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,String,UpdateWrapper<T>>
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper<T>
- All Implemented Interfaces:
Compare<UpdateWrapper<T>,,String> Func<UpdateWrapper<T>,,String> Join<UpdateWrapper<T>>,Nested<UpdateWrapper<T>,,UpdateWrapper<T>> ISqlSegment,Update<UpdateWrapper<T>,,String> Serializable
public class UpdateWrapper<T>
extends AbstractWrapper<T,String,UpdateWrapper<T>>
implements Update<UpdateWrapper<T>,String>
Update 条件封装
- Since:
- 2018-05-30
- Author:
- hubin miemie HCL
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
AbstractWrapper.DoSomething -
Field Summary
Fields inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
expression, lastSql, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, typedThis -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription开启检查 SQL 注入voidclear()条件清空protected StringcolumnToString(String column) 获取 columnName获取 更新 SQL 的 SET 片段protected UpdateWrapper<T> instance()子类返回一个自己的新对象lambda()返回一个支持 lambda 函数写法的 wrapperprotected voidonParamAliasChanged(String oldParamAlias, String paramAlias) 参数别名变化后的扩展处理设置 更新 SQL 的 SET 片段字段自减变量 val 值字段自增变量 val 值设置 更新 SQL 的 SET 片段Methods inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
addCondition, addNestedCondition, allEq, allEq, and, and, appendSqlSegments, apply, between, clone, columnsToString, columnsToString, columnToMapping, columnToSqlSegment, comment, doGroupBy, doOrderBy, eq, eqOrIsNull, eqSql, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getParamNameValuePairs, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, gt, gtSql, having, in, in, inExpression, inExpression, inExpression, inExpression, initNeed, inSql, isNotNull, isNull, isUseAnnotationOrderBy, last, le, leSql, like, likeLeft, likeRight, likeValue, lt, ltSql, maybeDo, ne, nested, not, not, notBetween, notExists, notIn, notIn, notInSql, notLike, notLikeLeft, notLikeRight, or, or, orderBy, orderBy, orderBy, orderBy, setEntity, setEntityClass, setParamAliasMethods inherited from class com.baomidou.mybatisplus.core.conditions.Wrapper
getCustomSqlSegment, getSqlSelect, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, isNonEmptyOfEntity, isNonEmptyOfNormal, isNonEmptyOfWhere, nonEmptyOfEntity, nonEmptyOfNormal, nonEmptyOfWhereMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Compare
allEq, allEq, allEq, allEq, between, eq, eqOrIsNull, ge, gt, le, like, likeLeft, likeRight, lt, ne, notBetween, notLike, notLikeLeft, notLikeRightMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Func
eqSql, func, geSql, groupBy, groupBy, groupBy, gtSql, having, in, in, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Join
apply, comment, exists, first, last, notExists, or
-
Constructor Details
-
UpdateWrapper
public UpdateWrapper() -
UpdateWrapper
-
-
Method Details
-
checkSqlInjection
开启检查 SQL 注入 -
columnToString
Description copied from class:AbstractWrapper获取 columnName- Overrides:
columnToStringin classAbstractWrapper<T,String, UpdateWrapper<T>>
-
getSqlSet
Description copied from interface:Update获取 更新 SQL 的 SET 片段 -
set
Description copied from interface:Update设置 更新 SQL 的 SET 片段- Specified by:
setin interfaceUpdate<UpdateWrapper<T>,String> - Parameters:
condition- 是否加入 setcolumn- 字段val- 值mapping- 例: javaType=int,jdbcType=NUMERIC,typeHandler=xxx.xxx.MyTypeHandler- Returns:
- children
-
setSql
Description copied from interface:Update设置 更新 SQL 的 SET 片段- Specified by:
setSqlin interfaceUpdate<UpdateWrapper<T>,String> - Parameters:
condition- 执行条件setSql- set sql 例1: setSql("id=1") 例2: setSql("dateColumn={0}", LocalDate.now()) 例4: setSql("type={0,javaType=int,jdbcType=NUMERIC,typeHandler=xxx.xxx.MyTypeHandler}", "待处理字符串")- Returns:
- children
-
setIncrBy
Description copied from interface:Update字段自增变量 val 值- Specified by:
setIncrByin interfaceUpdate<UpdateWrapper<T>,String> - Parameters:
condition- 是否加入 setcolumn- 字段val- 变量值 1 字段自增 + 1
-
setDecrBy
Description copied from interface:Update字段自减变量 val 值- Specified by:
setDecrByin interfaceUpdate<UpdateWrapper<T>,String> - Parameters:
condition- 是否加入 setcolumn- 字段val- 变量值 1 字段自减 - 1
-
lambda
返回一个支持 lambda 函数写法的 wrapper -
instance
Description copied from class:AbstractWrapper子类返回一个自己的新对象- Specified by:
instancein classAbstractWrapper<T,String, UpdateWrapper<T>>
-
onParamAliasChanged
Description copied from class:AbstractWrapper参数别名变化后的扩展处理- Overrides:
onParamAliasChangedin classAbstractWrapper<T,String, UpdateWrapper<T>> - Parameters:
oldParamAlias- 原参数别名paramAlias- 新参数别名
-
clear
public void clear()Description copied from class:Wrapper条件清空- Overrides:
clearin classAbstractWrapper<T,String, UpdateWrapper<T>>
-