From a3123ae2194fae2d916d756ce1f8b7257b7f573f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=B8=85?= <1474983351@qq.com> Date: Fri, 4 Oct 2024 21:36:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E8=A1=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/core/query/Join.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/Join.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/Join.java index b95aca96..cab97693 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/Join.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/Join.java @@ -21,7 +21,6 @@ import com.mybatisflex.core.dialect.OperateType; import com.mybatisflex.core.exception.FlexExceptions; import com.mybatisflex.core.util.ObjectUtil; -import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; @@ -101,15 +100,7 @@ public class Join implements CloneSupport { } public String toSql(List queryTables, IDialect dialect, OperateType operateType) { - //left join, right join, inner join ... - StringBuilder sql = new StringBuilder(type); - sql.append(queryTable.toSql(dialect,operateType)); - - //left join xxx as xxx2 on xxx2.id = xxx3.other - List newQueryTables = new ArrayList<>(queryTables); - newQueryTables.add(queryTable); - sql.append(SqlConsts.ON).append(on.toSql(newQueryTables, dialect)); - return sql.toString(); + return type + queryTable.toSql(dialect, operateType) + SqlConsts.ON + on.toSql(queryTables, dialect); } @Override