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