/// <summary> /// 获取员工的分页信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public async Task <ResponseResult> GetStaffInfoPageResult(StaffInfoSearchDto dto) { var result = new ResponseResult(0, "获取成功"); Expression <Func <StaffInfo, bool> > filter = p => true; filter = filter.And(p => !p.IsDeleted); if (!string.IsNullOrEmpty(dto.Name)) { filter = filter.And(p => p.StaffName.Contains(dto.Name)); } var pageResult = await this.staffInfoRepository.QueryPageAsync(filter, p => p.Id, dto.PageSize, dto.PageIndex); var list = pageResult.List.MapTo <List <StaffInfoItem> >(); var data = new { pageResult.PageIndex, pageResult.PageSize, pageResult.RecordCount, pageResult.PageCount, List = list }; result.Data = data; return(result); }
public async Task <ResponseResult> GetStaffInfoPageResult(StaffInfoSearchDto dto) { var result = await this.staffInfoServices.GetStaffInfoPageResult(dto); return(result); }