/// <summary> /// 根据查询条件获取课程人员绑定表分页列表 /// </summary> public PagedResultDto <CourseBoundPersonnelListDto> GetPagedCourseBoundPersonnels(GetCourseBoundPersonnelInput input) { var query = _courseBoundPersonnelRepository.GetAll(); //TODO:根据传入的参数添加过滤条件 var courseBoundPersonnelCount = query.Count(); var courseBoundPersonnels = query .OrderByDescending(t => t.CreationTime) .PageBy(input) .ToList(); var courseBoundPersonnelListDtos = courseBoundPersonnels.MapTo <List <CourseBoundPersonnelListDto> >(); return(new PagedResultDto <CourseBoundPersonnelListDto>( courseBoundPersonnelCount, courseBoundPersonnelListDtos )); }
/// <summary> /// 根据查询条件获取课程人员绑定表分页列表 /// </summary> public PagedResultDto <CourseBoundPersonnelExportDto> GetPagedCourseBoundPersonnelsForExport(GetCourseBoundPersonnelInput input) { var query = from person in _courseBoundPersonnelRepository.GetAll() join user in _userAccountRepository.GetAll() on person.AccountSysNo equals user.SysNO join depart in _departmentInfoRepository.GetAll() on user.DepartmentID equals depart.DepartmentId join depart1 in _departmentInfoRepository.GetAll() on depart.DepartmentId equals depart1.DepartmentId join course in _courseInfoRepository.GetAll() on person.CourseId equals course.Id join exam in _examRecordRepository.GetAll() on person.AccountSysNo equals exam.UserId join post in _jobPostRepository.GetAll() on user.PostID equals post.Id where exam.ExamId == course.ExaminationId select new CourseBoundPersonnelExportDto() { Id = person.Id, CourseName = course.CourseName, TrainDocNo = "", UserName = user.DisplayName, DepartMentName1 = depart1.DisplayName, DepartMentName2 = depart.DisplayName, PostName = post.Name, Gender = "", StartTime = course.StartTime, EndTime = course.EndTime, CourseAmout = 0, TypeName = course.TypeName, TimeLength = course.TimeLength, ExamMethod = "考试", ExamResult = exam.Status == 0 ? "考试中" : exam.Status == 1 ? "通过" : exam.Status == 2 ? "未通过" : exam.Status == 3 ? "待批改" : "批改中", TotalTime = course.TimeLength, TotalAmount = 0, TrainSore = 0, TotalTrainSore = 0, memo = "" }; var courseInfoCount = query.Count(); var boundPersonnelExportDtos = query .PageBy(input) .OrderByDescending(t => t.UserName).OrderByDescending(t => t.CourseName) .ToList(); var courseBoundPersonnelExportDtos = boundPersonnelExportDtos.MapTo <List <CourseBoundPersonnelExportDto> >(); return(new PagedResultDto <CourseBoundPersonnelExportDto>( courseInfoCount, courseBoundPersonnelExportDtos)); }