From 82054483cc0330c18595a49dc55ae456265512ec Mon Sep 17 00:00:00 2001 From: Mlxa0324 Date: Sun, 27 Nov 2022 19:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E7=94=9F=E7=AD=94?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/resources/sql/jlw/generalQuestionLog.md | 10 ++++++++++ .../resources/sql/jlw/resourcesQuestionSnapshot.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/web/src/main/resources/sql/jlw/generalQuestionLog.md b/web/src/main/resources/sql/jlw/generalQuestionLog.md index 45042de3..5696a8c1 100644 --- a/web/src/main/resources/sql/jlw/generalQuestionLog.md +++ b/web/src/main/resources/sql/jlw/generalQuestionLog.md @@ -661,6 +661,16 @@ getValuesByQueryNotWithPermission * 根据不为空的参数进行查询(不包含权限) select t.* + @if(has(studentId) && !isEmpty(studentId)){ + ,(select b.general_question_log_answer + from general_question_log b + where 1 = 1 and b.student_id = #studentId# + and b.general_question_log_status = 1 + and b.general_question_setting_id = t.general_question_setting_id + and b.general_resources_question_snapshot_id = t.general_resources_question_snapshot_id + order by general_question_log_add_time desc limit 1 + ) as student_answer + @} from general_question_log t where 1=1 @if(!isEmpty(generalQuestionLogId)){ diff --git a/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md b/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md index 052770f1..24c9dc98 100644 --- a/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md +++ b/web/src/main/resources/sql/jlw/resourcesQuestionSnapshot.md @@ -482,6 +482,16 @@ getValuesByQueryNotWithPermission * 根据不为空的参数进行查询 select t.* + @if(has(studentId) && !isEmpty(studentId)){ + ,(select b.teacher_open_course_question_log_answer + from teacher_open_course_question_log b + where 1 = 1 and b.student_id = #studentId# + and b.teacher_open_course_question_log_status = 1 + and b.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id + and b.resources_question_snapshot_id = t.resources_question_snapshot_id + order by teacher_open_course_question_log_add_time desc limit 1 + ) as student_answer + @} from resources_question_snapshot t where 1=1 @if(!isEmpty(resourcesQuestionSnapshotId)){