优化:当只查询一张表时,生成的字段无效添加表前缀

This commit is contained in:
开源海哥 2023-03-02 11:14:54 +08:00
parent 15410aed76
commit 62a6fb1342

View File

@ -96,7 +96,11 @@ class WrapperUtil {
public static String getColumnTableName(List<QueryTable> queryTables, QueryTable queryTable) {
if (queryTables == null || queryTables.size() <= 1){
if (queryTables == null) {
return "";
}
if (queryTables.size() == 1 && queryTables.get(0).isSameTable(queryTable)) {
return "";
}
@ -104,6 +108,7 @@ class WrapperUtil {
if (realTable == null) {
return "";
}
return StringUtil.isNotBlank(realTable.alias) ? realTable.alias : realTable.name;
}