mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Add SqlFunc.RowSum
This commit is contained in:
@@ -24,6 +24,10 @@ namespace SqlSugar
|
||||
{
|
||||
return "count(1) over()";
|
||||
}
|
||||
public string RowSum(MethodCallExpressionModel model)
|
||||
{
|
||||
return "SUM(" + model.Args[0].MemberName +") over()";
|
||||
}
|
||||
public virtual string IIF(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
|
@@ -90,6 +90,7 @@ namespace SqlSugar
|
||||
string Stuff(MethodCallExpressionModel model);
|
||||
string RowNumber(MethodCallExpressionModel model);
|
||||
string RowCount(MethodCallExpressionModel model);
|
||||
string RowSum(MethodCallExpressionModel model);
|
||||
string Exists(MethodCallExpressionModel model);
|
||||
string GetDateString(string dateValue,string format);
|
||||
string GetForXmlPath();
|
||||
|
@@ -33,6 +33,10 @@ namespace SqlSugar
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
public static TRestult RowSum<TRestult>(TRestult filedName)
|
||||
{
|
||||
throw new NotSupportedException("Can only be used in expressions");
|
||||
}
|
||||
|
||||
public static string JsonField(object json,string fieldName)
|
||||
{
|
||||
|
@@ -790,6 +790,8 @@ namespace SqlSugar
|
||||
return this.Context.DbMehtods.RowNumber(model);
|
||||
case "RowCount":
|
||||
return this.Context.DbMehtods.RowCount(model);
|
||||
case "RowSum":
|
||||
return this.Context.DbMehtods.RowSum(model);
|
||||
case "Exists":
|
||||
if (model.Args.Count > 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user