CustomStandardSettingDAL.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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;
  8. using EMIS.ViewModel.EnrollManage.SpecialtyManage;
  9. using EMIS.DataLogic.Repositories;
  10. namespace EMIS.DataLogic.EnrollManage.SpecialtyManage
  11. {
  12. public class CustomStandardSettingDAL
  13. {
  14. public CustomStandardSettingRepository customStandardSettingRepository { get; set; }
  15. public CollegeRepository collegeRepository { get; set; }
  16. public SpecialtyRepository specialtyRepository { get; set; }
  17. public DictionaryItemRepository dictionaryItemRepository { get; set; }
  18. /// <summary>
  19. /// 查询对应的省招专业信息View
  20. /// </summary>
  21. /// <param name="exp"></param>
  22. /// <returns></returns>
  23. public IQueryable<CustomStandardSettingView> GetCustomStandardSettingViewQueryable(Expression<Func<CF_CustomStandardSetting, bool>> exp)
  24. {
  25. var query = from cus in customStandardSettingRepository.GetList(exp)
  26. join col in collegeRepository.Entities
  27. on cus.CollegeID equals col.CollegeID
  28. join sp in specialtyRepository.Entities
  29. on cus.SpecialtyID equals sp.SpecialtyID into tempsp
  30. from cussp in tempsp.DefaultIfEmpty()
  31. join stdic in dictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_Standard.ToString())
  32. on cussp.StandardID equals stdic.Value into tempstan
  33. from dtstan in tempstan.DefaultIfEmpty()
  34. select new CustomStandardSettingView
  35. {
  36. CustomStandardSettingID = cus.CustomStandardSettingID,
  37. Code = cus.Code,
  38. Name = dtstan.Name,
  39. YearID = cus.YearID,
  40. SemesterID = cus.SemesterID,
  41. CollegeID = cus.CollegeID,
  42. CollegeCode = col.No,
  43. CollegeName = col.Name,
  44. CampusID = col.CampusID,
  45. CampusCode = col.CF_Campus.No,
  46. CampusName = col.CF_Campus.Name,
  47. SpecialtyID = cus.SpecialtyID,
  48. StandardID = cussp.StandardID,
  49. StandardName = dtstan.Name,
  50. EducationID = cussp.EducationID,
  51. LearningformID = cussp.LearningformID,
  52. LearnSystem = cussp.LearnSystem,
  53. ScienceclassID = cussp.ScienceclassID,
  54. PropertyID = cussp.PropertyID,
  55. StandardTitle = cussp.StandardTitle,
  56. StandardLevel = cussp.StandardLevel,
  57. Remark = cus.Remark,
  58. RecordStatus = cus.RecordStatus,
  59. CreateUserID = cus.CreateUserID,
  60. CreateTime = cus.CreateTime,
  61. ModifyUserID = cus.ModifyUserID,
  62. ModifyTime = cus.ModifyTime
  63. };
  64. return query;
  65. }
  66. }
  67. }