12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using EMIS.ViewModel.ScoreManage.LevelScoreManage;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- namespace EMIS.DataLogic.ScoreManage.LevelScoreManage
- {
- public class LevelSettingDAL
- {
- public LevelSettingRepository LevelSettingRepository { get; set; }
- public ExaminationSubjectRepository ExaminationSubjectRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的成绩等级信息LevelSettingView
- /// </summary>
- /// <param name="expLevelSetting"></param>
- /// <returns></returns>
- public IQueryable<LevelSettingView> GetLevelSettingViewQueryable(Expression<Func<ER_LevelSetting, bool>> expLevelSetting)
- {
- var query = from lvst in LevelSettingRepository.GetList(expLevelSetting)
- join exsub in ExaminationSubjectRepository.Entities
- on lvst.ExaminationSubjectID equals exsub.ExaminationSubjectID
- join usc in UserRepository.Entities
- on lvst.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on lvst.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new LevelSettingView
- {
- LevelSettingID = lvst.LevelSettingID,
- ExaminationSubjectID = lvst.ExaminationSubjectID,
- ExaminationSubjectName = exsub.Name,
- LevelNum = lvst.LevelNum ?? 0,
- LevelName = lvst.LevelName,
- MinScore = lvst.MinScore,
- MinScoreOperator = lvst.MinScoreOperator,
- MaxScore = lvst.MaxScore,
- MaxScoreOperator = lvst.MaxScoreOperator,
- TotalScoreRange = lvst.MinScore.ToString() + lvst.MinScoreOperator
- + "总成绩" + lvst.MaxScoreOperator + lvst.MaxScore.ToString(),
- Remark = lvst.Remark,
- RecordStatus = lvst.RecordStatus,
- CreateUserID = lvst.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = lvst.CreateTime,
- ModifyUserID = lvst.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = lvst.ModifyTime
- };
- return query;
- }
- }
- }
|