StudentPostPracticeDAL.cs 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using EMIS.DataLogic.Repositories;
  7. using EMIS.Entities;
  8. using EMIS.ViewModel.StudentManage.StudentProfile;
  9. namespace EMIS.DataLogic.StudentManage.StudentProfile
  10. {
  11. public class StudentPostPracticeDAL
  12. {
  13. public StudentPostPracticeRepository StudentPostPracticeRepository { get; set; }
  14. public StudentRepository StudentRepository { get; set; }
  15. public ClassmajorRepository ClassmajorRepository { get; set; }
  16. public GrademajorRepository GrademajorRepository { get; set; }
  17. public FacultymajorRepository FacultymajorRepository { get; set; }
  18. public CollegeRepository CollegeRepository { get; set; }
  19. public CampusRepository CampusRepository { get; set; }
  20. public UserRepository UserRepository { get; set; }
  21. /// <summary>
  22. /// 查询对应的学生顶岗实习信息StudentPostPracticeView
  23. /// </summary>
  24. /// <param name="expStudentPostPractice"></param>
  25. /// <returns></returns>
  26. public IQueryable<StudentPostPracticeView> GetStudentPostPracticeViewQueryable(Expression<Func<CF_StudentPostPractice, bool>> expStudentPostPractice)
  27. {
  28. var query = from stuppra in StudentPostPracticeRepository.GetList(expStudentPostPractice)
  29. join stu in StudentRepository.Entities
  30. on stuppra.UserID equals stu.UserID
  31. join cl in ClassmajorRepository.Entities
  32. on stu.ClassmajorID equals cl.ClassmajorID
  33. join gr in GrademajorRepository.Entities
  34. on cl.GrademajorID equals gr.GrademajorID
  35. join fa in FacultymajorRepository.Entities
  36. on gr.FacultymajorID equals fa.FacultymajorID
  37. join col in CollegeRepository.Entities
  38. on fa.CollegeID equals col.CollegeID
  39. join cam in CampusRepository.Entities
  40. on col.CampusID equals cam.CampusID
  41. join us in UserRepository.Entities
  42. on stu.UserID equals us.UserID
  43. select new StudentPostPracticeView
  44. {
  45. StudentPostPracticeID = stuppra.StudentPostPracticeID,
  46. UserID = stuppra.UserID,
  47. StudentNo = us.LoginID,
  48. Name = us.Name,
  49. SexID = stu.SexID,
  50. BirthDate = stu.BirthDate,
  51. NationID = stu.NationID,
  52. PoliticsID = stu.PoliticsID,
  53. InSchoolStatusID = stu.InSchoolStatusID,
  54. StudentStatus = stu.StudentStatus,
  55. GradeID = gr.GradeID,
  56. StandardID = fa.StandardID,
  57. EducationID = fa.EducationID,
  58. LearningformID = fa.LearningformID,
  59. LearnSystem = fa.LearnSystem,
  60. ClassNum = cl.ClassNum,
  61. ClassmajorID = stu.ClassmajorID,
  62. ClassmajorNo = cl.No,
  63. ClassmajorName = cl.Name,
  64. GrademajorID = cl.GrademajorID,
  65. GrademajorCode = gr.Code,
  66. GrademajorName = gr.Name,
  67. FacultymajorID = gr.FacultymajorID,
  68. FacultymajorCode = fa.Code,
  69. FacultymajorName = fa.Name,
  70. CollegeID = fa.CollegeID,
  71. CollegeNo = col.No,
  72. CollegeName = col.Name,
  73. CampusID = col.CampusID,
  74. CampusCode = cam.No,
  75. CampusName = cam.Name,
  76. PracticePlace = stuppra.PracticePlace,
  77. StartYear = stuppra.StartYear,
  78. StartMonth = stuppra.StartMonth,
  79. EndYear = stuppra.EndYear,
  80. EndMonth = stuppra.EndMonth,
  81. PracticeMentor = stuppra.PracticeMentor,
  82. PracticeContent = stuppra.PracticeContent,
  83. SelfAppraise = stuppra.SelfAppraise,
  84. RecordStatus = stuppra.RecordStatus,
  85. CreateUserID = stuppra.CreateUserID,
  86. CreateTime = stuppra.CreateTime,
  87. ModifyUserID = stuppra.ModifyUserID,
  88. ModifyTime = stuppra.ModifyTime
  89. };
  90. return query;
  91. }
  92. /// <summary>
  93. /// 查询对应的学生顶岗实习信息StudentPostPracticeView
  94. /// </summary>
  95. /// <param name="expStudentPostPractice"></param>
  96. /// <param name="expStudent"></param>
  97. /// <returns></returns>
  98. public IQueryable<StudentPostPracticeView> GetStudentPostPracticeViewQueryable(Expression<Func<CF_StudentPostPractice, bool>> expStudentPostPractice, Expression<Func<CF_Student, bool>> expStudent)
  99. {
  100. var query = from stuppra in StudentPostPracticeRepository.GetList(expStudentPostPractice)
  101. join stu in StudentRepository.GetList(expStudent)
  102. on stuppra.UserID equals stu.UserID
  103. join cl in ClassmajorRepository.Entities
  104. on stu.ClassmajorID equals cl.ClassmajorID
  105. join gr in GrademajorRepository.Entities
  106. on cl.GrademajorID equals gr.GrademajorID
  107. join fa in FacultymajorRepository.Entities
  108. on gr.FacultymajorID equals fa.FacultymajorID
  109. join col in CollegeRepository.Entities
  110. on fa.CollegeID equals col.CollegeID
  111. join cam in CampusRepository.Entities
  112. on col.CampusID equals cam.CampusID
  113. join us in UserRepository.Entities
  114. on stu.UserID equals us.UserID
  115. select new StudentPostPracticeView
  116. {
  117. StudentPostPracticeID = stuppra.StudentPostPracticeID,
  118. UserID = stuppra.UserID,
  119. StudentNo = us.LoginID,
  120. Name = us.Name,
  121. SexID = stu.SexID,
  122. BirthDate = stu.BirthDate,
  123. NationID = stu.NationID,
  124. PoliticsID = stu.PoliticsID,
  125. InSchoolStatusID = stu.InSchoolStatusID,
  126. StudentStatus = stu.StudentStatus,
  127. GradeID = gr.GradeID,
  128. StandardID = fa.StandardID,
  129. EducationID = fa.EducationID,
  130. LearningformID = fa.LearningformID,
  131. LearnSystem = fa.LearnSystem,
  132. ClassNum = cl.ClassNum,
  133. ClassmajorID = stu.ClassmajorID,
  134. ClassmajorNo = cl.No,
  135. ClassmajorName = cl.Name,
  136. GrademajorID = cl.GrademajorID,
  137. GrademajorCode = gr.Code,
  138. GrademajorName = gr.Name,
  139. FacultymajorID = gr.FacultymajorID,
  140. FacultymajorCode = fa.Code,
  141. FacultymajorName = fa.Name,
  142. CollegeID = fa.CollegeID,
  143. CollegeNo = col.No,
  144. CollegeName = col.Name,
  145. CampusID = col.CampusID,
  146. CampusCode = cam.No,
  147. CampusName = cam.Name,
  148. PracticePlace = stuppra.PracticePlace,
  149. StartYear = stuppra.StartYear,
  150. StartMonth = stuppra.StartMonth,
  151. EndYear = stuppra.EndYear,
  152. EndMonth = stuppra.EndMonth,
  153. PracticeMentor = stuppra.PracticeMentor,
  154. PracticeContent = stuppra.PracticeContent,
  155. SelfAppraise = stuppra.SelfAppraise,
  156. RecordStatus = stuppra.RecordStatus,
  157. CreateUserID = stuppra.CreateUserID,
  158. CreateTime = stuppra.CreateTime,
  159. ModifyUserID = stuppra.ModifyUserID,
  160. ModifyTime = stuppra.ModifyTime
  161. };
  162. return query;
  163. }
  164. }
  165. }