|
@ -467,8 +467,15 @@ namespace SqlSugar |
|
|
var allParameters = allItems.SelectMany(it => it.Value).ToArray(); |
|
|
var allParameters = allItems.SelectMany(it => it.Value).ToArray(); |
|
|
var resulut = this.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null); |
|
|
var resulut = this.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null); |
|
|
resulut.AddParameters(allParameters); |
|
|
resulut.AddParameters(allParameters); |
|
|
|
|
|
if (this.Context.CurrentConnectionConfig.DbType == DbType.Oracle && sqlBuilder.SqlSelectAll == "*") |
|
|
|
|
|
{ |
|
|
|
|
|
return resulut.Select<T>("unionTable.*"); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
return resulut.Select<T>(sqlBuilder.SqlSelectAll); |
|
|
return resulut.Select<T>(sqlBuilder.SqlSelectAll); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
public virtual ISugarQueryable<T> UnionAll<T>(List<ISugarQueryable<T>> queryables) where T : class, new() |
|
|
public virtual ISugarQueryable<T> UnionAll<T>(List<ISugarQueryable<T>> queryables) where T : class, new() |
|
|
{ |
|
|
{ |
|
|
Check.Exception(queryables.IsNullOrEmpty(), "UnionAll.queryables is null "); |
|
|
Check.Exception(queryables.IsNullOrEmpty(), "UnionAll.queryables is null "); |
|
@ -495,8 +502,15 @@ namespace SqlSugar |
|
|
var allParameters = allItems.SelectMany(it => it.Value).ToArray(); |
|
|
var allParameters = allItems.SelectMany(it => it.Value).ToArray(); |
|
|
var resulut = this.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null); |
|
|
var resulut = this.Context.Queryable<ExpandoObject>().AS(UtilMethods.GetPackTable(allSql, "unionTable")).With(SqlWith.Null); |
|
|
resulut.AddParameters(allParameters); |
|
|
resulut.AddParameters(allParameters); |
|
|
|
|
|
if (this.Context.CurrentConnectionConfig.DbType == DbType.Oracle && sqlBuilder.SqlSelectAll == "*") |
|
|
|
|
|
{ |
|
|
|
|
|
return resulut.Select<T>("unionTable.*"); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
return resulut.Select<T>(sqlBuilder.SqlSelectAll); |
|
|
return resulut.Select<T>(sqlBuilder.SqlSelectAll); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
public virtual ISugarQueryable<T> Union<T>(List<ISugarQueryable<T>> queryables) where T : class, new() |
|
|
public virtual ISugarQueryable<T> Union<T>(List<ISugarQueryable<T>> queryables) where T : class, new() |
|
|
{ |
|
|
{ |
|
|
Check.Exception(queryables.IsNullOrEmpty(), "Union.queryables is null "); |
|
|
Check.Exception(queryables.IsNullOrEmpty(), "Union.queryables is null "); |
|
|