Beispiel #1
0
        /// <summary>
        /// 分页查询(目前只支持MSSQLServer)
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="selectColumn">需要查询的指定字段(多个之间用逗号隔开)</param>
        /// <param name="selectTable">需要查询的表</param>
        /// <param name="where">查询条件</param>
        /// <param name="order">排序</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">一页显示条目</param>
        /// <param name="cmdParms">条件值</param>
        /// <returns>分页查询结果</returns>
        protected IEnumerable <TModel> PageQuery <TModel>(string selectColumn, string selectTable, string where, string order, int pageIndex, int pageSize, object cmdParms = null)
        {
            SqlQuery query = SqlQueryUtil.BuilderQueryPageSqlQuery(selectColumn, selectTable, where, order, pageIndex, pageSize, dbType: ReaderDataType, cmdParms: cmdParms);

            return(GetDataAccess(isWrite: false).Query <TModel>(query));
        }