Beispiel #1
0
        /// <summary>
        /// 获取团购数量
        /// </summary>
        /// <param name="type">团购类型</param>
        /// <param name="status">团购状态</param>
        /// <param name="startTime">起始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>团购数量</returns>
        /// <remarks>2013-09-04 杨晗 创建</remarks>
        public override int GetCount(GroupShoppingStatus.团购类型 type, GroupShoppingStatus.团购状态 status,
                                     DateTime?startTime,
                                     DateTime?endTime)
        {
            #region sql条件

            const string sqlWhere =
                @"(@GroupType is null or ggs.GroupType =@GroupType) and (@Status is null or ggs.Status =@Status) and (@StartTime is null or ggs.StartTime >= @StartTime) and (@EndTime is null or ggs.EndTime <= @EndTime)";

            #endregion

            return(Context.Select <int>("count(1)")
                   .From("GsGroupShopping ggs")
                   .Where(sqlWhere)
                   .Parameter("GroupType", (int)type)
                   //.Parameter("GroupType", (int) type)
                   //.Parameter("Status", (int) status)
                   .Parameter("Status", (int)status)
                   //.Parameter("StartTime", startTime)
                   .Parameter("StartTime", startTime)
                   //.Parameter("EndTime", endTime)
                   .Parameter("EndTime", endTime)
                   .QuerySingle());
        }
Beispiel #2
0
 /// <summary>
 /// 获取团购数量
 /// </summary>
 /// <param name="type">团购类型</param>
 /// <param name="status">团购状态</param>
 /// <param name="startTime">起始时间</param>
 /// <param name="endTime">结束时间</param>
 /// <returns>团购数量</returns>
 /// <remarks>2013-09-04 杨晗 创建</remarks>
 public abstract int GetCount(GroupShoppingStatus.团购类型 type, GroupShoppingStatus.团购状态 status, DateTime?startTime,
                              DateTime?endTime);