mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
Synchronization code
This commit is contained in:
parent
3d985c35bb
commit
281cee9513
@ -1996,6 +1996,7 @@ namespace SqlSugar
|
||||
asyncQueryableBuilder.AppendColumns = this.Context.Utilities.TranslateCopy(this.QueryBuilder.AppendColumns);
|
||||
asyncQueryableBuilder.AppendValues = this.Context.Utilities.TranslateCopy(this.QueryBuilder.AppendValues);
|
||||
asyncQueryableBuilder.RemoveFilters = this.QueryBuilder.RemoveFilters?.ToArray();
|
||||
asyncQueryableBuilder.Hints = this.QueryBuilder.Hints;
|
||||
if (this.QueryBuilder.AppendNavInfo != null)
|
||||
{
|
||||
asyncQueryableBuilder.AppendNavInfo = new AppendNavInfo()
|
||||
|
@ -324,6 +324,11 @@ namespace SqlSugar
|
||||
((QueryableProvider<T>)queryable).Mappers = this.Mappers;
|
||||
return queryable;
|
||||
}
|
||||
public ISugarQueryable<T> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public virtual ISugarQueryable<T> AS<T2>(string tableName)
|
||||
{
|
||||
var entityName = typeof(T2).Name;
|
||||
|
@ -16,6 +16,11 @@ namespace SqlSugar
|
||||
#region T2
|
||||
public partial class QueryableProvider<T, T2> : QueryableProvider<T>, ISugarQueryable<T, T2>
|
||||
{
|
||||
public new ISugarQueryable<T,T2> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -663,6 +668,11 @@ namespace SqlSugar
|
||||
#region T3
|
||||
public partial class QueryableProvider<T, T2, T3> : QueryableProvider<T>, ISugarQueryable<T, T2, T3>
|
||||
{
|
||||
public new ISugarQueryable<T, T2,T3> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -1416,6 +1426,11 @@ namespace SqlSugar
|
||||
#region T4
|
||||
public partial class QueryableProvider<T, T2, T3, T4> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3,T4> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -2190,6 +2205,11 @@ namespace SqlSugar
|
||||
#region T5
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4,T5> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
|
@ -15,6 +15,11 @@ namespace SqlSugar
|
||||
#region T6
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5,T6> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5,T6> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -799,6 +804,11 @@ namespace SqlSugar
|
||||
#region T7
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6,T7> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6,T7> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -1593,6 +1603,11 @@ namespace SqlSugar
|
||||
#region T8
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7,T8> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7,T8> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -2323,6 +2338,11 @@ namespace SqlSugar
|
||||
#region T9
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8, T9> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8,T9> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8,T9> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -3013,6 +3033,11 @@ namespace SqlSugar
|
||||
#region T10
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8, T9, T10> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
|
@ -15,6 +15,11 @@ namespace SqlSugar
|
||||
#region T11
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10,T11> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
@ -738,6 +743,11 @@ namespace SqlSugar
|
||||
#region T12
|
||||
public partial class QueryableProvider<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : QueryableProvider<T>, ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
{
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,T12> Hints(string hints)
|
||||
{
|
||||
this.QueryBuilder.Hints = hints;
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,T12> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
|
||||
{
|
||||
base.OrderByPropertyName(orderPropertyName, orderByType);
|
||||
|
@ -34,6 +34,7 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Splicing basic
|
||||
public string Hints { get; set; }
|
||||
internal AppendNavInfo AppendNavInfo { get; set; }
|
||||
public Type[] RemoveFilters { get; set; }
|
||||
public Dictionary<string, object> SubToListParameters { get; set; }
|
||||
@ -689,6 +690,10 @@ namespace SqlSugar
|
||||
}
|
||||
public string GetSqlQuerySql(string result)
|
||||
{
|
||||
if (this.Hints.HasValue())
|
||||
{
|
||||
result = ReplaceHints(result);
|
||||
}
|
||||
if (GetTableNameString == " (-- No table ) t ")
|
||||
{
|
||||
result = "-- No table ";
|
||||
@ -707,6 +712,16 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual string ReplaceHints(string result)
|
||||
{
|
||||
result = Regex.Replace(result, "^SELECT ", it =>
|
||||
{
|
||||
return $"{it} {Hints} ";
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
protected string SubToListMethod(string result)
|
||||
{
|
||||
string oldResult = result;
|
||||
|
@ -17,6 +17,7 @@ namespace SqlSugar
|
||||
bool IsCache { get; set; }
|
||||
int CacheTime { get; set; }
|
||||
ISugarQueryable<T> Clone();
|
||||
ISugarQueryable<T> Hints(string hints);
|
||||
ISugarQueryable<T> AS<T2>(string tableName);
|
||||
ISugarQueryable<T> AS(string tableName);
|
||||
ISugarQueryable<T> AsWithAttr();
|
||||
@ -287,6 +288,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T,T2> Hints(string hints);
|
||||
new ISugarQueryable<T,T2> SampleBy(int timeNumber, SampleByUnit timeType);
|
||||
new ISugarQueryable<T,T2> SampleBy(int timeNumber, string timeType);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T,T2, TResult>> expression);
|
||||
@ -412,6 +414,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2,T3> Hints(string hints);
|
||||
new ISugarQueryable<T, T2,T3> SampleBy(int timeNumber, SampleByUnit timeType);
|
||||
new ISugarQueryable<T, T2,T3> SampleBy(int timeNumber, string timeType);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2,T3, TResult>> expression);
|
||||
@ -552,6 +555,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3,T4> Hints(string hints);
|
||||
new ISugarQueryable<T, T2, T3,T4> SampleBy(int timeNumber, SampleByUnit timeType);
|
||||
new ISugarQueryable<T, T2, T3,T4> SampleBy(int timeNumber, string timeType);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3,T4, TResult>> expression);
|
||||
@ -698,6 +702,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4,T5> Hints(string hints);
|
||||
new ISugarQueryable<T, T2, T3, T4,T5> SampleBy(int timeNumber, SampleByUnit timeType);
|
||||
new ISugarQueryable<T, T2, T3, T4,T5> SampleBy(int timeNumber, string timeType);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3,T4,T5, TResult>> expression);
|
||||
@ -840,6 +845,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5,T6> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5,T6, TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6,T7> LeftJoinIF<T7>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6,T7, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6,T7> InnerJoinIF<T7>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6,T7, bool>> joinExpression);
|
||||
@ -989,6 +995,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6,T7> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6,T7, TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7,T8> LeftJoinIF<T8>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7,T8, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7,T8> InnerJoinIF<T8>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7,T8, bool>> joinExpression);
|
||||
@ -1133,6 +1140,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7,T8> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6, T7,T8, TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8,T9> LeftJoinIF<T9>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8,T9, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8,T9> InnerJoinIF<T9>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7,T8,T9, bool>> joinExpression);
|
||||
@ -1278,6 +1286,7 @@ namespace SqlSugar
|
||||
#region 9-12
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8,T9> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8,T9,TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10> LeftJoinIF<T10>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9,T10, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10> InnerJoinIF<T10>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7,T8,T9,T10, bool>> joinExpression);
|
||||
@ -1403,6 +1412,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9,T10> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6, T7,T8,T9,T10,TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11> LeftJoinIF<T11>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11> InnerJoinIF<T11>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11, bool>> joinExpression);
|
||||
@ -1536,6 +1546,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11, TResult>> expression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> LeftJoinIF<T12>(bool isLeftJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> joinExpression);
|
||||
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11,T12> InnerJoinIF<T12>(bool isJoin, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10,T11,T12, bool>> joinExpression);
|
||||
@ -1673,6 +1684,7 @@ namespace SqlSugar
|
||||
}
|
||||
public partial interface ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : ISugarQueryable<T>
|
||||
{
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,T12> Hints(string hints);
|
||||
ISugarQueryable<TResult> SelectMergeTable<TResult>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,T12, TResult>> expression);
|
||||
#region Where
|
||||
new ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,T12> Where(string expShortName, FormattableString expressionString);
|
||||
|
Loading…
Reference in New Issue
Block a user