mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add SqlFunc.AggregateDistinctCount
This commit is contained in:
parent
1a0f80fdf6
commit
b89c05d2bc
@ -264,6 +264,12 @@ namespace SqlSugar
|
|||||||
return string.Format("COUNT({0})", parameter.MemberName);
|
return string.Format("COUNT({0})", parameter.MemberName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual string AggregateDistinctCount(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
var parameter = model.Args[0];
|
||||||
|
return string.Format("COUNT(DISTINCT{0})", parameter.MemberName);
|
||||||
|
}
|
||||||
|
|
||||||
public virtual string MappingColumn(MethodCallExpressionModel model)
|
public virtual string MappingColumn(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
var parameter = model.Args[0];
|
||||||
|
@ -48,6 +48,7 @@ namespace SqlSugar
|
|||||||
string AggregateMin(MethodCallExpressionModel model);
|
string AggregateMin(MethodCallExpressionModel model);
|
||||||
string AggregateMax(MethodCallExpressionModel model);
|
string AggregateMax(MethodCallExpressionModel model);
|
||||||
string AggregateCount(MethodCallExpressionModel model);
|
string AggregateCount(MethodCallExpressionModel model);
|
||||||
|
string AggregateDistinctCount(MethodCallExpressionModel model);
|
||||||
string MappingColumn(MethodCallExpressionModel model);
|
string MappingColumn(MethodCallExpressionModel model);
|
||||||
string IsNull(MethodCallExpressionModel model);
|
string IsNull(MethodCallExpressionModel model);
|
||||||
string GetSelfAndAutoFill(string shortName,bool isSingle);
|
string GetSelfAndAutoFill(string shortName,bool isSingle);
|
||||||
|
@ -578,6 +578,8 @@ namespace SqlSugar
|
|||||||
return this.Context.DbMehtods.AggregateMax(model);
|
return this.Context.DbMehtods.AggregateMax(model);
|
||||||
case "AggregateCount":
|
case "AggregateCount":
|
||||||
return this.Context.DbMehtods.AggregateCount(model);
|
return this.Context.DbMehtods.AggregateCount(model);
|
||||||
|
case "AggregateDistinctCount":
|
||||||
|
return this.Context.DbMehtods.AggregateDistinctCount(model);
|
||||||
case "MappingColumn":
|
case "MappingColumn":
|
||||||
var mappingColumnResult = this.Context.DbMehtods.MappingColumn(model);
|
var mappingColumnResult = this.Context.DbMehtods.MappingColumn(model);
|
||||||
var isValid = model.Args[0].IsMember && model.Args[1].IsMember == false;
|
var isValid = model.Args[0].IsMember && model.Args[1].IsMember == false;
|
||||||
|
Loading…
Reference in New Issue
Block a user