/// <summary> /// 获取公司分页列表信息 /// </summary> /// <param name="dto">查询dto</param> /// <returns></returns> public async Task <ResponseResult> GetCompanyInfoPageResult(CompanyInfoSearchDto dto) { var result = new ResponseResult(0, "获取成功"); Expression <Func <CompanyInfo, bool> > filter = p => true; filter = filter.And(p => !p.IsDeleted); if (!string.IsNullOrEmpty(dto.CompanyName)) { filter = filter.And(p => p.CompanyName.Contains(dto.CompanyName)); } if (!string.IsNullOrEmpty(dto.Area)) { filter = filter.And(p => (int)p.Area == Convert.ToInt32(dto.Area)); } if (!string.IsNullOrEmpty(dto.Province.ToString())) { filter = filter.And(p => (int)p.Province == Convert.ToInt32(dto.Province)); } var pageResult = await this.comapnyInfoRepository.QueryPageAsync(filter, dto.OrderBy, dto.PageSize, dto.PageIndex); var list = pageResult.List.MapTo <List <CompanyInfoItem> >(); var data = new { pageResult.PageIndex, pageResult.PageSize, pageResult.RecordCount, pageResult.PageCount, List = list }; result.Data = data; return(result); }
public async Task <ResponseResult> GetCompanyInfoPageResult(CompanyInfoSearchDto dto) { return(await this.companyInfoServices.GetCompanyInfoPageResult(dto)); }