/// <summary> /// 构建搜索条件 /// </summary> /// <param name="p"></param> /// <returns></returns> private string AppendWhere(object p) { string sqlWhere = " 1=1 "; if (p != null) { BinMatrnRecord obj = p as BinMatrnRecord; sqlWhere += string.IsNullOrEmpty(obj.Bin) ? "" : " AND bin ='" + obj.Bin + "'"; sqlWhere += string.IsNullOrEmpty(obj.week) ? "" : " AND week =" + obj.week; sqlWhere += string.IsNullOrEmpty(obj.StartTime) ? "" : " AND recordTime>=" + obj.StartTime; sqlWhere += string.IsNullOrEmpty(obj.EndTime) ? "" : " AND recordTime<=" + obj.EndTime; } return(sqlWhere); }
public void SearchWhere(BinMatrnRecord searchParameter) { binMatrnRecord = searchParameter; }