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 2568abda4..45fb1702b 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 @@ -113,12 +113,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); - strSql.Append(" FROM Exam_ExamStudent t "); - strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); - strSql.Append(" left join Exam_ExamPlan d on t.ImportDeptNo=d.ImportDeptNo "); - strSql.Append(" WHERE t.ESEnabled=1 "); + strSql.Append(@" SELECT zb.ClassNo,zb.AcademicYearNo,zb.Semester,zb.ESType,zb.ImportDeptNo, zb.StuNum,zb.ClassName + FROM (select t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,t.ImportDeptNo,c.ClassName from Exam_ExamStudent t + left join classinfo c on t.ClassNo=c.ClassNo + where 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -134,8 +132,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["ClassNo"].IsEmpty()) { - dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); - strSql.Append(" AND t.ClassNo = @ClassNo "); + dp.Add("ClassNo", "%" + queryParam["ClassNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassNo like @ClassNo "); } if (!queryParam["ClassName"].IsEmpty()) { @@ -188,7 +186,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' and t.ImportDeptNo='{examPlan.ImportDeptNo}' "); } } - strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); + strSql.Append(@" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,t.ImportDeptNo,c.ClassName + )zb + left join classinfo c on zb.ClassNo=c.ClassNo + left join Exam_ExamPlan d on zb.ImportDeptNo=d.ImportDeptNo + group by zb.ClassNo,zb.AcademicYearNo,zb.Semester,zb.ESType,zb.ImportDeptNo,zb.StuNum,zb.ClassName "); return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -429,7 +431,7 @@ from StuInfoBasic a where CheckMark = '1' and (ChangeStatus is null or len(Chang strSql.Append(@" a left join StuInfoBasic b on b.StuNo=a.StuNo where 1=1 and a.LessonSortNo='1' and a.Score>=0 and a.Score<60 "); 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) "+ sqldept2); + strSql.Append(" and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) " + sqldept2); strSql.Append($@" and a.stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' and ImportDeptNo='{ImportDeptNo}'