|
@@ -15,12 +15,11 @@
|
|
*/
|
|
*/
|
|
package com.baomidou.mybatisplus.extension.injector.methods;
|
|
package com.baomidou.mybatisplus.extension.injector.methods;
|
|
|
|
|
|
-import org.apache.ibatis.mapping.MappedStatement;
|
|
|
|
-import org.apache.ibatis.mapping.SqlSource;
|
|
|
|
-
|
|
|
|
import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
|
import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
|
import com.baomidou.mybatisplus.extension.injector.AbstractLogicMethod;
|
|
import com.baomidou.mybatisplus.extension.injector.AbstractLogicMethod;
|
|
|
|
+import org.apache.ibatis.mapping.MappedStatement;
|
|
|
|
+import org.apache.ibatis.mapping.SqlSource;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -36,7 +35,7 @@ public class LogicUpdate extends AbstractLogicMethod {
|
|
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
|
|
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
|
|
SqlMethod sqlMethod = SqlMethod.UPDATE;
|
|
SqlMethod sqlMethod = SqlMethod.UPDATE;
|
|
String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(),
|
|
String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(),
|
|
- sqlSet(true, true, tableInfo, ENTITY, ENTITY_DOT),
|
|
|
|
|
|
+ sqlSet(true, true, tableInfo, true, ENTITY, ENTITY_DOT),
|
|
sqlWhereEntityWrapper(true, tableInfo));
|
|
sqlWhereEntityWrapper(true, tableInfo));
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
|
|
return addUpdateMappedStatement(mapperClass, modelClass, sqlMethod.getMethod(), sqlSource);
|
|
return addUpdateMappedStatement(mapperClass, modelClass, sqlMethod.getMethod(), sqlSource);
|