예제 #1
0
        //分页搜索
        public async Task <PagedResult <GisProDto> > SearchAsync(GisProFilters filters)
        {
            if (filters == null)
            {
                return(new PagedResult <GisProDto>(0, 0));
            }
            var dbset = _context.GisPros;
            var query = dbset.Where(item => !item.IsDeleted);

            if (filters.keywords.IsNotBlank())
            {
                query = query.Where(item => item.站点名称.Contains(filters.keywords));
            }
            return(await query.OrderByDescending(item => item.CreateDateTime)
                   .Select(item => new GisProDto
            {
                Id = item.Id,
                站点名称 = item.站点名称,
                分区名称 = item.分区名称,
                泵个数name = item.泵个数name,
                泵个数 = item.泵个数,
                状态信息name = item.状态信息name,
                状态信息 = item.状态信息,
                报警信息name = item.报警信息name,
                报警信息 = item.报警信息,
                坐标 = item.坐标,
                泵表编号 = item.泵表编号,
                备用1 = item.备用1,
                备用2 = item.备用2,
                备用3 = item.备用3,
                备用4 = item.备用4
            }).PagingAsync(filters.page, filters.rows));
        }
예제 #2
0
        public async Task <IActionResult> GetListWithPager(GisProFilters filters)
        {
            var result = await _gisProService.SearchAsync(filters);

            return(Json(result));
        }