- 增加 AsTable 多次,可查询分表后的多个子表记录,以 UNION ALL 形式执行;

This commit is contained in:
28810
2019-09-09 18:30:55 +08:00
parent ebec260d97
commit bcc154ee43
13 changed files with 620 additions and 464 deletions

View File

@@ -809,7 +809,14 @@
</member>
<member name="M:FreeSql.ISelect0`2.AsTable(System.Func{System.Type,System.String,System.String})">
<summary>
设置表名规则,可用于分库/分表参数1实体类型参数2默认表名返回值新表名
设置表名规则,可用于分库/分表参数1实体类型参数2默认表名返回值新表名 <para></para>
设置后可查询分表后的多个子表记录,以 UNION ALL 形式执行。 <para></para>
select.AsTable((type, oldname) => "table_1").AsTable((type, oldname) => "table_2").AsTable((type, oldname) => "table_3").ToSql(a => a.Id); <para></para>
select * from (SELECT a."Id" as1 FROM "table_1" a) ftb <para></para>
UNION ALL<para></para>
select * from (SELECT a."Id" as1 FROM "table_2" a) ftb <para></para>
UNION ALL<para></para>
select * from (SELECT a."Id" as1 FROM "table_3" a) ftb
</summary>
<param name="tableRule"></param>
<returns></returns>