where+=$@" and e.{nameof(RB_Exam_Extend.CreateBy)} ={demodel.CreateBy}";
}
stringsql=$@"select e.*,es.StuNum,es.TScore FROM rb_exam e
stringsql=$@"select e.*,es.StuNum,es.TScore,es.FailNum FROM rb_exam e
LEFT JOIN (
SELECT e.ExamId,COUNT(0) as StuNum,SUM(e.TScore) as TScore FROM rb_exam_score e GROUP BY e.ExamId
SELECT e.ExamId,COUNT(0) as StuNum,SUM(e.TScore) as TScore,sum(case when e.StuId=0 then 1 else 0 end) as FailNum FROM rb_exam_score e GROUP BY e.ExamId