@ -851,6 +851,7 @@ namespace SqlSugar
{
tableQueryables.Add(this.Clone().AS(item.TableName));
}
Check.Exception(tableQueryables.Count == 0, ErrorMessage.GetThrowMessage("SplitTable error . There are no tables after filtering", "SplitTable没有筛选出分表,请检查条件和数据库中的表"));
var unionall = this.Context._UnionAll(tableQueryables.ToArray());
//var values= unionall.QueryBuilder.GetSelectValue;
//unionall.QueryBuilder.SelectValue = values;
@ -12,5 +12,17 @@ namespace SqlSugar
return tables.Where(it => tableNames.Any(y => y.Equals(it.TableName, StringComparison.OrdinalIgnoreCase)));
public static IEnumerable<SplitTableInfo> ContainsTableNames(this List<SplitTableInfo> tables, params string[] tableNames)
List<SplitTableInfo> result = new List<SplitTableInfo>();
foreach (var item in tables)
if (tableNames.Any(it => item.TableName.Contains(it)))
result.Add(item);
return result;