mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
fix: 重复添加的表。
This commit is contained in:
parent
7b34921445
commit
a3123ae219
@ -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<Join> {
|
||||
}
|
||||
|
||||
public String toSql(List<QueryTable> 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<QueryTable> 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user