SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t
left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.Grade='{lesson.Grade}'
and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.TeachMajorNo}'
and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.TeachMajorNo}' and (t.ClassNo is not null and len(t.ClassNo)>0)
and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}')
group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName ";
db.ExecuteBySql(addSql);
@@ -363,7 +363,8 @@ and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.TeachMajorNo}'
var addSql = $@"insert into Exam_ExamPlanClass
SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t
left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.ESType='{examPlan.PlanType}' and t.Grade='{lesson.Grade}'
and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}')
and (t.ClassNo is not null and len(t.ClassNo)>0)
and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}')
group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName ";