/// <summary> /// 根据模型获取历史设计信息 /// </summary> /// <param name="model">用户模型</param> /// <returns></returns> public List <Hisdesigninfo_View> GetModleHisdesign(Hisdesigninfo_View model) { return(Hisdesigninfo_ViewOper.Instance.SelectByUser(model)); }
/// <summary> /// 根据模型获取历史设计信息 /// </summary> /// <param name="model">用户模型</param> /// <param name="start">开始条数</param> /// <param name="PageSize">页面大小</param> /// <returns></returns> public int GetHisdesignInfoCount(Hisdesigninfo_View model, List <string> Ids = null) { return(Hisdesigninfo_ViewOper.Instance.SelectUserCount(model, Ids)); }
/// <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 <Hisdesigninfo_View> SelectByUserPage(string Key, int start, int PageSize, bool desc = true, Hisdesigninfo_View model = null, IDbConnection connection = null, IDbTransaction transaction = null) { var query = new LambdaQuery <Hisdesigninfo_View>(); if (model != null) { if (!model.Id.IsNullOrEmpty()) { query.Where(p => p.Id == model.Id); } if (!model.UserGuId.IsNullOrEmpty() && !model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID || p.UserGuId == model.UserGuId); } else if (!model.UserGuId.IsNullOrEmpty() && model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserGuId == model.UserGuId); } else if (model.UserGuId.IsNullOrEmpty() && !model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID); } if (!model.CommodityId.IsNullOrEmpty()) { query.Where(p => p.CommodityId == model.CommodityId); } if (!model.BackView.IsNullOrEmpty()) { query.Where(p => p.BackView == model.BackView); } if (!model.ForntView.IsNullOrEmpty()) { query.Where(p => p.ForntView == model.ForntView); } if (!model.LastLookTime.IsNullOrEmpty()) { query.Where(p => p.LastLookTime == model.LastLookTime); } if (!model.Color.IsNullOrEmpty()) { query.Where(p => p.Color == model.Color); } if (!model.PrintingMethod.IsNullOrEmpty()) { query.Where(p => p.PrintingMethod == model.PrintingMethod); } if (!model.Attr.IsNullOrEmpty()) { query.Where(p => p.Attr == model.Attr); } if (!model.Amount.IsNullOrEmpty()) { query.Where(p => p.Amount == model.Amount); } if (!model.Name.IsNullOrEmpty()) { query.Where(p => p.Name == model.Name); } if (!model.Image.IsNullOrEmpty()) { query.Where(p => p.Image == model.Image); } if (!model.CommBackView.IsNullOrEmpty()) { query.Where(p => p.CommBackView == model.CommBackView); } if (!model.CommFrontView.IsNullOrEmpty()) { query.Where(p => p.CommFrontView == model.CommFrontView); } if (!model.IsMobile.IsNullOrEmpty()) { query.Where(p => p.IsMobile == model.IsMobile); } } 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 List <Hisdesigninfo_View> SelectByUser(Hisdesigninfo_View model = null, IDbConnection connection = null, IDbTransaction transaction = null) { var query = new LambdaQuery <Hisdesigninfo_View>(); //query.Select(p => new { p.UserID, p.UserGuId, p.PrintingMethod, p.Name, p.LastLookTime, p.Image, p.Id, p.ForntView, p.CommodityId, p.Color, p.BackView, p.Attr, p.Amount, p.CommBackView, p.CommFrontView }); if (model != null) { if (!model.Id.IsNullOrEmpty()) { query.Where(p => p.Id == model.Id); } if (!model.UserGuId.IsNullOrEmpty() && !model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID || p.UserGuId == model.UserGuId); } else if (!model.UserGuId.IsNullOrEmpty() && model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserGuId == model.UserGuId); } else if (model.UserGuId.IsNullOrEmpty() && !model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID); } if (!model.CommodityId.IsNullOrEmpty()) { query.Where(p => p.CommodityId == model.CommodityId); } if (!model.BackView.IsNullOrEmpty()) { query.Where(p => p.BackView == model.BackView); } if (!model.ForntView.IsNullOrEmpty()) { query.Where(p => p.ForntView == model.ForntView); } if (!model.LastLookTime.IsNullOrEmpty()) { query.Where(p => p.LastLookTime == model.LastLookTime); } if (!model.Color.IsNullOrEmpty()) { query.Where(p => p.Color == model.Color); } if (!model.PrintingMethod.IsNullOrEmpty()) { query.Where(p => p.PrintingMethod == model.PrintingMethod); } if (!model.Attr.IsNullOrEmpty()) { query.Where(p => p.Attr == model.Attr); } if (!model.Amount.IsNullOrEmpty()) { query.Where(p => p.Amount == model.Amount); } if (!model.Name.IsNullOrEmpty()) { query.Where(p => p.Name == model.Name); } if (!model.Image.IsNullOrEmpty()) { query.Where(p => p.Image == model.Image); } if (!model.CommBackView.IsNullOrEmpty()) { query.Where(p => p.CommBackView == model.CommBackView); } if (!model.CommFrontView.IsNullOrEmpty()) { query.Where(p => p.CommFrontView == model.CommFrontView); } if (!model.IsMobile.IsNullOrEmpty()) { query.Where(p => p.IsMobile == model.IsMobile); } } return(query.GetQueryList(connection, transaction)); }
/// <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 <Hisdesigninfo_View> SelectByPage(string Key, int start, int PageSize, bool desc = true, Hisdesigninfo_View model = null, string SelectFiled = null, IDbConnection connection = null, IDbTransaction transaction = null) { var query = new LambdaQuery <Hisdesigninfo_View>(); if (model != null) { if (!model.Id.IsNullOrEmpty()) { query.Where(p => p.Id == model.Id); } if (!model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID); } if (!model.UserGuId.IsNullOrEmpty()) { query.Where(p => p.UserGuId == model.UserGuId); } if (!model.CommodityId.IsNullOrEmpty()) { query.Where(p => p.CommodityId == model.CommodityId); } if (!model.BackContent.IsNullOrEmpty()) { query.Where(p => p.BackContent == model.BackContent); } if (!model.ForntContent.IsNullOrEmpty()) { query.Where(p => p.ForntContent == model.ForntContent); } if (!model.BackView.IsNullOrEmpty()) { query.Where(p => p.BackView == model.BackView); } if (!model.ForntView.IsNullOrEmpty()) { query.Where(p => p.ForntView == model.ForntView); } if (!model.LastLookTime.IsNullOrEmpty()) { query.Where(p => p.LastLookTime == model.LastLookTime); } if (!model.Color.IsNullOrEmpty()) { query.Where(p => p.Color == model.Color); } if (!model.PrintingMethod.IsNullOrEmpty()) { query.Where(p => p.PrintingMethod == model.PrintingMethod); } if (!model.Attr.IsNullOrEmpty()) { query.Where(p => p.Attr == model.Attr); } if (!model.Amount.IsNullOrEmpty()) { query.Where(p => p.Amount == model.Amount); } if (!model.OrderId.IsNullOrEmpty()) { query.Where(p => p.OrderId == model.OrderId); } if (!model.IsMobile.IsNullOrEmpty()) { query.Where(p => p.IsMobile == model.IsMobile); } if (!model.Name.IsNullOrEmpty()) { query.Where(p => p.Name == model.Name); } if (!model.Image.IsNullOrEmpty()) { query.Where(p => p.Image == model.Image); } if (!model.CommBackView.IsNullOrEmpty()) { query.Where(p => p.CommBackView == model.CommBackView); } if (!model.CommFrontView.IsNullOrEmpty()) { query.Where(p => p.CommFrontView == model.CommFrontView); } if (!model.MaterialId.IsNullOrEmpty()) { query.Where(p => p.MaterialId == model.MaterialId); } if (!model.ImageList.IsNullOrEmpty()) { query.Where(p => p.ImageList == model.ImageList); } if (!model.SalesInfoList.IsNullOrEmpty()) { query.Where(p => p.SalesInfoList == model.SalesInfoList); } if (!model.ProductNo.IsNullOrEmpty()) { query.Where(p => p.ProductNo == model.ProductNo); } if (!model.PrintFuncInfo.IsNullOrEmpty()) { query.Where(p => p.PrintFuncInfo == model.PrintFuncInfo); } } if (SelectFiled != null) { SelectFiled = SelectFiled.ToLowerInvariant(); if (SelectFiled.Contains("id,")) { query.Select(p => new { p.Id }); } if (SelectFiled.Contains("userid,")) { query.Select(p => new { p.UserID }); } if (SelectFiled.Contains("userguid,")) { query.Select(p => new { p.UserGuId }); } if (SelectFiled.Contains("commodityid,")) { query.Select(p => new { p.CommodityId }); } if (SelectFiled.Contains("backcontent,")) { query.Select(p => new { p.BackContent }); } if (SelectFiled.Contains("forntcontent,")) { query.Select(p => new { p.ForntContent }); } if (SelectFiled.Contains("backview,")) { query.Select(p => new { p.BackView }); } if (SelectFiled.Contains("forntview,")) { query.Select(p => new { p.ForntView }); } if (SelectFiled.Contains("lastlooktime,")) { query.Select(p => new { p.LastLookTime }); } if (SelectFiled.Contains("color,")) { query.Select(p => new { p.Color }); } if (SelectFiled.Contains("printingmethod,")) { query.Select(p => new { p.PrintingMethod }); } if (SelectFiled.Contains("attr,")) { query.Select(p => new { p.Attr }); } if (SelectFiled.Contains("amount,")) { query.Select(p => new { p.Amount }); } if (SelectFiled.Contains("orderid,")) { query.Select(p => new { p.OrderId }); } if (SelectFiled.Contains("ismobile,")) { query.Select(p => new { p.IsMobile }); } if (SelectFiled.Contains("name,")) { query.Select(p => new { p.Name }); } if (SelectFiled.Contains("image,")) { query.Select(p => new { p.Image }); } if (SelectFiled.Contains("commbackview,")) { query.Select(p => new { p.CommBackView }); } if (SelectFiled.Contains("commfrontview,")) { query.Select(p => new { p.CommFrontView }); } if (SelectFiled.Contains("materialid,")) { query.Select(p => new { p.MaterialId }); } if (SelectFiled.Contains("imagelist,")) { query.Select(p => new { p.ImageList }); } if (SelectFiled.Contains("salesinfolist,")) { query.Select(p => new { p.SalesInfoList }); } if (SelectFiled.Contains("productno,")) { query.Select(p => new { p.ProductNo }); } if (SelectFiled.Contains("printfuncinfo,")) { query.Select(p => new { p.PrintFuncInfo }); } } 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(Hisdesigninfo_View model = null, IDbConnection connection = null, IDbTransaction transaction = null) { var query = new LambdaQuery <Hisdesigninfo_View>(); if (model != null) { if (!model.Id.IsNullOrEmpty()) { query.Where(p => p.Id == model.Id); } if (!model.UserID.IsNullOrEmpty()) { query.Where(p => p.UserID == model.UserID); } if (!model.UserGuId.IsNullOrEmpty()) { query.Where(p => p.UserGuId == model.UserGuId); } if (!model.CommodityId.IsNullOrEmpty()) { query.Where(p => p.CommodityId == model.CommodityId); } if (!model.BackContent.IsNullOrEmpty()) { query.Where(p => p.BackContent == model.BackContent); } if (!model.ForntContent.IsNullOrEmpty()) { query.Where(p => p.ForntContent == model.ForntContent); } if (!model.BackView.IsNullOrEmpty()) { query.Where(p => p.BackView == model.BackView); } if (!model.ForntView.IsNullOrEmpty()) { query.Where(p => p.ForntView == model.ForntView); } if (!model.LastLookTime.IsNullOrEmpty()) { query.Where(p => p.LastLookTime == model.LastLookTime); } if (!model.Color.IsNullOrEmpty()) { query.Where(p => p.Color == model.Color); } if (!model.PrintingMethod.IsNullOrEmpty()) { query.Where(p => p.PrintingMethod == model.PrintingMethod); } if (!model.Attr.IsNullOrEmpty()) { query.Where(p => p.Attr == model.Attr); } if (!model.Amount.IsNullOrEmpty()) { query.Where(p => p.Amount == model.Amount); } if (!model.OrderId.IsNullOrEmpty()) { query.Where(p => p.OrderId == model.OrderId); } if (!model.IsMobile.IsNullOrEmpty()) { query.Where(p => p.IsMobile == model.IsMobile); } if (!model.Name.IsNullOrEmpty()) { query.Where(p => p.Name == model.Name); } if (!model.Image.IsNullOrEmpty()) { query.Where(p => p.Image == model.Image); } if (!model.CommBackView.IsNullOrEmpty()) { query.Where(p => p.CommBackView == model.CommBackView); } if (!model.CommFrontView.IsNullOrEmpty()) { query.Where(p => p.CommFrontView == model.CommFrontView); } if (!model.MaterialId.IsNullOrEmpty()) { query.Where(p => p.MaterialId == model.MaterialId); } if (!model.ImageList.IsNullOrEmpty()) { query.Where(p => p.ImageList == model.ImageList); } if (!model.SalesInfoList.IsNullOrEmpty()) { query.Where(p => p.SalesInfoList == model.SalesInfoList); } if (!model.ProductNo.IsNullOrEmpty()) { query.Where(p => p.ProductNo == model.ProductNo); } if (!model.PrintFuncInfo.IsNullOrEmpty()) { query.Where(p => p.PrintFuncInfo == model.PrintFuncInfo); } } return(query.GetQueryCount(connection, transaction)); }
/// <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 <Hisdesigninfo_View> SelectByPage(string Key, int start, int PageSize, bool desc, Hisdesigninfo_View model, string SelectFiled) { return(Hisdesigninfo_ViewOper.Instance.SelectByPage(Key, start, PageSize, desc, model)); }
/// <summary> /// 数据条数 /// </summary> /// <param name="model">模型</param> /// <returns>对象列表</returns> public int SelectCount(Hisdesigninfo_View model) { return(Hisdesigninfo_ViewOper.Instance.SelectCount(model)); }
/// <summary> /// 筛选全部数据 /// </summary> /// <param name="model">模型</param> /// <returns>对象列表</returns> public List <Hisdesigninfo_View> SelectByModel(Hisdesigninfo_View model) { return(Hisdesigninfo_ViewOper.Instance.SelectAll(model)); }