mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Update .net core project
This commit is contained in:
@@ -340,9 +340,17 @@ namespace SqlSugar
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
foreach (var item in groupQuery)
|
foreach (var item in groupQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
// var setValue = navList.FirstOrDefault(x => navPkColumn.PropertyInfo.GetValue(x).ObjToString() == navColumn.PropertyInfo.GetValue(item).ObjToString());
|
// var setValue = navList.FirstOrDefault(x => navPkColumn.PropertyInfo.GetValue(x).ObjToString() == navColumn.PropertyInfo.GetValue(item).ObjToString());
|
||||||
navObjectNamePropety.SetValue(item.l, item.n);
|
|
||||||
|
if (navObjectNamePropety.GetValue(item.l) == null)
|
||||||
|
{
|
||||||
|
navObjectNamePropety.SetValue(item.l, item.n);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//The reserved
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,21 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public partial class DefaultDbMethod : IDbMethods
|
public partial class DefaultDbMethod : IDbMethods
|
||||||
{
|
{
|
||||||
|
public virtual string RowNumber(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
if (model.Args.Count == 1)
|
||||||
|
{
|
||||||
|
return $"row_number() over(order by {model.Args[0].MemberName})";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $"row_number() over( partition by {model.Args[1].MemberName} order by {model.Args[0].MemberName})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public virtual string RowCount(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
return "count(1) over()";
|
||||||
|
}
|
||||||
public virtual string IIF(MethodCallExpressionModel model)
|
public virtual string IIF(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
var parameter = model.Args[0];
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ namespace SqlSugar
|
|||||||
string Asc(MethodCallExpressionModel model);
|
string Asc(MethodCallExpressionModel model);
|
||||||
string Desc(MethodCallExpressionModel model);
|
string Desc(MethodCallExpressionModel model);
|
||||||
string Stuff(MethodCallExpressionModel model);
|
string Stuff(MethodCallExpressionModel model);
|
||||||
|
string RowNumber(MethodCallExpressionModel model);
|
||||||
|
string RowCount(MethodCallExpressionModel model);
|
||||||
|
|
||||||
string GetDateString(string dateValue,string format);
|
string GetDateString(string dateValue,string format);
|
||||||
string GetForXmlPath();
|
string GetForXmlPath();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public partial class SqlFunc
|
public partial class SqlFunc
|
||||||
{
|
{
|
||||||
|
public static int RowNumber(object orderByField, object partitionBy)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
}
|
||||||
|
public static int RowNumber(object orderByField)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
}
|
||||||
|
public static int RowCount()
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
}
|
||||||
public static T Desc<T>(T value)
|
public static T Desc<T>(T value)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException("Can only be used in expressions");
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
|||||||
@@ -1010,6 +1010,10 @@ namespace SqlSugar
|
|||||||
return this.Context.DbMehtods.Desc(model);
|
return this.Context.DbMehtods.Desc(model);
|
||||||
case "Stuff":
|
case "Stuff":
|
||||||
return this.Context.DbMehtods.Stuff(model);
|
return this.Context.DbMehtods.Stuff(model);
|
||||||
|
case "RowNumber":
|
||||||
|
return this.Context.DbMehtods.RowNumber(model);
|
||||||
|
case "RowCount":
|
||||||
|
return this.Context.DbMehtods.RowCount(model);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else if (Skip != null && Take != null)
|
else if (Skip != null && Take != null)
|
||||||
{
|
{
|
||||||
|
if (Skip == 0 && Take == 1 && this.OrderByValue == "ORDER BY NOW() ")
|
||||||
|
{
|
||||||
|
this.OrderByValue = null;
|
||||||
|
}
|
||||||
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
|
||||||
result = string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, Skip.ObjToInt() > 0 ? Skip.ObjToInt() : 0, Take);
|
result = string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, Skip.ObjToInt() > 0 ? Skip.ObjToInt() : 0, Take);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user