private IFilter CreateFilter(CV_PM_ALT_LOGQueryParam qp) { ArgumentValidator.CheckForNullArgument(qp, "CV_PM_ALT_LOGQueryParam"); AndFilter af = new AndFilter(); MatchingFilter mf = new MatchingFilter(); if (!qp.IsDefaultValue("AlertAlias")) { mf.AddMatching("AlertAlias", qp.AlertAlias); } if (!qp.IsDefaultValue("LogTitle")) { mf.AddLike("LogTitle", qp.LogTitle); } if (!qp.IsDefaultValue("LogContent")) { mf.AddLike("LogContent", qp.LogContent); } if (!qp.IsDefaultValue("RespondedBy")) { mf.AddMatching("RespondedBy", qp.RespondedBy); } if (!qp.IsDefaultValue("IsClosed")) { mf.AddMatching("IsClosed", qp.IsClosed.Value); } if (!qp.IsDefaultValue("Z_RespondedOnBegin")) { mf.AddGreatEqualThan("RespondedOn", qp.Z_RespondedOnBegin.Value); } if (!qp.IsDefaultValue("Z_RespondedOnEnd")) { mf.AddLessEqualThan("RespondedOn", qp.Z_RespondedOnEnd.Value); } af.AddFilter(mf); return(af); }
// 获得当前同级部门 public IList <CV_PM_WECHAT_DEPARTMENT> GetSameLevelDepartment(int parentID) { long totalRecords = 0; IList <CV_PM_WECHAT_DEPARTMENT> entities = null; AndFilter af = new AndFilter(); MatchingFilter mf = new MatchingFilter(); mf.AddGreatEqualThan("ParentID", parentID); //if (Guid.Empty != DepartmentGuid) // mf.AddMatching("DepartmentGuid", DepartmentGuid); af.AddFilter(mf); Sort sort = new Sort(); sort.OrderBy("DepartmentGuid", Sort.Direction.ASC); entities = cV_PM_WECHAT_DEPARTMENTDAO.Find(0, -1, af, sort, out totalRecords); return(entities); }
private IFilter CreateFilter(CV_PM_ALT_EVENT_LOGQueryParam qp) { ArgumentValidator.CheckForNullArgument(qp, "CV_PM_ALT_EVENT_LOGQueryParam"); AndFilter af = new AndFilter(); MatchingFilter mf = new MatchingFilter(); if (!qp.IsDefaultValue("CreatedOn")) { mf.AddGreatEqualThan("CreatedOn", qp.CreatedOn.Value.Date); mf.AddLessThan("CreatedOn", qp.CreatedOn.Value.Date.AddDays(1)); } if (!qp.IsDefaultValue("EventTypeID")) { mf.AddMatching("EventTypeID", qp.EventTypeID); } if (!qp.IsDefaultValue("EventTypeName")) { mf.AddMatching("EventTypeName", qp.EventTypeName); } if (!qp.IsDefaultValue("IsFinished")) { mf.AddMatching("IsFinished", qp.IsFinished); } if (!qp.IsDefaultValue("CreatedBy")) { mf.AddMatching("CreatedBy", qp.CreatedBy); } // af.AddFilter(mf); // return(af); }