diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs index 260972259..d28bbd245 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs @@ -361,8 +361,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append( $@"insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade) - select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1,a.Grade from StuInfoBasic a where CheckMark = '1' and stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' union - select StuNo from StuInfoBasicChange where StuChangeType in ('04','05','06') and CheckStatus='1')"); + select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1,a.Grade +from StuInfoBasic a where CheckMark = '1' and (ChangeStatus is null or len(ChangeStatus)=0 or ChangeStatus='0') and stuno not in +(select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' + +)"); } else { @@ -380,8 +383,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) "); strSql.Append(" and a.AcademicYearNo ='" + AcademicYearNo + "' and a.Semester ='" + Semester + "' "); strSql.Append(" and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) "); - strSql.Append($@" and a.stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' union - select StuNo from StuInfoBasicChange where StuChangeType in ('04','05','06') and CheckStatus='1' ) "); + strSql.Append($@" and a.stuno not in +(select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' + +) "); strSql.Append(" group by a.stuno,a.stuname,a.classno,b.Grade"); } return this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString());