Browse Source

精简一下

miemie 7 years ago
parent
commit
d87c130eaa

+ 3 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/UpdateById.java

@@ -35,8 +35,9 @@ public class UpdateById extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.UPDATE_BY_ID;
-        String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), sqlSet(true, false, tableInfo, "et."),
-            tableInfo.getKeyColumn(), new StringBuilder("et.").append(tableInfo.getKeyProperty()).toString(),
+        String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(),
+            sqlSet(true, false, tableInfo, "et."),
+            tableInfo.getKeyColumn(), "et." + tableInfo.getKeyProperty(),
             new StringBuilder("<if test=\"et instanceof java.util.Map\">")
                 .append("<if test=\"et.MP_OPTLOCK_VERSION_ORIGINAL!=null\">")
                 .append(" AND ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}")