StudentConductDAL.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 StudentConductDAL
  12. {
  13. public StudentConductRepository StudentConductRepository { 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. /// 查询对应的学生操行信息StudentConductView
  23. /// </summary>
  24. /// <param name="expStudentConduct"></param>
  25. /// <returns></returns>
  26. public IQueryable<StudentConductView> GetStudentConductViewQueryable(Expression<Func<EM_StudentConduct, bool>> expStudentConduct)
  27. {
  28. var query = from stucot in StudentConductRepository.GetList(expStudentConduct)
  29. join stu in StudentRepository.Entities
  30. on stucot.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 StudentConductView
  44. {
  45. StudentConductID = stucot.StudentConductID,
  46. UserID = stucot.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. SchoolyearNumID = stucot.SchoolyearNumID,
  77. Comment = stucot.Comment,
  78. Remark = stucot.Remark,
  79. RecordStatus = stucot.RecordStatus,
  80. CreateUserID = stucot.CreateUserID,
  81. CreateTime = stucot.CreateTime,
  82. ModifyUserID = stucot.ModifyUserID,
  83. ModifyTime = stucot.ModifyTime
  84. };
  85. return query;
  86. }
  87. /// <summary>
  88. /// 查询对应的学生操行信息StudentConductView
  89. /// </summary>
  90. /// <param name="expStudentConduct"></param>
  91. /// <param name="expStudent"></param>
  92. /// <returns></returns>
  93. public IQueryable<StudentConductView> GetStudentConductViewQueryable(Expression<Func<EM_StudentConduct, bool>> expStudentConduct, Expression<Func<CF_Student, bool>> expStudent)
  94. {
  95. var query = from stucot in StudentConductRepository.GetList(expStudentConduct)
  96. join stu in StudentRepository.GetList(expStudent)
  97. on stucot.UserID equals stu.UserID
  98. join cl in ClassmajorRepository.Entities
  99. on stu.ClassmajorID equals cl.ClassmajorID
  100. join gr in GrademajorRepository.Entities
  101. on cl.GrademajorID equals gr.GrademajorID
  102. join fa in FacultymajorRepository.Entities
  103. on gr.FacultymajorID equals fa.FacultymajorID
  104. join col in CollegeRepository.Entities
  105. on fa.CollegeID equals col.CollegeID
  106. join cam in CampusRepository.Entities
  107. on col.CampusID equals cam.CampusID
  108. join us in UserRepository.Entities
  109. on stu.UserID equals us.UserID
  110. select new StudentConductView
  111. {
  112. StudentConductID = stucot.StudentConductID,
  113. UserID = stucot.UserID,
  114. StudentNo = us.LoginID,
  115. Name = us.Name,
  116. SexID = stu.SexID,
  117. BirthDate = stu.BirthDate,
  118. NationID = stu.NationID,
  119. PoliticsID = stu.PoliticsID,
  120. InSchoolStatusID = stu.InSchoolStatusID,
  121. StudentStatus = stu.StudentStatus,
  122. GradeID = gr.GradeID,
  123. StandardID = fa.StandardID,
  124. EducationID = fa.EducationID,
  125. LearningformID = fa.LearningformID,
  126. LearnSystem = fa.LearnSystem,
  127. ClassNum = cl.ClassNum,
  128. ClassmajorID = stu.ClassmajorID,
  129. ClassmajorNo = cl.No,
  130. ClassmajorName = cl.Name,
  131. GrademajorID = cl.GrademajorID,
  132. GrademajorCode = gr.Code,
  133. GrademajorName = gr.Name,
  134. FacultymajorID = gr.FacultymajorID,
  135. FacultymajorCode = fa.Code,
  136. FacultymajorName = fa.Name,
  137. CollegeID = fa.CollegeID,
  138. CollegeNo = col.No,
  139. CollegeName = col.Name,
  140. CampusID = col.CampusID,
  141. CampusCode = cam.No,
  142. CampusName = cam.Name,
  143. SchoolyearNumID = stucot.SchoolyearNumID,
  144. Comment = stucot.Comment,
  145. Remark = stucot.Remark,
  146. RecordStatus = stucot.RecordStatus,
  147. CreateUserID = stucot.CreateUserID,
  148. CreateTime = stucot.CreateTime,
  149. ModifyUserID = stucot.ModifyUserID,
  150. ModifyTime = stucot.ModifyTime
  151. };
  152. return query;
  153. }
  154. }
  155. }