Synchronization code

This commit is contained in:
sunkaixuan 2023-06-03 19:16:16 +08:00
parent fd8fe65ffc
commit 90aff49603
4 changed files with 33 additions and 1 deletions

View File

@ -28,6 +28,18 @@ namespace SqlSugar
{
return "SUM(" + model.Args[0].MemberName +") over()";
}
public string RowAvg(MethodCallExpressionModel model)
{
return "AVG(" + model.Args[0].MemberName + ") over()";
}
public string RowMin(MethodCallExpressionModel model)
{
return "Min(" + model.Args[0].MemberName + ") over()";
}
public string RowMax(MethodCallExpressionModel model)
{
return "Max(" + model.Args[0].MemberName + ") over()";
}
public virtual string IIF(MethodCallExpressionModel model)
{
var parameter = model.Args[0];

View File

@ -91,6 +91,9 @@ namespace SqlSugar
string RowNumber(MethodCallExpressionModel model);
string RowCount(MethodCallExpressionModel model);
string RowSum(MethodCallExpressionModel model);
string RowMin(MethodCallExpressionModel model);
string RowMax(MethodCallExpressionModel model);
string RowAvg(MethodCallExpressionModel model);
string Exists(MethodCallExpressionModel model);
string GetDateString(string dateValue,string format);
string GetForXmlPath();

View File

@ -41,7 +41,18 @@ namespace SqlSugar
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMax<TRestult>(TRestult filedName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowMin<TRestult>(TRestult filedName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static TRestult RowAvg<TRestult>(TRestult filedName)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static string JsonField(object json,string fieldName)
{
throw new NotSupportedException("Can only be used in expressions");

View File

@ -792,6 +792,12 @@ namespace SqlSugar
return this.Context.DbMehtods.RowCount(model);
case "RowSum":
return this.Context.DbMehtods.RowSum(model);
case "RowMax":
return this.Context.DbMehtods.RowMax(model);
case "RowMin":
return this.Context.DbMehtods.RowMin(model);
case "RowAvg":
return this.Context.DbMehtods.RowAvg(model);
case "Exists":
if (model.Args.Count > 1)
{