refactor: 获取 join 连表信息时携带别名。

This commit is contained in:
Suomm 2023-08-13 12:06:45 +08:00
parent 59d49ba67a
commit d5220988a1

View File

@ -120,8 +120,13 @@ public class MapperUtil {
List<String> joinTables = new ArrayList<>(); List<String> joinTables = new ArrayList<>();
joins.forEach(join -> { joins.forEach(join -> {
QueryTable joinQueryTable = CPI.getJoinQueryTable(join); QueryTable joinQueryTable = CPI.getJoinQueryTable(join);
if (joinQueryTable != null && StringUtil.isNotBlank(joinQueryTable.getName())) { if (joinQueryTable != null) {
joinTables.add(joinQueryTable.getName()); String tableName = joinQueryTable.getName();
if (joinQueryTable.getAlias() != null) {
joinTables.add(tableName + "." + joinQueryTable.getAlias());
} else {
joinTables.add(tableName);
}
} }
}); });