Browse Source

Synchronization code

pull/33/head
sunkaixuan 2 years ago
parent
commit
4933dbd8db
  1. 4
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs
  2. 1
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs
  3. 4
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs
  4. 2
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs

4
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

@ -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];

1
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/IDbMethods.cs

@ -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();

4
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs

@ -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)
{

2
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve_Helper.cs

@ -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)
{

Loading…
Cancel
Save