left join student ta on ta.student_id = t.student_id
where 1=1
sum( t.student_score ) AS sum_student_score,
SUBSTRING_INDEX( GROUP_CONCAT( t.teacher_open_course_question_log_add_time ORDER BY t.teacher_open_course_question_log_add_time DESC ), ',', 1 ) AS add_time
FROM
teacher_open_course_question_log t
LEFT JOIN student ta ON ta.student_id = t.student_id
WHERE
1 = 1
AND t.teacher_open_course_question_log_status != 2
AND ta.student_sn IS NOT NULL
@if(!isEmpty(teacherOpenCourseQuestionLogId)){
and t.teacher_open_course_question_log_id =#teacherOpenCourseQuestionLogId#
@}
@ -400,12 +409,46 @@ studentScoreList
and tc.teacher_open_course_question_setting_status = 1
and tc.teacher_open_course_question_setting_push_status = 1
@}
group by
GROUP BY
t.student_id,
ta.student_sn,
ta.student_name,
t.teacher_open_course_question_setting_id
HAVING
sum( t.student_score ) IS NOT NULL
) a
WHERE
NOT EXISTS (
SELECT
1
FROM
(
SELECT
t.student_id,
ta.student_sn,
sum( t.student_score ) AS sum_student_score
FROM
teacher_open_course_question_log t
LEFT JOIN student ta ON ta.student_id = t.student_id
WHERE
1 = 1
AND t.teacher_open_course_question_log_status != 2