StudentPunishDAL.cs 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 StudentPunishDAL
  12. {
  13. public StudentPunishRepository StudentPunishRepository { get; set; }
  14. public SchoolyearRepository SchoolyearRepository { get; set; }
  15. public StudentRepository StudentRepository { get; set; }
  16. public ClassmajorRepository ClassmajorRepository { get; set; }
  17. public GrademajorRepository GrademajorRepository { get; set; }
  18. public FacultymajorRepository FacultymajorRepository { get; set; }
  19. public CollegeRepository CollegeRepository { get; set; }
  20. public CampusRepository CampusRepository { get; set; }
  21. public UserRepository UserRepository { get; set; }
  22. /// <summary>
  23. /// 查询对应的学生处分信息StudentPunishView
  24. /// </summary>
  25. /// <param name="expStudentPunish"></param>
  26. /// <returns></returns>
  27. public IQueryable<StudentPunishView> GetStudentPunishViewQueryable(Expression<Func<EM_StudentPunish, bool>> expStudentPunish)
  28. {
  29. var query = from stuph in StudentPunishRepository.GetList(expStudentPunish)
  30. join sy in SchoolyearRepository.Entities
  31. on stuph.SchoolyearID equals sy.SchoolyearID
  32. join stu in StudentRepository.Entities
  33. on stuph.UserID equals stu.UserID
  34. join cl in ClassmajorRepository.Entities
  35. on stu.ClassmajorID equals cl.ClassmajorID
  36. join gr in GrademajorRepository.Entities
  37. on cl.GrademajorID equals gr.GrademajorID
  38. join fa in FacultymajorRepository.Entities
  39. on gr.FacultymajorID equals fa.FacultymajorID
  40. join col in CollegeRepository.Entities
  41. on fa.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 stu.UserID equals us.UserID
  46. select new StudentPunishView
  47. {
  48. StudentPunishID = stuph.StudentPunishID,
  49. SchoolyearID = stuph.SchoolyearID,
  50. SchoolyearValue = sy.Value,
  51. SchoolyearCode = sy.Code,
  52. UserID = stuph.UserID,
  53. StudentNo = us.LoginID,
  54. Name = us.Name,
  55. SexID = stu.SexID,
  56. BirthDate = stu.BirthDate,
  57. NationID = stu.NationID,
  58. PoliticsID = stu.PoliticsID,
  59. InSchoolStatusID = stu.InSchoolStatusID,
  60. StudentStatus = stu.StudentStatus,
  61. GradeID = gr.GradeID,
  62. StandardID = fa.StandardID,
  63. EducationID = fa.EducationID,
  64. LearningformID = fa.LearningformID,
  65. LearnSystem = fa.LearnSystem,
  66. ClassNum = cl.ClassNum,
  67. ClassmajorID = stu.ClassmajorID,
  68. ClassmajorNo = cl.No,
  69. ClassmajorName = cl.Name,
  70. GrademajorID = cl.GrademajorID,
  71. GrademajorCode = gr.Code,
  72. GrademajorName = gr.Name,
  73. FacultymajorID = gr.FacultymajorID,
  74. FacultymajorCode = fa.Code,
  75. FacultymajorName = fa.Name,
  76. CollegeID = fa.CollegeID,
  77. CollegeNo = col.No,
  78. CollegeName = col.Name,
  79. CampusID = col.CampusID,
  80. CampusCode = cam.No,
  81. CampusName = cam.Name,
  82. PunishTypeID = stuph.PunishTypeID,
  83. PunishLevelID = stuph.PunishLevelID,
  84. DocNo = stuph.DocNo,
  85. PunishDate = stuph.PunishDate,
  86. Reason = stuph.Reason,
  87. CancelDocNo = stuph.CancelDocNo,
  88. CancelDate = stuph.CancelDate,
  89. ApprovalStatus = stuph.ApprovalStatus,
  90. RecordStatus = stuph.RecordStatus,
  91. CreateUserID = stuph.CreateUserID,
  92. CreateTime = stuph.CreateTime,
  93. ModifyUserID = stuph.ModifyUserID,
  94. ModifyTime = stuph.ModifyTime
  95. };
  96. return query;
  97. }
  98. /// <summary>
  99. /// 查询对应的学生处分信息StudentPunishView
  100. /// </summary>
  101. /// <param name="expStudentPunish"></param>
  102. /// <param name="expStudent"></param>
  103. /// <returns></returns>
  104. public IQueryable<StudentPunishView> GetStudentPunishViewQueryable(Expression<Func<EM_StudentPunish, bool>> expStudentPunish, Expression<Func<CF_Student, bool>> expStudent)
  105. {
  106. var query = from stuph in StudentPunishRepository.GetList(expStudentPunish)
  107. join sy in SchoolyearRepository.Entities
  108. on stuph.SchoolyearID equals sy.SchoolyearID
  109. join stu in StudentRepository.GetList(expStudent)
  110. on stuph.UserID equals stu.UserID
  111. join cl in ClassmajorRepository.Entities
  112. on stu.ClassmajorID equals cl.ClassmajorID
  113. join gr in GrademajorRepository.Entities
  114. on cl.GrademajorID equals gr.GrademajorID
  115. join fa in FacultymajorRepository.Entities
  116. on gr.FacultymajorID equals fa.FacultymajorID
  117. join col in CollegeRepository.Entities
  118. on fa.CollegeID equals col.CollegeID
  119. join cam in CampusRepository.Entities
  120. on col.CampusID equals cam.CampusID
  121. join us in UserRepository.Entities
  122. on stu.UserID equals us.UserID
  123. select new StudentPunishView
  124. {
  125. StudentPunishID = stuph.StudentPunishID,
  126. SchoolyearID = stuph.SchoolyearID,
  127. SchoolyearValue = sy.Value,
  128. SchoolyearCode = sy.Code,
  129. UserID = stuph.UserID,
  130. StudentNo = us.LoginID,
  131. Name = us.Name,
  132. SexID = stu.SexID,
  133. BirthDate = stu.BirthDate,
  134. NationID = stu.NationID,
  135. PoliticsID = stu.PoliticsID,
  136. InSchoolStatusID = stu.InSchoolStatusID,
  137. StudentStatus = stu.StudentStatus,
  138. GradeID = gr.GradeID,
  139. StandardID = fa.StandardID,
  140. EducationID = fa.EducationID,
  141. LearningformID = fa.LearningformID,
  142. LearnSystem = fa.LearnSystem,
  143. ClassNum = cl.ClassNum,
  144. ClassmajorID = stu.ClassmajorID,
  145. ClassmajorNo = cl.No,
  146. ClassmajorName = cl.Name,
  147. GrademajorID = cl.GrademajorID,
  148. GrademajorCode = gr.Code,
  149. GrademajorName = gr.Name,
  150. FacultymajorID = gr.FacultymajorID,
  151. FacultymajorCode = fa.Code,
  152. FacultymajorName = fa.Name,
  153. CollegeID = fa.CollegeID,
  154. CollegeNo = col.No,
  155. CollegeName = col.Name,
  156. CampusID = col.CampusID,
  157. CampusCode = cam.No,
  158. CampusName = cam.Name,
  159. PunishTypeID = stuph.PunishTypeID,
  160. PunishLevelID = stuph.PunishLevelID,
  161. DocNo = stuph.DocNo,
  162. PunishDate = stuph.PunishDate,
  163. Reason = stuph.Reason,
  164. CancelDocNo = stuph.CancelDocNo,
  165. CancelDate = stuph.CancelDate,
  166. ApprovalStatus = stuph.ApprovalStatus,
  167. RecordStatus = stuph.RecordStatus,
  168. CreateUserID = stuph.CreateUserID,
  169. CreateTime = stuph.CreateTime,
  170. ModifyUserID = stuph.ModifyUserID,
  171. ModifyTime = stuph.ModifyTime
  172. };
  173. return query;
  174. }
  175. }
  176. }