/// <summary> /// 问题查询 /// </summary> /// <param name="filter">id</param> /// <returns></returns> public static QueryResult <QusetionView> SearchQuestionPageLists(QusetionFilter filter) { var cmd = new DataCommand("MockTest.SearchQuestionPageList"); SetCondition(cmd, filter); return(cmd.Query <QusetionView>(filter, "d.NAME ,q.order_num ", null, true)); }
/// <summary> /// 设置条件 /// </summary> /// <param name="command"></param> /// <param name="filter"></param> private static void SetCondition(DataCommand command, QusetionFilter filter) { if (filter.mode.HasValue) { command.QuerySetCondition("q.mode", ConditionOperation.Equal, DbType.Int32, filter.mode.Value); } if (!string.IsNullOrEmpty(filter.document_name)) { command.QuerySetCondition("d.name", ConditionOperation.Like, DbType.String, filter.document_name); } if (!string.IsNullOrEmpty(filter.content)) { command.QuerySetCondition("q.content", ConditionOperation.Like, DbType.String, filter.content); } if (filter.usertag.HasValue) { command.QuerySetCondition("q.user_tag", ConditionOperation.Equal, DbType.Int32, filter.usertag); } command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString); }
public ActionResult QuestionQuery() { QusetionFilter filter = BuildQueryFilterEntity <QusetionFilter>(); return(AjaxGridJson(MockTestBasisService.SearchQuestionPageLists(filter))); }
/// <summary> /// 查询问题列表 /// </summary> /// <param name="filter"></param> /// <returns></returns> public QueryResult <QusetionView> SearchQuestionPageLists(QusetionFilter filter) { return(MockTestDA.SearchQuestionPageLists(filter)); }