/// <summary>
        /// 根据分页筛选数据
        /// </summary>
        /// <param name="Key">主键</param>
        /// <param name="start">开始数据</param>
        /// <param name="PageSize">页面长度</param>
        /// <param name="desc">排序</param>
        /// <param name="model">对象</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public List <Grade_Commodity_View> SelectByPage(string Key, int start, int PageSize, bool desc = true, Grade_Commodity_View model = null, string SelectFiled = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Grade_Commodity_View>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.Name.IsNullOrEmpty())
                {
                    query.Where(p => p.Name == model.Name);
                }
                if (!model.Image.IsNullOrEmpty())
                {
                    query.Where(p => p.Image == model.Image);
                }
                if (!model.GradeId.IsNullOrEmpty())
                {
                    query.Where(p => p.GradeId == model.GradeId);
                }
                if (!model.ScenceIds.IsNullOrEmpty())
                {
                    query.Where(p => p.ScenceIds == model.ScenceIds);
                }
                if (!model.FrontView.IsNullOrEmpty())
                {
                    query.Where(p => p.FrontView == model.FrontView);
                }
                if (!model.BackView.IsNullOrEmpty())
                {
                    query.Where(p => p.BackView == model.BackView);
                }
                if (!model.PrintingMethod.IsNullOrEmpty())
                {
                    query.Where(p => p.PrintingMethod == model.PrintingMethod);
                }
                if (!model.Color.IsNullOrEmpty())
                {
                    query.Where(p => p.Color == model.Color);
                }
                if (!model.Content.IsNullOrEmpty())
                {
                    query.Where(p => p.Content == model.Content);
                }
                if (!model.Sales.IsNullOrEmpty())
                {
                    query.Where(p => p.Sales == model.Sales);
                }
                if (!model.CreateTime.IsNullOrEmpty())
                {
                    query.Where(p => p.CreateTime == model.CreateTime);
                }
                if (!model.RecommendTime.IsNullOrEmpty())
                {
                    query.Where(p => p.RecommendTime == model.RecommendTime);
                }
                if (!model.Points.IsNullOrEmpty())
                {
                    query.Where(p => p.Points == model.Points);
                }
                if (!model.IsRelease.IsNullOrEmpty())
                {
                    query.Where(p => p.IsRelease == model.IsRelease);
                }
                if (!model.LastOperTime.IsNullOrEmpty())
                {
                    query.Where(p => p.LastOperTime == model.LastOperTime);
                }
                if (!model.LastOperId.IsNullOrEmpty())
                {
                    query.Where(p => p.LastOperId == model.LastOperId);
                }
                if (!model.ClickCount.IsNullOrEmpty())
                {
                    query.Where(p => p.ClickCount == model.ClickCount);
                }
                if (!model.Stars.IsNullOrEmpty())
                {
                    query.Where(p => p.Stars == model.Stars);
                }
                if (!model.StarCount.IsNullOrEmpty())
                {
                    query.Where(p => p.StarCount == model.StarCount);
                }
                if (!model.Introduce.IsNullOrEmpty())
                {
                    query.Where(p => p.Introduce == model.Introduce);
                }
                if (!model.ImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.ImageList == model.ImageList);
                }
                if (!model.PringtingPosition.IsNullOrEmpty())
                {
                    query.Where(p => p.PringtingPosition == model.PringtingPosition);
                }
                if (!model.CommodityInfo.IsNullOrEmpty())
                {
                    query.Where(p => p.CommodityInfo == model.CommodityInfo);
                }
                if (!model.MaterialId.IsNullOrEmpty())
                {
                    query.Where(p => p.MaterialId == model.MaterialId);
                }
                if (!model.IsDelete.IsNullOrEmpty())
                {
                    query.Where(p => p.IsDelete == model.IsDelete);
                }
                if (!model.GradeAttrName.IsNullOrEmpty())
                {
                    query.Where(p => p.GradeAttrName == model.GradeAttrName);
                }
            }
            if (SelectFiled != null)
            {
                SelectFiled = SelectFiled.ToLowerInvariant();
                if (SelectFiled.Contains("id,"))
                {
                    query.Select(p => new { p.Id });
                }
                if (SelectFiled.Contains("name,"))
                {
                    query.Select(p => new { p.Name });
                }
                if (SelectFiled.Contains("image,"))
                {
                    query.Select(p => new { p.Image });
                }
                if (SelectFiled.Contains("gradeid,"))
                {
                    query.Select(p => new { p.GradeId });
                }
                if (SelectFiled.Contains("scenceids,"))
                {
                    query.Select(p => new { p.ScenceIds });
                }
                if (SelectFiled.Contains("frontview,"))
                {
                    query.Select(p => new { p.FrontView });
                }
                if (SelectFiled.Contains("backview,"))
                {
                    query.Select(p => new { p.BackView });
                }
                if (SelectFiled.Contains("printingmethod,"))
                {
                    query.Select(p => new { p.PrintingMethod });
                }
                if (SelectFiled.Contains("color,"))
                {
                    query.Select(p => new { p.Color });
                }
                if (SelectFiled.Contains("content,"))
                {
                    query.Select(p => new { p.Content });
                }
                if (SelectFiled.Contains("sales,"))
                {
                    query.Select(p => new { p.Sales });
                }
                if (SelectFiled.Contains("createtime,"))
                {
                    query.Select(p => new { p.CreateTime });
                }
                if (SelectFiled.Contains("recommendtime,"))
                {
                    query.Select(p => new { p.RecommendTime });
                }
                if (SelectFiled.Contains("points,"))
                {
                    query.Select(p => new { p.Points });
                }
                if (SelectFiled.Contains("isrelease,"))
                {
                    query.Select(p => new { p.IsRelease });
                }
                if (SelectFiled.Contains("lastopertime,"))
                {
                    query.Select(p => new { p.LastOperTime });
                }
                if (SelectFiled.Contains("lastoperid,"))
                {
                    query.Select(p => new { p.LastOperId });
                }
                if (SelectFiled.Contains("clickcount,"))
                {
                    query.Select(p => new { p.ClickCount });
                }
                if (SelectFiled.Contains("stars,"))
                {
                    query.Select(p => new { p.Stars });
                }
                if (SelectFiled.Contains("starcount,"))
                {
                    query.Select(p => new { p.StarCount });
                }
                if (SelectFiled.Contains("introduce,"))
                {
                    query.Select(p => new { p.Introduce });
                }
                if (SelectFiled.Contains("imagelist,"))
                {
                    query.Select(p => new { p.ImageList });
                }
                if (SelectFiled.Contains("pringtingposition,"))
                {
                    query.Select(p => new { p.PringtingPosition });
                }
                if (SelectFiled.Contains("commodityinfo,"))
                {
                    query.Select(p => new { p.CommodityInfo });
                }
                if (SelectFiled.Contains("materialid,"))
                {
                    query.Select(p => new { p.MaterialId });
                }
                if (SelectFiled.Contains("isdelete,"))
                {
                    query.Select(p => new { p.IsDelete });
                }
                if (SelectFiled.Contains("gradeattrname,"))
                {
                    query.Select(p => new { p.GradeAttrName });
                }
            }
            if (Key != null)
            {
                query.OrderByKey(Key, desc);
            }
            return(query.GetQueryPageList(start, PageSize, connection, transaction));
        }
        /// <summary>
        /// 数据条数
        /// </summary>
        /// <param name="model">模型</param>
        /// <param name="connection">连接</param>
        /// <param name="transaction">事务</param>
        /// <returns>对象列表</returns>
        public int SelectCount(Grade_Commodity_View model = null, IDbConnection connection = null, IDbTransaction transaction = null)
        {
            var query = new LambdaQuery <Grade_Commodity_View>();

            if (model != null)
            {
                if (!model.Id.IsNullOrEmpty())
                {
                    query.Where(p => p.Id == model.Id);
                }
                if (!model.Name.IsNullOrEmpty())
                {
                    query.Where(p => p.Name == model.Name);
                }
                if (!model.Image.IsNullOrEmpty())
                {
                    query.Where(p => p.Image == model.Image);
                }
                if (!model.GradeId.IsNullOrEmpty())
                {
                    query.Where(p => p.GradeId == model.GradeId);
                }
                if (!model.ScenceIds.IsNullOrEmpty())
                {
                    query.Where(p => p.ScenceIds == model.ScenceIds);
                }
                if (!model.FrontView.IsNullOrEmpty())
                {
                    query.Where(p => p.FrontView == model.FrontView);
                }
                if (!model.BackView.IsNullOrEmpty())
                {
                    query.Where(p => p.BackView == model.BackView);
                }
                if (!model.PrintingMethod.IsNullOrEmpty())
                {
                    query.Where(p => p.PrintingMethod == model.PrintingMethod);
                }
                if (!model.Color.IsNullOrEmpty())
                {
                    query.Where(p => p.Color == model.Color);
                }
                if (!model.Content.IsNullOrEmpty())
                {
                    query.Where(p => p.Content == model.Content);
                }
                if (!model.Sales.IsNullOrEmpty())
                {
                    query.Where(p => p.Sales == model.Sales);
                }
                if (!model.CreateTime.IsNullOrEmpty())
                {
                    query.Where(p => p.CreateTime == model.CreateTime);
                }
                if (!model.RecommendTime.IsNullOrEmpty())
                {
                    query.Where(p => p.RecommendTime == model.RecommendTime);
                }
                if (!model.Points.IsNullOrEmpty())
                {
                    query.Where(p => p.Points == model.Points);
                }
                if (!model.IsRelease.IsNullOrEmpty())
                {
                    query.Where(p => p.IsRelease == model.IsRelease);
                }
                if (!model.LastOperTime.IsNullOrEmpty())
                {
                    query.Where(p => p.LastOperTime == model.LastOperTime);
                }
                if (!model.LastOperId.IsNullOrEmpty())
                {
                    query.Where(p => p.LastOperId == model.LastOperId);
                }
                if (!model.ClickCount.IsNullOrEmpty())
                {
                    query.Where(p => p.ClickCount == model.ClickCount);
                }
                if (!model.Stars.IsNullOrEmpty())
                {
                    query.Where(p => p.Stars == model.Stars);
                }
                if (!model.StarCount.IsNullOrEmpty())
                {
                    query.Where(p => p.StarCount == model.StarCount);
                }
                if (!model.Introduce.IsNullOrEmpty())
                {
                    query.Where(p => p.Introduce == model.Introduce);
                }
                if (!model.ImageList.IsNullOrEmpty())
                {
                    query.Where(p => p.ImageList == model.ImageList);
                }
                if (!model.PringtingPosition.IsNullOrEmpty())
                {
                    query.Where(p => p.PringtingPosition == model.PringtingPosition);
                }
                if (!model.CommodityInfo.IsNullOrEmpty())
                {
                    query.Where(p => p.CommodityInfo == model.CommodityInfo);
                }
                if (!model.MaterialId.IsNullOrEmpty())
                {
                    query.Where(p => p.MaterialId == model.MaterialId);
                }
                if (!model.IsDelete.IsNullOrEmpty())
                {
                    query.Where(p => p.IsDelete == model.IsDelete);
                }
                if (!model.GradeAttrName.IsNullOrEmpty())
                {
                    query.Where(p => p.GradeAttrName == model.GradeAttrName);
                }
            }
            return(query.GetQueryCount(connection, transaction));
        }
 /// <summary>
 /// 数据条数
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public int SelectCount(Grade_Commodity_View model)
 {
     return(Grade_Commodity_ViewOper.Instance.SelectCount(model));
 }
 /// <summary>
 /// 根据分页筛选数据
 /// </summary>
 /// <param name="Key">主键</param>
 /// <param name="start">开始数据</param>
 /// <param name="PageSize">页面长度</param>
 /// <param name="desc">排序</param>
 /// <param name="model">对象</param>
 /// <returns>对象列表</returns>
 public List <Grade_Commodity_View> SelectByPage(string Key, int start, int PageSize, bool desc, Grade_Commodity_View model, string SelectFiled)
 {
     return(Grade_Commodity_ViewOper.Instance.SelectByPage(Key, start, PageSize, desc, model));
 }
 /// <summary>
 /// 筛选全部数据
 /// </summary>
 /// <param name="model">模型</param>
 /// <returns>对象列表</returns>
 public List <Grade_Commodity_View> SelectByModel(Grade_Commodity_View model)
 {
     return(Grade_Commodity_ViewOper.Instance.SelectAll(model));
 }