@@ -1228,7 +1256,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
tableName = queryParam["TableName"].ToString();
tableName = queryParam["TableName"].ToString();
}
}
var strSql = new StringBuilder();
var strSql = new StringBuilder();
strSql.Append($"select s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score ");
strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat ");
strSql.Append(" from ( ");
strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" where 1=1 and s.LessonSortNo='1' ");
strSql.Append(" where 1=1 and s.LessonSortNo='1' ");
if (!queryParam["AcademicYearNo"].IsEmpty())
if (!queryParam["AcademicYearNo"].IsEmpty())
{
{
@@ -1250,7 +1282,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
strSql.Append(" group by s.LessonNo,s.LessonName,s.StuNo,sb.StuName ");
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb ");
strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo ");
strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo ");
@@ -1802,7 +1837,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
tableName = queryParam["TableName"].ToString();
tableName = queryParam["TableName"].ToString();
}
}
var strSql = new StringBuilder();
var strSql = new StringBuilder();
strSql.Append($"select s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" ,case when bb.LessonSortNo='2' then bb.Score else (case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end) end as Score ");
strSql.Append(" ,case when bb.LessonSortNo='2' then convert(nvarchar(50),bb.Score) else (case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end) end as ScoreFormat ");
strSql.Append(" from ( ");
strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" where 1=1 and s.CheckMark='1' ");
strSql.Append(" where 1=1 and s.CheckMark='1' ");
if (!queryParam["AcademicYearNo"].IsEmpty())
if (!queryParam["AcademicYearNo"].IsEmpty())
{
{
@@ -1819,7 +1858,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
strSql.Append(" group by s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ");
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb ");
strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.LessonSortNo=sp.LessonSortNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo and sp.CheckMark = '1' ");
strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.LessonSortNo=spt.LessonSortNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo and spt.CheckMark = '1' ");