123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage.EvaluationResult;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationResult
- {
- public class EvaluationStaffScoreDAL
- {
- public EvaluationStaffScoreRepository EvaluationStaffScoreRepository { get; set; }
- public EvaluationStaffScoreDetailRepository EvaluationStaffScoreDetailRepository { get; set; }
- public EvaluationStudentScoreRepository EvaluationStudentScoreRepository { get; set; }
- public EvaluationCollegeScoreRepository EvaluationCollegeScoreRepository { get; set; }
- public SchoolyearRepository SchoolyearRepository { get; set; }
- public StaffRepository StaffRepository { get; set; }
- public CoursematerialRepository CoursematerialRepository { get; set; }
- public DepartmentRepository DepartmentRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public CampusRepository CampusRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的教师评分信息EvaluationStaffScoreView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EvaluationStaffScoreView> GetEvaluationStaffScoreViewQueryable(Expression<Func<EM_EvaluationStaffScore, bool>> exp)
- {
- var query = from evsfsco in EvaluationStaffScoreRepository.GetList(exp)
- join sy in SchoolyearRepository.Entities
- on evsfsco.SchoolyearID equals sy.SchoolyearID
- join sf in StaffRepository.Entities
- on evsfsco.UserID equals sf.UserID
- join cou in CoursematerialRepository.Entities
- on evsfsco.CoursematerialID equals cou.CoursematerialID
- join dep in DepartmentRepository.Entities
- on evsfsco.DepartmentID equals dep.DepartmentID
- join col in CollegeRepository.Entities
- on dep.CollegeID equals col.CollegeID
- join cam in CampusRepository.Entities
- on col.CampusID equals cam.CampusID
- join us in UserRepository.Entities
- on sf.UserID equals us.UserID
- from stusco in evsfsco.EM_EvaluationStaffScoreDetail.Where(x => x.EvaluationScoreTypeID == (int)EMIS.ViewModel.EM_EvaluationScoreType.StudentScore).DefaultIfEmpty()
- from colsco in evsfsco.EM_EvaluationStaffScoreDetail.Where(x => x.EvaluationScoreTypeID == (int)EMIS.ViewModel.EM_EvaluationScoreType.CollegeScore).DefaultIfEmpty()
- select new EvaluationStaffScoreView
- {
- EvaluationStaffScoreID = evsfsco.EvaluationStaffScoreID,
- SchoolyearID = evsfsco.SchoolyearID,
- SchoolyearValue = sy.Value,
- SchoolyearCode = sy.Code,
- UserID = evsfsco.UserID,
- StaffCode = us.LoginID,
- StaffName = us.Name,
- SexID = sf.SexID,
- TeacherTypeID = sf.TeacherTypeID,
- IncumbencyState = sf.IncumbencyState,
- TitleID = sf.TitleID,
- CoursematerialID = evsfsco.CoursematerialID,
- CourseCode = cou.CourseCode,
- CourseName = cou.CourseName,
- DepartmentID = evsfsco.DepartmentID,
- DepartmentNo = dep.No,
- DepartmentName = dep.Name,
- CollegeID = dep.CollegeID,
- CollegeNo = col.No,
- CollegeName = col.Name,
- CampusID = col.CampusID,
- CampusNo = cam.No,
- CampusName = cam.Name,
- StudentScore = stusco.Score,
- CollegeScore = colsco.Score,
- TotalScore = evsfsco.TotalScore,
- Remark = evsfsco.Remark,
- RecordStatus = evsfsco.RecordStatus,
- CreateUserID = evsfsco.CreateUserID,
- CreateTime = evsfsco.CreateTime,
- ModifyUserID = evsfsco.ModifyUserID,
- ModifyTime = evsfsco.ModifyTime
- };
- return query;
- }
- }
- }
|