NHibernate(4) HQL 分组、统计、映射

 

 ICriteria iCriteria = session.CreateCriteria(typeof(IEPDailyStatic));

 

iCriteria
.SetProjection(Projections.ProjectionList()
.Add(Projections.GroupProperty("Month"))
.Add(Projections.Property("Month"))
.Add(Projections.Sum("Count"))
.Add(Projections.Sum("Quantity"))
.Add(Projections.Sum("PaidMoney")))
.Add(Restrictions.Between("DeliveryDate", criteria.FromDate.ToString("yyyy-MM-dd"), criteria.ToDate.ToString("yyyy-MM-dd")))
.Add(Restrictions.Eq("SchedulingStatus", 5));

 

按照 字段 “Month” 进行分组,对字段 “Count”,“Quantity”,“PaidMoney” 进行统计,

转载于:https://www.cnblogs.com/babietongtianta/archive/2012/04/17/2453091.html

你可能感兴趣的:(NHibernate(4) HQL 分组、统计、映射)