/// <summary> /// 条件查询 /// </summary> /// <param name="byName"></param> /// <returns></returns> public List <Measure> GetMeasureList(string byName) { var measureRepository = new MeasureRepository(); Expression <Func <Measure, bool> > where = item => item.ID != -1; if (!string.IsNullOrEmpty(byName)) { where = where.And(item => item.MeasureNum.IndexOf(byName) != -1 || item.MeasureName.IndexOf(byName) != -1); } return(measureRepository.GetMeasureList(where)); }