Example #1
0
        protected Task <PageListResp <RType> > SimpleSearch <RType>(SearchReq req)
        {
            var offCount = req.GetStartRow();
            var whereSql = BuildSimpleSearchWhereSql(req.filters, out var sqlParas);

            var totalSql  = string.Concat("select count(1) from ", BuildSimpleSearchTableName(req), whereSql);
            var selectSql = string.Concat("select ", BuildSimpleSearchSelectColumns(req), " from ", BuildSimpleSearchTableName(req), whereSql, defaultOrderSql, " limit ", req.size, " offset ", offCount);

            return(GetPageList <RType>(selectSql, sqlParas, totalSql));
        }
Example #2
0
        /// <summary>
        ///  获取列表信息
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <PageListResp <UploadFileMo> > GetPageList(SearchReq search)
        {
            var whereSql = BuildSimpleSearchWhereSql(search.filters, out var sqlParas);
            var offCount = search.GetStartRow();

            var selectSql = string.Concat("select * from ", TableName, whereSql, defaultOrderSql,
                                          " limit ", search.size, " offset ", offCount);
            var totalSql = string.Concat("select count(1) from ", TableName, whereSql);

            return(await GetPageList(selectSql, sqlParas, totalSql));
        }