mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
fixed e903b9e from https://gitee.com/Suomm/mybatis-flex/pulls/105
feat: 添加 updateNumberAddByQuery 重载方法。
This commit is contained in:
parent
80a149009b
commit
a244b0bc08
@ -332,6 +332,20 @@ public interface BaseMapper<T> {
|
||||
@UpdateProvider(type = EntitySqlProvider.class, method = "updateNumberAddByQuery")
|
||||
int updateNumberAddByQuery(@Param(FlexConsts.FIELD_NAME) String fieldName, @Param(FlexConsts.VALUE) Number value, @Param(FlexConsts.QUERY) QueryWrapper queryWrapper);
|
||||
|
||||
/**
|
||||
* 执行类似 update table set field=field+1 where ... 的场景
|
||||
*
|
||||
* @param column 字段名
|
||||
* @param value 值( >=0 加,小于 0 减)
|
||||
* @param queryWrapper 条件
|
||||
* @see EntitySqlProvider#updateNumberAddByQuery(Map, ProviderContext)
|
||||
*/
|
||||
default int updateNumberAddByQuery(QueryColumn column, Number value, QueryWrapper queryWrapper) {
|
||||
if (value == null) {
|
||||
throw FlexExceptions.wrap("value can not be null.");
|
||||
}
|
||||
return updateNumberAddByQuery(column.getName(), value, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行类似 update table set field=field+1 where ... 的场景
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user