strSql.Append(" left join openlessonplan op on op.academicyearno=t.academicyearno and op.semester=t.semester and op.DeptNo=t.DeptNo and op.majorno =t.majorno ");
strSql.Append(" and op.grade =t.grade and op.lessonno =t.lessonno and op.F_SchoolId =t.F_SchoolId ");
var teachclassEntity = this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(ID);
return this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>($"select * from EmpInfo e where EmpNo in ({teachclassEntity.EmpNo}) ");
return this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>($"select * from EmpInfo e where EmpNo in ('{teachclassEntity.EmpNo.Replace(",", "','")}') ");
public void DoQzSetTeach(string keyValue, string EmpNo)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
foreach (var item in keyValue.Split(','))
{
var entityList = this.GetTeachClassEntity(item);
if (entityList != null && entityList.EmpNoMain != EmpNo)
{
//选课
var ssllstr = $"update StuSelectLessonList set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade = '{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' ";
db.ExecuteBySql(ssllstr);
//成绩
var ssstr = $"update StuScore set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade='{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' ";
db.ExecuteBySql(ssstr);
//教师成绩单
var ercstr = $"update EmpReportCard set EmpNo='{EmpNo}',EmpName=(select EmpName from EmpInfo where EmpNo='{EmpNo}') where AcademicYearNo='{entityList.AcademicYearNo}' and Semester='{entityList.Semester}' and LessonNo='{entityList.LessonNo}' and ClassNo='{entityList.TeachClassNo}' and EmpNo='{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and LessonSortNo='{entityList.LessonSortNo}' ";