Ejemplo n.º 1
0
 /// <summary>
 /// 获得前几行数据
 /// </summary>
 public IList <Wuyiju.Model.Question> GetList(Wuyiju.Model.Question.Query query, int?limit = null)
 {
     using (var db = new DataContext())
     {
         var _dao = this.GetDao(db);
         return(_dao.GetList(query, limit));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public IList <Wuyiju.Model.Question> GetList(Wuyiju.Model.Question.Query filter)
        {
            StringBuilder sql = new StringBuilder(@"SELECT t.*,n.type_name FROM ec_question t INNER JOIN ec_question_type n on t.type_id = n.id");

            sql.AndEquals("type_id");
            sql.AndEquals("user_id");

            DynamicParameters param = new DynamicParameters();

            if (filter != null)
            {
                param.AddDynamicParams(filter);
            }
            return(db.GetList <Wuyiju.Model.Question>(sql, param));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public IList <Wuyiju.Model.Question> GetList(Wuyiju.Model.Question.Query filter, int?limit = null)
        {
            StringBuilder sql = new StringBuilder(@"select * from ec_question where 1 = 1 ");

            sql.AndEquals("type_id");
            sql.AndEquals("user_id");

            if (limit != null)
            {
                sql.Append(" limit  @rows ");
            }
            DynamicParameters param = new DynamicParameters();

            if (filter != null)
            {
                param.AddDynamicParams(filter);
            }
            if (limit != null)
            {
                param.Add("rows", limit);
            }
            return(db.GetList <Wuyiju.Model.Question>(sql, param));
        }