Explorar o código

fix: entity 无主键,生成 ew 的 where 条件的 bug

miemie %!s(int64=6) %!d(string=hai) anos
pai
achega
141bf20846

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/metadata/TableInfo.java

@@ -258,7 +258,7 @@ public class TableInfo {
                 return true;
             })
             .map(i -> i.getSqlWhere(newPrefix)).collect(joining(StringPool.NEWLINE));
-        if (!withId) {
+        if (!withId && StringUtils.isEmpty(keyProperty)) {
             return filedSqlScript;
         }
         String newKeyProperty = newPrefix + keyProperty;