mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
添加新的多表查询语法,简化 定义 一堆 abcd
This commit is contained in:
parent
8e67cb3d73
commit
f3aa07abb6
@ -380,7 +380,7 @@ WHERE ROWNUM < 11";
|
||||
|
||||
|
||||
var xxxhzytuple = g.sqlserver.Select<Templates, TaskBuild>()
|
||||
.Where(a => a.Item1.Code == "xxx" && a.Item2.OptionsEntity03 == true)
|
||||
.Where(a => a.t1.Code == "xxx" && a.t2.OptionsEntity03 == true)
|
||||
.ToSql();
|
||||
|
||||
|
||||
|
50
FreeSql.Tests/FreeSql.Tests/UnitTest4.cs
Normal file
50
FreeSql.Tests/FreeSql.Tests/UnitTest4.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Xunit;
|
||||
using static FreeSql.Tests.UnitTest1;
|
||||
|
||||
namespace FreeSql.Tests
|
||||
{
|
||||
public class UnitTest4
|
||||
{
|
||||
static Lazy<IFreeSql> sqliteLazy = new Lazy<IFreeSql>(() => new FreeSql.FreeSqlBuilder()
|
||||
.UseConnectionString(FreeSql.DataType.Sqlite, @"Data Source=|DataDirectory|\document.db;Attachs=xxxtb.db;")
|
||||
//.UseConnectionFactory(FreeSql.DataType.Sqlite, () =>
|
||||
//{
|
||||
// var conn = new System.Data.SQLite.SQLiteConnection(@"Data Source=|DataDirectory|\document.db;Pooling=true;");
|
||||
// //conn.Open();
|
||||
// //var cmd = conn.CreateCommand();
|
||||
// //cmd.CommandText = $"attach database [xxxtb.db] as [xxxtb];\r\n";
|
||||
// //cmd.ExecuteNonQuery();
|
||||
// //cmd.Dispose();
|
||||
// return conn;
|
||||
//})
|
||||
.UseAutoSyncStructure(true)
|
||||
//.UseGenerateCommandParameterWithLambda(true)
|
||||
.UseLazyLoading(true)
|
||||
.UseMonitorCommand(
|
||||
cmd => Trace.WriteLine("\r\n线程" + Thread.CurrentThread.ManagedThreadId + ": " + cmd.CommandText) //监听SQL命令对象,在执行前
|
||||
//, (cmd, traceLog) => Console.WriteLine(traceLog)
|
||||
)
|
||||
.Build());
|
||||
public static IFreeSql sqlite => sqliteLazy.Value;
|
||||
|
||||
|
||||
[Fact]
|
||||
public void TestHzyTuple()
|
||||
{
|
||||
var xxxhzytuple = g.sqlite.Select<Templates, TaskBuild>()
|
||||
.LeftJoin(w => w.t1.Id2 == w.t2.TemplatesId)
|
||||
.Where(w => w.t1.Code == "xxx" && w.t2.OptionsEntity03 == true)
|
||||
.OrderBy(w => w.t1.AddTime)
|
||||
.ToSql();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp);
|
||||
@ -59,8 +78,42 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>> exp);
|
||||
@ -59,8 +78,42 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> exp);
|
||||
@ -59,8 +78,42 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>> exp);
|
||||
@ -59,8 +78,43 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>> exp);
|
||||
@ -59,8 +78,42 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>> exp);
|
||||
@ -59,8 +78,42 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, string sqlT15, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class where T16 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>> exp);
|
||||
@ -59,8 +78,41 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderBy<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderByDescending<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderByIf<TMember>(bool condition, Expression < Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column, bool descending = false);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, string sqlT15, string sqlT16, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2> : ISelect0<ISelect<T1, T2>, T1> where T2 : class
|
||||
{
|
||||
|
||||
@ -27,12 +28,30 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<T1, T2, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<T1, T2, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<T1, T2, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<T1, T2, TReturn>> select);
|
||||
List<TDto> ToList<TDto>();
|
||||
void ToChunk<TReturn>(Expression<Func<T1, T2, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
@ -54,7 +73,6 @@ namespace FreeSql
|
||||
|
||||
ISelect<T1, T2> Where(Expression<Func<T1, T2, bool>> exp);
|
||||
ISelect<T1, T2> WhereIf(bool condition, Expression<Func<T1, T2, bool>> exp);
|
||||
ISelect<T1, T2> Where(Expression<Func<NativeTuple<T1, T2>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2>> GroupBy<TKey>(Expression<Func<T1, T2, TKey>> exp);
|
||||
|
||||
@ -63,5 +81,41 @@ namespace FreeSql
|
||||
ISelect<T1, T2> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2> WithSql(string sqlT1, string sqlT2, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2> LeftJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
ISelect<T1, T2> InnerJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
ISelect<T1, T2> RightJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2> Where(Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
ISelect<T1, T2> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
ISelect<T1, T2> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column);
|
||||
ISelect<T1, T2> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
|
||||
public interface ISelect<T1, T2, T3> : ISelect0<ISelect<T1, T2, T3>, T1> where T2 : class where T3 : class
|
||||
{
|
||||
|
||||
@ -27,6 +29,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, bool>> exp);
|
||||
@ -62,5 +82,40 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3> WithSql(string sqlT1, string sqlT2, string sqlT3, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
ISelect<T1, T2, T3> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
ISelect<T1, T2, T3> RightJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3> Where(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
ISelect<T1, T2, T3> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
ISelect<T1, T2, T3> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column);
|
||||
ISelect<T1, T2, T3> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4> : ISelect0<ISelect<T1, T2, T3, T4>, T1> where T2 : class where T3 : class where T4 : class
|
||||
{
|
||||
|
||||
@ -27,6 +29,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, bool>> exp);
|
||||
@ -62,5 +82,39 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4> Where(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5> : ISelect0<ISelect<T1, T2, T3, T4, T5>, T1> where T2 : class where T3 : class where T4 : class where T5 : class
|
||||
{
|
||||
|
||||
@ -27,6 +29,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, bool>> exp);
|
||||
@ -62,5 +82,41 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4, T5> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp);
|
||||
@ -62,5 +81,39 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4, T5, T6> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp);
|
||||
@ -62,5 +81,40 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp);
|
||||
@ -62,5 +81,40 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
{
|
||||
|
||||
public interface ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> : ISelect0<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1> where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class
|
||||
{
|
||||
|
||||
@ -27,6 +28,24 @@ namespace FreeSql
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<bool> AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
Task<int> InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
Task<DataTable> ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
|
||||
Task<TReturn> ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
Task<TReturn> FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
|
||||
Task<decimal> SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
Task<TMember> MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
Task<TMember> MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
Task<double> AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
|
||||
bool Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp);
|
||||
@ -62,5 +81,39 @@ namespace FreeSql
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> OrderByIf<TMember>(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column, bool descending = false);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, object parms = null);
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
bool Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
int InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TTargetEntity>> select) where TTargetEntity : class;
|
||||
DataTable ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
List<TReturn> ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done);
|
||||
|
||||
TReturn ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
TReturn First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select);
|
||||
|
||||
string ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex);
|
||||
decimal Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
TMember Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
TMember Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
double Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp);
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>> GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TKey>> exp);
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column);
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column, bool descending = false);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1689,14 +1689,14 @@ namespace FreeSql.Internal
|
||||
{
|
||||
var parent = node.Expression as MemberExpression;
|
||||
if (parent.Expression?.NodeType == ExpressionType.Parameter &&
|
||||
parent.Expression.Type.Name.StartsWith("NativeTuple`") == true &&
|
||||
int.TryParse(parent.Member.Name.Replace("Item", ""), out widx) && widx > 0 && widx <= tables.Count)
|
||||
parent.Expression.Type.Name.StartsWith("HzyTuple`") == true &&
|
||||
int.TryParse(parent.Member.Name.Replace("t", ""), out widx) && widx > 0 && widx <= tables.Count)
|
||||
return Expression.Property(parameters[widx - 1], node.Member.Name);
|
||||
}
|
||||
|
||||
if (node.Expression?.NodeType == ExpressionType.Parameter &&
|
||||
node.Expression.Type.Name.StartsWith("NativeTuple`") == true &&
|
||||
int.TryParse(node.Member.Name.Replace("Item", ""), out widx) && widx > 0 && widx <= tables.Count)
|
||||
node.Expression.Type.Name.StartsWith("HzyTuple`") == true &&
|
||||
int.TryParse(node.Member.Name.Replace("t", ""), out widx) && widx > 0 && widx <= tables.Count)
|
||||
return parameters[widx - 1];
|
||||
|
||||
return base.VisitMember(node);
|
||||
|
@ -10,15 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select10Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class
|
||||
{
|
||||
|
||||
public Select10Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -33,31 +25,32 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T8)), Alias = $"SP10h", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T9)), Alias = $"SP10i", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T10)), Alias = $"SP10j", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -129,22 +122,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -203,9 +189,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
|
||||
@ -222,6 +208,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>> column)
|
||||
@ -295,6 +410,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -10,16 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select11Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class
|
||||
{
|
||||
|
||||
public Select11Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -35,32 +26,33 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T9)), Alias = $"SP10i", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T10)), Alias = $"SP10j", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T11)), Alias = $"SP10k", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -132,23 +124,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -207,9 +191,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>> exp)
|
||||
@ -226,6 +210,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>> column)
|
||||
@ -299,6 +412,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -9,18 +9,9 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
|
||||
public abstract class Select12Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T12 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class
|
||||
{
|
||||
|
||||
public Select12Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -37,33 +28,34 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T10)), Alias = $"SP10j", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T11)), Alias = $"SP10k", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T12)), Alias = $"SP10l", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[11].Table?.Type) return $"( {sqlT12} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
if (type == _tables[11].Table?.Type && string.IsNullOrEmpty(sqlT12) == false) return $"({sqlT12})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -135,24 +127,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"),
|
||||
Expression.Parameter(typeof(T12), "l"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"), Expression.Parameter(typeof(T12), "l"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -211,9 +194,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> exp)
|
||||
@ -230,6 +213,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>> column)
|
||||
@ -303,6 +415,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -10,18 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select13Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T12 : class
|
||||
where T13 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class
|
||||
{
|
||||
|
||||
public Select13Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -39,34 +28,35 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T11)), Alias = $"SP10k", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T12)), Alias = $"SP10l", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T13)), Alias = $"SP10m", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[11].Table?.Type) return $"( {sqlT12} )";
|
||||
if (type == _tables[12].Table?.Type) return $"( {sqlT13} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
if (type == _tables[11].Table?.Type && string.IsNullOrEmpty(sqlT12) == false) return $"({sqlT12})";
|
||||
if (type == _tables[12].Table?.Type && string.IsNullOrEmpty(sqlT13) == false) return $"({sqlT13})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -138,25 +128,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"),
|
||||
Expression.Parameter(typeof(T12), "l"),
|
||||
Expression.Parameter(typeof(T13), "m"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"), Expression.Parameter(typeof(T12), "l"), Expression.Parameter(typeof(T13), "m"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -215,9 +195,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>> exp)
|
||||
@ -234,6 +214,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>> column)
|
||||
@ -307,6 +416,68 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
@ -10,19 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select14Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T12 : class
|
||||
where T13 : class
|
||||
where T14 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class
|
||||
{
|
||||
|
||||
public Select14Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -41,35 +29,36 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T12)), Alias = $"SP10l", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T13)), Alias = $"SP10m", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T14)), Alias = $"SP10n", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[11].Table?.Type) return $"( {sqlT12} )";
|
||||
if (type == _tables[12].Table?.Type) return $"( {sqlT13} )";
|
||||
if (type == _tables[13].Table?.Type) return $"( {sqlT14} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
if (type == _tables[11].Table?.Type && string.IsNullOrEmpty(sqlT12) == false) return $"({sqlT12})";
|
||||
if (type == _tables[12].Table?.Type && string.IsNullOrEmpty(sqlT13) == false) return $"({sqlT13})";
|
||||
if (type == _tables[13].Table?.Type && string.IsNullOrEmpty(sqlT14) == false) return $"({sqlT14})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -141,26 +130,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"),
|
||||
Expression.Parameter(typeof(T12), "l"),
|
||||
Expression.Parameter(typeof(T13), "m"),
|
||||
Expression.Parameter(typeof(T14), "n"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"), Expression.Parameter(typeof(T12), "l"), Expression.Parameter(typeof(T13), "m"), Expression.Parameter(typeof(T14), "n"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -219,9 +197,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>> exp)
|
||||
@ -238,6 +216,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>> column)
|
||||
@ -311,6 +418,68 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
@ -10,20 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select15Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T12 : class
|
||||
where T13 : class
|
||||
where T14 : class
|
||||
where T15 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class
|
||||
{
|
||||
|
||||
public Select15Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -43,36 +30,37 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T13)), Alias = $"SP10m", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T14)), Alias = $"SP10n", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T15)), Alias = $"SP10o", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, string sqlT15, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[11].Table?.Type) return $"( {sqlT12} )";
|
||||
if (type == _tables[12].Table?.Type) return $"( {sqlT13} )";
|
||||
if (type == _tables[13].Table?.Type) return $"( {sqlT14} )";
|
||||
if (type == _tables[14].Table?.Type) return $"( {sqlT15} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
if (type == _tables[11].Table?.Type && string.IsNullOrEmpty(sqlT12) == false) return $"({sqlT12})";
|
||||
if (type == _tables[12].Table?.Type && string.IsNullOrEmpty(sqlT13) == false) return $"({sqlT13})";
|
||||
if (type == _tables[13].Table?.Type && string.IsNullOrEmpty(sqlT14) == false) return $"({sqlT14})";
|
||||
if (type == _tables[14].Table?.Type && string.IsNullOrEmpty(sqlT15) == false) return $"({sqlT15})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14};\r\n{sqlT15}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14};\r\n{sqlT15};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -144,27 +132,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"),
|
||||
Expression.Parameter(typeof(T12), "l"),
|
||||
Expression.Parameter(typeof(T13), "m"),
|
||||
Expression.Parameter(typeof(T14), "n"),
|
||||
Expression.Parameter(typeof(T15), "o"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"), Expression.Parameter(typeof(T12), "l"), Expression.Parameter(typeof(T13), "m"), Expression.Parameter(typeof(T14), "n"), Expression.Parameter(typeof(T15), "o"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -223,9 +199,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>> exp)
|
||||
@ -242,6 +218,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>> column)
|
||||
@ -315,6 +420,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -10,21 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select16Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T10 : class
|
||||
where T11 : class
|
||||
where T12 : class
|
||||
where T13 : class
|
||||
where T14 : class
|
||||
where T15 : class
|
||||
where T16 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class where T11 : class where T12 : class where T13 : class where T14 : class where T15 : class where T16 : class
|
||||
{
|
||||
|
||||
public Select16Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -45,37 +31,38 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T14)), Alias = $"SP10n", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T15)), Alias = $"SP10o", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T16)), Alias = $"SP10p", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, string sqlT10, string sqlT11, string sqlT12, string sqlT13, string sqlT14, string sqlT15, string sqlT16, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[9].Table?.Type) return $"( {sqlT10} )";
|
||||
if (type == _tables[10].Table?.Type) return $"( {sqlT11} )";
|
||||
if (type == _tables[11].Table?.Type) return $"( {sqlT12} )";
|
||||
if (type == _tables[12].Table?.Type) return $"( {sqlT13} )";
|
||||
if (type == _tables[13].Table?.Type) return $"( {sqlT14} )";
|
||||
if (type == _tables[14].Table?.Type) return $"( {sqlT15} )";
|
||||
if (type == _tables[15].Table?.Type) return $"( {sqlT16} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
if (type == _tables[9].Table?.Type && string.IsNullOrEmpty(sqlT10) == false) return $"({sqlT10})";
|
||||
if (type == _tables[10].Table?.Type && string.IsNullOrEmpty(sqlT11) == false) return $"({sqlT11})";
|
||||
if (type == _tables[11].Table?.Type && string.IsNullOrEmpty(sqlT12) == false) return $"({sqlT12})";
|
||||
if (type == _tables[12].Table?.Type && string.IsNullOrEmpty(sqlT13) == false) return $"({sqlT13})";
|
||||
if (type == _tables[13].Table?.Type && string.IsNullOrEmpty(sqlT14) == false) return $"({sqlT14})";
|
||||
if (type == _tables[14].Table?.Type && string.IsNullOrEmpty(sqlT15) == false) return $"({sqlT15})";
|
||||
if (type == _tables[15].Table?.Type && string.IsNullOrEmpty(sqlT16) == false) return $"({sqlT16})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14};\r\n{sqlT15};\r\n{sqlT16}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};\r\n{sqlT10};\r\n{sqlT11};\r\n{sqlT12};\r\n{sqlT13};\r\n{sqlT14};\r\n{sqlT15};\r\n{sqlT16};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -147,28 +134,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"),
|
||||
Expression.Parameter(typeof(T10), "j"),
|
||||
Expression.Parameter(typeof(T11), "k"),
|
||||
Expression.Parameter(typeof(T12), "l"),
|
||||
Expression.Parameter(typeof(T13), "m"),
|
||||
Expression.Parameter(typeof(T14), "n"),
|
||||
Expression.Parameter(typeof(T15), "o"),
|
||||
Expression.Parameter(typeof(T16), "p"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"), Expression.Parameter(typeof(T10), "j"), Expression.Parameter(typeof(T11), "k"), Expression.Parameter(typeof(T12), "l"), Expression.Parameter(typeof(T13), "m"), Expression.Parameter(typeof(T14), "n"), Expression.Parameter(typeof(T15), "o"), Expression.Parameter(typeof(T16), "p"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -227,9 +201,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>> exp)
|
||||
@ -246,6 +220,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>> column)
|
||||
@ -319,6 +422,68 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
@ -9,6 +9,8 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
|
||||
|
||||
public abstract class Select2Provider<T1, T2> : Select0Provider<ISelect<T1, T2>, T1>, ISelect<T1, T2>
|
||||
where T2 : class
|
||||
{
|
||||
@ -17,17 +19,18 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(typeof(T2));
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T2)), Alias = $"SP10b", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.WithSql(string sqlT1, string sqlT2, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -111,8 +114,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
@ -178,14 +180,6 @@ namespace FreeSql.Internal.CommonProvider
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.Where(Expression<Func<NativeTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
if (exp == null) return this.Where(null);
|
||||
var exp2 = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
for (var a = 0; a < exp2.Parameters.Count; a++) _tables[a].Parameter = exp2.Parameters[a];
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp2, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2>.Any(Expression<Func<T1, T2, bool>> exp)
|
||||
{
|
||||
if (exp == null) return this.Any();
|
||||
@ -200,6 +194,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2>.First<TReturn>(Expression<Func<T1, T2, TReturn>> select) => (this as ISelect<T1, T2>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2>.First<TDto>() => (this as ISelect<T1, T2>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).Avg((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2>> ISelect<T1, T2>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).GroupBy((Expression<Func<T1, T2, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2>.Max<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).Max((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2>.Min<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).Min<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).OrderBy<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).OrderByDescending<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).Sum<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).ToList<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2>).ToChunk<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).ToDataTable<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).ToSql<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.LeftJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).LeftJoin((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.InnerJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).InnerJoin((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.RightJoin(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).RightJoin((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.Where(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).Where((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2> ISelect<T1, T2>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).WhereIf(condition, (Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2>.Any(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2>).Any((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2>.First<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2>.AvgAsync<TMember>(Expression<Func<T1, T2, TMember>> column)
|
||||
@ -273,6 +396,73 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2>.FirstAsync<TReturn>(Expression<Func<T1, T2, TReturn>> select) => (await (this as ISelect<T1, T2>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).AvgAsync<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).MaxAsync<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).MinAsync<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2>).SumAsync<TMember>((Expression<Func<T1, T2, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).ToListAsync<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2>.AnyAsync(Expression<Func<HzyTuple<T1, T2>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2>).AnyAsync((Expression<Func<T1, T2, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -9,9 +9,10 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
|
||||
|
||||
public abstract class Select3Provider<T1, T2, T3> : Select0Provider<ISelect<T1, T2, T3>, T1>, ISelect<T1, T2, T3>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T2 : class where T3 : class
|
||||
{
|
||||
|
||||
public Select3Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -19,18 +20,19 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (_orm.CodeFirst.IsAutoSyncStructure) _orm.CodeFirst.SyncStructure(typeof(T2), typeof(T3));
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T2)), Alias = $"SP10b", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T3)), Alias = $"SP10c", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.WithSql(string sqlT1, string sqlT2, string sqlT3, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -108,15 +110,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3>.ToList<TDto>() => (this as ISelect<T1, T2, T3>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -194,6 +196,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3>.First<TReturn>(Expression<Func<T1, T2, T3, TReturn>> select) => (this as ISelect<T1, T2, T3>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3>.First<TDto>() => (this as ISelect<T1, T2, T3>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Avg((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3>> ISelect<T1, T2, T3>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).GroupBy((Expression<Func<T1, T2, T3, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Max((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Min<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).OrderBy<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Sum<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).ToList<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).ToSql<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).LeftJoin((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).InnerJoin((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).RightJoin((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.Where(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Where((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).WhereIf(condition, (Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3>.Any(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).Any((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, TMember>> column)
|
||||
@ -267,6 +398,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, TReturn>> select) => (await (this as ISelect<T1, T2, T3>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).MinAsync<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).SumAsync<TMember>((Expression<Func<T1, T2, T3, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3>).AnyAsync((Expression<Func<T1, T2, T3, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -9,10 +9,9 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
|
||||
public abstract class Select4Provider<T1, T2, T3, T4> : Select0Provider<ISelect<T1, T2, T3, T4>, T1>, ISelect<T1, T2, T3, T4>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T2 : class where T3 : class where T4 : class
|
||||
{
|
||||
|
||||
public Select4Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -21,19 +20,20 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T2)), Alias = $"SP10b", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T3)), Alias = $"SP10c", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T4)), Alias = $"SP10d", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"( {sqlT4} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -111,16 +111,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -198,6 +197,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4>.First<TReturn>(Expression<Func<T1, T2, T3, T4, TReturn>> select) => (this as ISelect<T1, T2, T3, T4>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4>.First<TDto>() => (this as ISelect<T1, T2, T3, T4>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Avg((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4>> ISelect<T1, T2, T3, T4>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).GroupBy((Expression<Func<T1, T2, T3, T4, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Max((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Min<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).LeftJoin((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).InnerJoin((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).RightJoin((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Where((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).Any((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, TMember>> column)
|
||||
@ -271,6 +399,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4>).AnyAsync((Expression<Func<T1, T2, T3, T4, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -10,10 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select5Provider<T1, T2, T3, T4, T5> : Select0Provider<ISelect<T1, T2, T3, T4, T5>, T1>, ISelect<T1, T2, T3, T4, T5>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class
|
||||
{
|
||||
|
||||
public Select5Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -23,20 +20,21 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T3)), Alias = $"SP10c", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T4)), Alias = $"SP10d", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T5)), Alias = $"SP10e", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"( {sqlT5} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -114,17 +112,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -202,6 +198,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Avg((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5>> ISelect<T1, T2, T3, T4, T5>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Max((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Where((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).Any((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, TMember>> column)
|
||||
@ -275,6 +400,70 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -10,11 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select6Provider<T1, T2, T3, T4, T5, T6> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6>, T1>, ISelect<T1, T2, T3, T4, T5, T6>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class
|
||||
{
|
||||
|
||||
public Select6Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -25,21 +21,22 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T4)), Alias = $"SP10d", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T5)), Alias = $"SP10e", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T6)), Alias = $"SP10f", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"( {sqlT6} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -117,18 +114,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -206,6 +200,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6>> ISelect<T1, T2, T3, T4, T5, T6>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, TMember>> column)
|
||||
@ -279,6 +402,68 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
@ -10,12 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select7Provider<T1, T2, T3, T4, T5, T6, T7> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class
|
||||
{
|
||||
|
||||
public Select7Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -27,22 +22,23 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T5)), Alias = $"SP10e", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T6)), Alias = $"SP10f", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T7)), Alias = $"SP10g", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"( {sqlT7} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -120,19 +116,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -210,6 +202,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7>> ISelect<T1, T2, T3, T4, T5, T6, T7>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>> column)
|
||||
@ -246,7 +367,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToAggregateAsync<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToListAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>> select)
|
||||
{
|
||||
if (select == null) return this.InternalToListAsync<TReturn>(select?.Body);
|
||||
@ -254,7 +375,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
return this.InternalToListAsync<TReturn>(select?.Body);
|
||||
}
|
||||
Task<List<TDto>> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToListAsync<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToListAsync(GetToListDtoSelector<TDto>());
|
||||
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToDataTableAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>> select)
|
||||
{
|
||||
if (select == null) return this.InternalToDataTableAsync(select?.Body);
|
||||
@ -283,6 +404,71 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -9,14 +9,9 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
|
||||
public abstract class Select8Provider<T1, T2, T3, T4, T5, T6, T7, T8> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class
|
||||
{
|
||||
|
||||
public Select8Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -29,23 +24,24 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T6)), Alias = $"SP10f", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T7)), Alias = $"SP10g", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T8)), Alias = $"SP10h", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type && string.IsNullOrEmpty(sqlT1) == false) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"( {sqlT8} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -123,20 +119,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -214,6 +205,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>> column)
|
||||
@ -287,6 +407,69 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -10,14 +10,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
|
||||
public abstract class Select9Provider<T1, T2, T3, T4, T5, T6, T7, T8, T9> : Select0Provider<ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1>, ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
where T2 : class
|
||||
where T3 : class
|
||||
where T4 : class
|
||||
where T5 : class
|
||||
where T6 : class
|
||||
where T7 : class
|
||||
where T8 : class
|
||||
where T9 : class
|
||||
where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class
|
||||
{
|
||||
|
||||
public Select9Provider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression, object dywhere) : base(orm, commonUtils, commonExpression, dywhere)
|
||||
@ -31,30 +24,31 @@ namespace FreeSql.Internal.CommonProvider
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T7)), Alias = $"SP10g", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T8)), Alias = $"SP10h", On = null, Type = SelectTableInfoType.From });
|
||||
_tables.Add(new SelectTableInfo { Table = _commonUtils.GetTableByEntity(typeof(T9)), Alias = $"SP10i", On = null, Type = SelectTableInfoType.From });
|
||||
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.WithSql(string sqlT1, string sqlT2, string sqlT3, string sqlT4, string sqlT5, string sqlT6, string sqlT7, string sqlT8, string sqlT9, object parms)
|
||||
{
|
||||
this.AsTable((type, old) =>
|
||||
{
|
||||
if (type == _tables[0].Table?.Type) return $"( {sqlT1} )";
|
||||
if (type == _tables[1].Table?.Type) return $"( {sqlT2} )";
|
||||
if (type == _tables[2].Table?.Type) return $"( {sqlT3} )";
|
||||
if (type == _tables[3].Table?.Type) return $"( {sqlT4} )";
|
||||
if (type == _tables[4].Table?.Type) return $"( {sqlT5} )";
|
||||
if (type == _tables[5].Table?.Type) return $"( {sqlT6} )";
|
||||
if (type == _tables[6].Table?.Type) return $"( {sqlT7} )";
|
||||
if (type == _tables[7].Table?.Type) return $"( {sqlT8} )";
|
||||
if (type == _tables[8].Table?.Type) return $"( {sqlT9} )";
|
||||
if (type == _tables[1].Table?.Type && string.IsNullOrEmpty(sqlT2) == false) return $"({sqlT2})";
|
||||
if (type == _tables[2].Table?.Type && string.IsNullOrEmpty(sqlT3) == false) return $"({sqlT3})";
|
||||
if (type == _tables[3].Table?.Type && string.IsNullOrEmpty(sqlT4) == false) return $"({sqlT4})";
|
||||
if (type == _tables[4].Table?.Type && string.IsNullOrEmpty(sqlT5) == false) return $"({sqlT5})";
|
||||
if (type == _tables[5].Table?.Type && string.IsNullOrEmpty(sqlT6) == false) return $"({sqlT6})";
|
||||
if (type == _tables[6].Table?.Type && string.IsNullOrEmpty(sqlT7) == false) return $"({sqlT7})";
|
||||
if (type == _tables[7].Table?.Type && string.IsNullOrEmpty(sqlT8) == false) return $"({sqlT8})";
|
||||
if (type == _tables[8].Table?.Type && string.IsNullOrEmpty(sqlT9) == false) return $"({sqlT9})";
|
||||
|
||||
return old;
|
||||
});
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT1};\r\n{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9}", parms));
|
||||
if (parms != null) _params.AddRange(_commonUtils.GetDbParamtersByObject($"{sqlT2};\r\n{sqlT3};\r\n{sqlT4};\r\n{sqlT5};\r\n{sqlT6};\r\n{sqlT7};\r\n{sqlT8};\r\n{sqlT9};", parms));
|
||||
return this;
|
||||
}
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Avg<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column)
|
||||
{
|
||||
if (column == null) return 0;
|
||||
if (column == null) return default(double);
|
||||
for (var a = 0; a < column.Parameters.Count; a++) _tables[a].Parameter = column.Parameters[a];
|
||||
return this.InternalAvg(column?.Body);
|
||||
}
|
||||
@ -126,21 +120,15 @@ namespace FreeSql.Internal.CommonProvider
|
||||
for (var a = 0; a < select.Parameters.Count; a++) _tables[a].Parameter = select.Parameters[a];
|
||||
return this.InternalToList<TReturn>(select?.Body);
|
||||
}
|
||||
|
||||
List<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToList<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToList(GetToListDtoSelector<TDto>());
|
||||
Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
return Expression.Lambda<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TDto>>(
|
||||
typeof(TDto).InternalNewExpression(),
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"),
|
||||
Expression.Parameter(typeof(T2), "b"),
|
||||
Expression.Parameter(typeof(T3), "c"),
|
||||
Expression.Parameter(typeof(T4), "d"),
|
||||
Expression.Parameter(typeof(T5), "e"),
|
||||
Expression.Parameter(typeof(T6), "f"),
|
||||
Expression.Parameter(typeof(T7), "g"),
|
||||
Expression.Parameter(typeof(T8), "h"),
|
||||
Expression.Parameter(typeof(T9), "i"));
|
||||
_tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a"), Expression.Parameter(typeof(T2), "b"), Expression.Parameter(typeof(T3), "c"), Expression.Parameter(typeof(T4), "d"), Expression.Parameter(typeof(T5), "e"), Expression.Parameter(typeof(T6), "f"), Expression.Parameter(typeof(T7), "g"), Expression.Parameter(typeof(T8), "h"), Expression.Parameter(typeof(T9), "i"));
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
if (select == null || done == null) return;
|
||||
@ -199,9 +187,9 @@ namespace FreeSql.Internal.CommonProvider
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
|
||||
{
|
||||
if (condition == false || exp == null) return this.Where(null);
|
||||
if (condition == false || exp == null) return this;
|
||||
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
|
||||
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params)) : this;
|
||||
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null, _whereGlobalFilter, _params));
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
|
||||
@ -218,6 +206,135 @@ namespace FreeSql.Internal.CommonProvider
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.First<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>> select) => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TDto ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.First<TDto>() => (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
double ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Avg<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Avg((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelectGrouping<TKey, NativeTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.GroupBy<TKey>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TKey>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).GroupBy((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TKey>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Max<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Max((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
TMember ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Min<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Min<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.OrderBy<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).OrderBy<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.OrderByDescending<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).OrderByDescending<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.OrderByIf<TMember>(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column, bool descending)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).OrderByIf<TMember>(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify, descending);
|
||||
}
|
||||
|
||||
decimal ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Sum<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Sum<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
List<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToList<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToList<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
public void ToChunk<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select, int size, Action<FetchCallbackArgs<List<TReturn>>> done)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
(this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToChunk<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify, size, done);
|
||||
}
|
||||
|
||||
DataTable ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToDataTable<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToDataTable<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
int ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.InsertInto<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).InsertInto<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
string ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToSql<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select, FieldAliasOptions fieldAlias)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToSql<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify, fieldAlias);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.LeftJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).LeftJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.InnerJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).InnerJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.RightJoin(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).RightJoin((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Where(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Where((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.WhereIf(bool condition, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).WhereIf(condition, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Any(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Any((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToOne<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToList(select).FirstOrDefault();
|
||||
TReturn ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.First<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
=> (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#if net40
|
||||
#else
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.AvgAsync<TMember>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>> column)
|
||||
@ -291,6 +408,68 @@ namespace FreeSql.Internal.CommonProvider
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.FirstAsync<TReturn>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>> select) => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TDto> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.FirstAsync<TDto>() => (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
|
||||
#region HzyTuple 元组
|
||||
|
||||
Task<double> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.AvgAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).AvgAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.MaxAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).MaxAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<TMember> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.MinAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).MinAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<decimal> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.SumAsync<TMember>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TMember>> column)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(column, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).SumAsync<TMember>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TMember>>)expModify);
|
||||
}
|
||||
|
||||
Task<List<TReturn>> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToListAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToListAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<DataTable> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToDataTableAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).ToDataTableAsync<TReturn>((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>>)expModify);
|
||||
}
|
||||
|
||||
Task<int> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.InsertIntoAsync<TTargetEntity>(string tableName, Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TTargetEntity>> select)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(select, _tables);
|
||||
return (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).InsertIntoAsync<TTargetEntity>(tableName, (Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TTargetEntity>>)expModify);
|
||||
}
|
||||
|
||||
async Task<bool> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.AnyAsync(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, bool>> exp)
|
||||
{
|
||||
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
|
||||
return await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).AnyAsync((Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>>)expModify);
|
||||
}
|
||||
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.ToOneAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
async Task<TReturn> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.FirstAsync<TReturn>(Expression<Func<HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>, TReturn>> select)
|
||||
=> (await (this as ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>).Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
@ -1,91 +1,6 @@
|
||||
namespace HzySql.Models
|
||||
namespace FreeSql.Internal.Model
|
||||
{
|
||||
using HzySql.Interface;
|
||||
|
||||
public class HzyTuple
|
||||
{
|
||||
/// <summary>
|
||||
/// 在 拉姆达表达式 where 表达式中使用 w => w.In(w.t1.Member_ID, guidsArray)
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="array"></param>
|
||||
/// <returns></returns>
|
||||
public bool In<T, T2>(T field, params T2[] array) => true;
|
||||
|
||||
/// <summary>
|
||||
/// 子查询 只能在 Where 中使用
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="field"></param>
|
||||
/// <param name="iCurdBase"></param>
|
||||
/// <returns></returns>
|
||||
public bool In<T, T2>(T field, T2 iCurdBase) where T2 : ISqlContext => true;
|
||||
|
||||
/// <summary>
|
||||
/// 在 拉姆达表达式 where 表达式中使用 w => w.NotIn(w.t1.Member_ID, guidsArray)
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="array"></param>
|
||||
/// <returns></returns>
|
||||
public bool NotIn<T, T2>(T field, params T2[] array) => true;
|
||||
|
||||
/// <summary>
|
||||
/// 子查询 只能在 Where 中使用
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="field"></param>
|
||||
/// <param name="iCurdBase"></param>
|
||||
/// <returns></returns>
|
||||
public bool NotIn<T, T2>(T field, T2 iCurdBase) where T2 : ISqlContext => true;
|
||||
|
||||
/// <summary>
|
||||
/// like %123% 只能在 Where 中使用
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public bool Like<T, T2>(T field, T2 value) => true;
|
||||
|
||||
/// <summary>
|
||||
/// like 123% 只能在 Where 中使用
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public bool LikeStart<T, T2>(T field, T2 value) => true;
|
||||
|
||||
/// <summary>
|
||||
/// like %123 只能在 Where 中使用
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public bool LikeEnd<T, T2>(T field, T2 value) => true;
|
||||
|
||||
/// <summary>
|
||||
/// 一般在Where 条件中使用 例如 : w.HzySql("convert(varchar(50),UserName,23) > convert(varchar(50),GetDate(),23)")
|
||||
/// 一般用来支持这种语法》CONVERT(varchar(100), GETDATE(), 23) -- 2006-05-16
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public bool HzySql(string value) => true;
|
||||
|
||||
/// <summary>
|
||||
/// 一般在Where 条件中使用 例如 : w.HzySql<DateTime>("convert(varchar(50),UserName,23)") > DateTime.Now.ToString("yyyy-MM-dd")
|
||||
/// 一般用来支持这种语法》CONVERT(varchar(100), GETDATE(), 23) -- 2006-05-16
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public TR HzySql<TR>(string value) => default(TR);
|
||||
}
|
||||
|
||||
public class HzyTuple<T> : HzyTuple
|
||||
public class HzyTuple<T>
|
||||
{
|
||||
public HzyTuple(T t)
|
||||
{
|
||||
@ -96,7 +11,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2> : HzyTuple
|
||||
public class HzyTuple<T1, T2>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2)
|
||||
{
|
||||
@ -108,7 +23,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3)
|
||||
{
|
||||
@ -121,7 +36,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4)
|
||||
{
|
||||
@ -135,7 +50,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
|
||||
{
|
||||
@ -150,7 +65,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
|
||||
{
|
||||
@ -166,7 +81,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
|
||||
{
|
||||
@ -183,7 +98,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
|
||||
{
|
||||
@ -201,7 +116,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9)
|
||||
{
|
||||
@ -220,7 +135,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10)
|
||||
{
|
||||
@ -240,7 +155,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11)
|
||||
{
|
||||
@ -261,7 +176,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12)
|
||||
{
|
||||
@ -283,7 +198,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13)
|
||||
{
|
||||
@ -306,7 +221,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14)
|
||||
{
|
||||
@ -330,7 +245,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15)
|
||||
{
|
||||
@ -355,7 +270,7 @@
|
||||
}
|
||||
|
||||
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> : HzyTuple
|
||||
public class HzyTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
|
||||
{
|
||||
public HzyTuple(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user