Update union all

This commit is contained in:
sunkaixuan 2022-03-26 22:12:22 +08:00
parent b116962d11
commit 1e51138fa0

View File

@ -520,9 +520,9 @@ namespace SqlSugar
string sql = sqlObj.Key;
UtilMethods.RepairReplicationParameters(ref sql, sqlObj.Value.ToArray(), i, "UnionAll");
if (sqlObj.Value.HasValue())
allItems.Add(new KeyValuePair<string, List<SugarParameter>>(sql, sqlObj.Value));
allItems.Add(new KeyValuePair<string, List<SugarParameter>>($" ( {sql} ) ", sqlObj.Value));
else
allItems.Add(new KeyValuePair<string, List<SugarParameter>>(sql, new List<SugarParameter>()));
allItems.Add(new KeyValuePair<string, List<SugarParameter>>($" ( {sql} ) ", new List<SugarParameter>()));
i++;
}
var allSql = sqlBuilder.GetUnionAllSql(allItems.Select(it => it.Key).ToList());