This commit is contained in:
晶晶 李
2025-12-18 16:44:10 +08:00
5 changed files with 8 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore.Kdbndp</id>
<version>9.3.7.1211</version>
<version>9.3.7.1216</version>
<authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

View File

@@ -454,7 +454,11 @@ namespace SqlSugar
var parameter = model.Args[0];
return string.Format("SUM(DISTINCT {0} )", parameter.MemberName);
}
public virtual string AggregateDistinctAvg(MethodCallExpressionModel model)
{
var parameter = model.Args[0];
return string.Format("AVG(DISTINCT {0} )", parameter.MemberName);
}
public virtual string MappingColumn(MethodCallExpressionModel model)
{
if (model.Args.Count == 1)

View File

@@ -56,6 +56,7 @@ namespace SqlSugar
string AggregateCount(MethodCallExpressionModel model);
string AggregateDistinctCount(MethodCallExpressionModel model);
string AggregateDistinctSum(MethodCallExpressionModel model);
string AggregateDistinctAvg(MethodCallExpressionModel model);
string MappingColumn(MethodCallExpressionModel model);
string IsNull(MethodCallExpressionModel model);
string GetSelfAndAutoFill(string shortName,bool isSingle);

View File

@@ -377,6 +377,7 @@ namespace SqlSugar
public static int AggregateCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int AggregateDistinctCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int AggregateDistinctSum<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int AggregateDistinctAvg<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static TResult MappingColumn<TResult>(TResult type,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
public static TResult MappingColumn<TResult>(string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
/// <summary>