EvaluationStaffScoreDAL.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using EMIS.Entities;
  7. using EMIS.ViewModel.EvaluationManage.EvaluationResult;
  8. using EMIS.DataLogic.Repositories;
  9. namespace EMIS.DataLogic.EvaluationManage.EvaluationResult
  10. {
  11. public class EvaluationStaffScoreDAL
  12. {
  13. public EvaluationStaffScoreRepository EvaluationStaffScoreRepository { get; set; }
  14. public EvaluationStaffScoreDetailRepository EvaluationStaffScoreDetailRepository { get; set; }
  15. public EvaluationStudentScoreRepository EvaluationStudentScoreRepository { get; set; }
  16. public EvaluationCollegeScoreRepository EvaluationCollegeScoreRepository { get; set; }
  17. public SchoolyearRepository SchoolyearRepository { get; set; }
  18. public StaffRepository StaffRepository { get; set; }
  19. public CoursematerialRepository CoursematerialRepository { get; set; }
  20. public DepartmentRepository DepartmentRepository { get; set; }
  21. public CollegeRepository CollegeRepository { get; set; }
  22. public CampusRepository CampusRepository { get; set; }
  23. public UserRepository UserRepository { get; set; }
  24. /// <summary>
  25. /// 查询对应的教师评分信息EvaluationStaffScoreView
  26. /// </summary>
  27. /// <param name="exp"></param>
  28. /// <returns></returns>
  29. public IQueryable<EvaluationStaffScoreView> GetEvaluationStaffScoreViewQueryable(Expression<Func<EM_EvaluationStaffScore, bool>> exp)
  30. {
  31. var query = from evsfsco in EvaluationStaffScoreRepository.GetList(exp)
  32. join sy in SchoolyearRepository.Entities
  33. on evsfsco.SchoolyearID equals sy.SchoolyearID
  34. join sf in StaffRepository.Entities
  35. on evsfsco.UserID equals sf.UserID
  36. join cou in CoursematerialRepository.Entities
  37. on evsfsco.CoursematerialID equals cou.CoursematerialID
  38. join dep in DepartmentRepository.Entities
  39. on evsfsco.DepartmentID equals dep.DepartmentID
  40. join col in CollegeRepository.Entities
  41. on dep.CollegeID equals col.CollegeID
  42. join cam in CampusRepository.Entities
  43. on col.CampusID equals cam.CampusID
  44. join us in UserRepository.Entities
  45. on sf.UserID equals us.UserID
  46. from stusco in evsfsco.EM_EvaluationStaffScoreDetail.Where(x => x.EvaluationScoreTypeID == (int)EMIS.ViewModel.EM_EvaluationScoreType.StudentScore).DefaultIfEmpty()
  47. from colsco in evsfsco.EM_EvaluationStaffScoreDetail.Where(x => x.EvaluationScoreTypeID == (int)EMIS.ViewModel.EM_EvaluationScoreType.CollegeScore).DefaultIfEmpty()
  48. select new EvaluationStaffScoreView
  49. {
  50. EvaluationStaffScoreID = evsfsco.EvaluationStaffScoreID,
  51. SchoolyearID = evsfsco.SchoolyearID,
  52. SchoolyearValue = sy.Value,
  53. SchoolyearCode = sy.Code,
  54. UserID = evsfsco.UserID,
  55. StaffCode = us.LoginID,
  56. StaffName = us.Name,
  57. SexID = sf.SexID,
  58. TeacherTypeID = sf.TeacherTypeID,
  59. IncumbencyState = sf.IncumbencyState,
  60. TitleID = sf.TitleID,
  61. CoursematerialID = evsfsco.CoursematerialID,
  62. CourseCode = cou.CourseCode,
  63. CourseName = cou.CourseName,
  64. DepartmentID = evsfsco.DepartmentID,
  65. DepartmentNo = dep.No,
  66. DepartmentName = dep.Name,
  67. CollegeID = dep.CollegeID,
  68. CollegeNo = col.No,
  69. CollegeName = col.Name,
  70. CampusID = col.CampusID,
  71. CampusNo = cam.No,
  72. CampusName = cam.Name,
  73. StudentScore = stusco.Score,
  74. CollegeScore = colsco.Score,
  75. TotalScore = evsfsco.TotalScore,
  76. Remark = evsfsco.Remark,
  77. RecordStatus = evsfsco.RecordStatus,
  78. CreateUserID = evsfsco.CreateUserID,
  79. CreateTime = evsfsco.CreateTime,
  80. ModifyUserID = evsfsco.ModifyUserID,
  81. ModifyTime = evsfsco.ModifyTime
  82. };
  83. return query;
  84. }
  85. }
  86. }