From 8c01e46afd72789ddab7648ff7e9738f07586c7d Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 21 Feb 2023 09:26:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=8E=8C=E4=B8=8A?= =?UTF-8?q?=E8=AF=84=E6=95=99=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=80=89=E4=BF=AE=E8=AF=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EvaluationTeach/Eval_Main/Eval_MainService.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs index 91850316a..d7bb0b4e1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs @@ -70,17 +70,25 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach //取库名 var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database; var queryParam = queryJson.ToJObject(); + //必修 var strSql = new StringBuilder(); strSql.Append("select aa.*,bb.UID,cc.EmpName,dd.LessonName from (select a.LessonNo,a.EmpNo,a.AcademicYearNo,a.Semester,b.VID,a.StuNo from " + misdbname + ".dbo.StuSelectLessonList a "); strSql.Append("left join Eval_Main b on a.AcademicYearNo=b.AcademicYearNo and a.Semester=b.Semester where b.Status=1 and a.StuNo='" + queryParam["StuNo"] + "' and a.StuNo not in (select StuNo from " + misdbname + ".dbo.StuInfoBasic where ChangeStatus=1) ) aa "); strSql.Append("left join (select distinct b.EmpNo, b.LessonNo, b.UID from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID) bb on aa.EmpNo=bb.EmpNo and aa.LessonNo=bb.LessonNo and aa.StuNo=bb.UID "); strSql.Append("left join " + misdbname + ".dbo.EmpInfo cc on aa.EmpNo=cc.EmpNo left join " + misdbname + ".dbo.LessonInfo dd on aa.LessonNo = dd.LessonNo "); + //选修 + var strSql_Elective = new StringBuilder(); + strSql_Elective.Append("select aa.*,bb.UID,cc.EmpName,dd.LessonName+'(选)' as LessonName from (select a.LessonNo,a.EmpNo,a.AcademicYearNo,a.Semester,b.VID,a.StuNo from " + misdbname + ".dbo.StuSelectLessonListOfElective a "); + strSql_Elective.Append("left join Eval_Main b on a.AcademicYearNo=b.AcademicYearNo and a.Semester=b.Semester where b.Status=1 and a.StuNo='" + queryParam["StuNo"] + "' and a.StuNo not in (select StuNo from " + misdbname + ".dbo.StuInfoBasic where ChangeStatus=1) ) aa "); + strSql_Elective.Append("left join (select distinct b.EmpNo, b.LessonNo, b.UID from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID) bb on aa.EmpNo=bb.EmpNo and aa.LessonNo=bb.LessonNo and aa.StuNo=bb.UID "); + strSql_Elective.Append("left join " + misdbname + ".dbo.EmpInfo cc on aa.EmpNo=cc.EmpNo left join " + misdbname + ".dbo.LessonInfo dd on aa.LessonNo = dd.LessonNo "); + if (pagination != null) { - return this.BaseRepository().FindList(strSql.ToString(), pagination); + return this.BaseRepository().FindList(strSql.ToString(), pagination).Union(this.BaseRepository().FindList(strSql_Elective.ToString(), pagination)); } else - return BaseRepository().FindList(strSql.ToString()); + return BaseRepository().FindList(strSql.ToString()).Union(BaseRepository().FindList(strSql_Elective.ToString())); } catch (Exception ex) {