123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using EMIS.ViewModel.StudentManage.StudentProfile;
- namespace EMIS.DataLogic.StudentManage.StudentProfile
- {
- public class StudentEncourageDAL
- {
- public StudentEncourageRepository StudentEncourageRepository { get; set; }
- public SchoolyearRepository SchoolyearRepository { get; set; }
- public StudentRepository StudentRepository { get; set; }
- public ClassmajorRepository ClassmajorRepository { get; set; }
- public GrademajorRepository GrademajorRepository { get; set; }
- public FacultymajorRepository FacultymajorRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public CampusRepository CampusRepository { get; set; }
- public UserRepository UserRepository { get; set; }
-
- /// <summary>
- /// 查询对应的学生奖励信息StudentEncourageView
- /// </summary>
- /// <param name="expStudentEncourage"></param>
- /// <returns></returns>
- public IQueryable<StudentEncourageView> GetStudentEncourageViewQueryable(Expression<Func<EM_StudentEncourage, bool>> expStudentEncourage)
- {
- var query = from stuenc in StudentEncourageRepository.GetList(expStudentEncourage)
- join sy in SchoolyearRepository.Entities
- on stuenc.SchoolyearID equals sy.SchoolyearID
- join stu in StudentRepository.Entities
- on stuenc.UserID equals stu.UserID
- join cl in ClassmajorRepository.Entities
- on stu.ClassmajorID equals cl.ClassmajorID
- join gr in GrademajorRepository.Entities
- on cl.GrademajorID equals gr.GrademajorID
- join fa in FacultymajorRepository.Entities
- on gr.FacultymajorID equals fa.FacultymajorID
- join col in CollegeRepository.Entities
- on fa.CollegeID equals col.CollegeID
- join cam in CampusRepository.Entities
- on col.CampusID equals cam.CampusID
- join us in UserRepository.Entities
- on stu.UserID equals us.UserID
- select new StudentEncourageView
- {
- StudentEncourageID = stuenc.StudentEncourageID,
- SchoolyearID = stuenc.SchoolyearID,
- SchoolyearValue = sy.Value,
- SchoolyearCode = sy.Code,
- UserID = stuenc.UserID,
- StudentNo = us.LoginID,
- Name = us.Name,
- SexID = stu.SexID,
- BirthDate = stu.BirthDate,
- NationID = stu.NationID,
- PoliticsID = stu.PoliticsID,
- InSchoolStatusID = stu.InSchoolStatusID,
- StudentStatus = stu.StudentStatus,
- GradeID = gr.GradeID,
- StandardID = fa.StandardID,
- EducationID = fa.EducationID,
- LearningformID = fa.LearningformID,
- LearnSystem = fa.LearnSystem,
- ClassNum = cl.ClassNum,
- ClassmajorID = stu.ClassmajorID,
- ClassmajorNo = cl.No,
- ClassmajorName = cl.Name,
- GrademajorID = cl.GrademajorID,
- GrademajorCode = gr.Code,
- GrademajorName = gr.Name,
- FacultymajorID = gr.FacultymajorID,
- FacultymajorCode = fa.Code,
- FacultymajorName = fa.Name,
- CollegeID = fa.CollegeID,
- CollegeNo = col.No,
- CollegeName = col.Name,
- CampusID = col.CampusID,
- CampusCode = cam.No,
- CampusName = cam.Name,
- EncourageNameID = stuenc.EncourageNameID,
- EncourageTypeID = stuenc.EncourageTypeID,
- EncourageLevelID = stuenc.EncourageLevelID,
- DocNo = stuenc.DocNo,
- Unit = stuenc.Unit,
- EncourageDate = stuenc.EncourageDate,
- Amount = stuenc.Amount,
- Reason = stuenc.Reason,
- ApprovalStatus = stuenc.ApprovalStatus,
- RecordStatus = stuenc.RecordStatus,
- CreateUserID = stuenc.CreateUserID,
- CreateTime = stuenc.CreateTime,
- ModifyUserID = stuenc.ModifyUserID,
- ModifyTime = stuenc.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询对应的学生奖励信息StudentEncourageView
- /// </summary>
- /// <param name="expStudentEncourage"></param>
- /// <param name="expStudent"></param>
- /// <returns></returns>
- public IQueryable<StudentEncourageView> GetStudentEncourageViewQueryable(Expression<Func<EM_StudentEncourage, bool>> expStudentEncourage, Expression<Func<CF_Student, bool>> expStudent)
- {
- var query = from stuenc in StudentEncourageRepository.GetList(expStudentEncourage)
- join sy in SchoolyearRepository.Entities
- on stuenc.SchoolyearID equals sy.SchoolyearID
- join stu in StudentRepository.GetList(expStudent)
- on stuenc.UserID equals stu.UserID
- join cl in ClassmajorRepository.Entities
- on stu.ClassmajorID equals cl.ClassmajorID
- join gr in GrademajorRepository.Entities
- on cl.GrademajorID equals gr.GrademajorID
- join fa in FacultymajorRepository.Entities
- on gr.FacultymajorID equals fa.FacultymajorID
- join col in CollegeRepository.Entities
- on fa.CollegeID equals col.CollegeID
- join cam in CampusRepository.Entities
- on col.CampusID equals cam.CampusID
- join us in UserRepository.Entities
- on stu.UserID equals us.UserID
- select new StudentEncourageView
- {
- StudentEncourageID = stuenc.StudentEncourageID,
- SchoolyearID = stuenc.SchoolyearID,
- SchoolyearValue = sy.Value,
- SchoolyearCode = sy.Code,
- UserID = stuenc.UserID,
- StudentNo = us.LoginID,
- Name = us.Name,
- SexID = stu.SexID,
- BirthDate = stu.BirthDate,
- NationID = stu.NationID,
- PoliticsID = stu.PoliticsID,
- InSchoolStatusID = stu.InSchoolStatusID,
- StudentStatus = stu.StudentStatus,
- GradeID = gr.GradeID,
- StandardID = fa.StandardID,
- EducationID = fa.EducationID,
- LearningformID = fa.LearningformID,
- LearnSystem = fa.LearnSystem,
- ClassNum = cl.ClassNum,
- ClassmajorID = stu.ClassmajorID,
- ClassmajorNo = cl.No,
- ClassmajorName = cl.Name,
- GrademajorID = cl.GrademajorID,
- GrademajorCode = gr.Code,
- GrademajorName = gr.Name,
- FacultymajorID = gr.FacultymajorID,
- FacultymajorCode = fa.Code,
- FacultymajorName = fa.Name,
- CollegeID = fa.CollegeID,
- CollegeNo = col.No,
- CollegeName = col.Name,
- CampusID = col.CampusID,
- CampusCode = cam.No,
- CampusName = cam.Name,
- EncourageNameID = stuenc.EncourageNameID,
- EncourageTypeID = stuenc.EncourageTypeID,
- EncourageLevelID = stuenc.EncourageLevelID,
- DocNo = stuenc.DocNo,
- Unit = stuenc.Unit,
- EncourageDate = stuenc.EncourageDate,
- Amount = stuenc.Amount,
- Reason = stuenc.Reason,
- ApprovalStatus = stuenc.ApprovalStatus,
- RecordStatus = stuenc.RecordStatus,
- CreateUserID = stuenc.CreateUserID,
- CreateTime = stuenc.CreateTime,
- ModifyUserID = stuenc.ModifyUserID,
- ModifyTime = stuenc.ModifyTime
- };
- return query;
- }
- }
- }
|