|
|
|
@ -782,22 +782,24 @@ getRandomMergeResourcesQuestionListByChapterTestQuestion
|
|
|
|
|
b.org_id
|
|
|
|
|
FROM
|
|
|
|
|
resources_question_snapshot a,
|
|
|
|
|
teacher_open_course_question_setting b
|
|
|
|
|
teacher_open_course_question_setting b,
|
|
|
|
|
teacher_open_course_merge_resources_question c
|
|
|
|
|
WHERE
|
|
|
|
|
1
|
|
|
|
|
AND a.teacher_open_course_question_setting_id = a.teacher_open_course_question_setting_id
|
|
|
|
|
AND question_status = 1
|
|
|
|
|
AND a.teacher_open_course_merge_resources_question_id = c.teacher_open_course_merge_resources_question_id
|
|
|
|
|
AND c.teacher_open_course_id = b.teacher_open_course_id
|
|
|
|
|
AND a.question_status = 1
|
|
|
|
|
AND c.question_status = 1
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseId)){
|
|
|
|
|
AND b.teacher_open_course_id = #teacherOpenCourseId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionSettingId)){
|
|
|
|
|
AND b.teacher_open_course_id
|
|
|
|
|
@// 保证至少会返回一个值,默认返回-1
|
|
|
|
|
= (select ifnull(max(teacher_open_course_id), '-1') from teacher_open_course_question_setting
|
|
|
|
|
in (select teacher_open_course_id from teacher_open_course_question_setting
|
|
|
|
|
where 1
|
|
|
|
|
and teacher_open_course_question_setting_id = #questionSettingId#
|
|
|
|
|
and teacher_open_course_question_setting_status = 1
|
|
|
|
|
limit 1)
|
|
|
|
|
and teacher_open_course_question_setting_status = 1 )
|
|
|
|
|
@}
|
|
|
|
|
@// 如果都为空,则不返回数据,比较保守些
|
|
|
|
|
@if(isEmpty(questionSettingId) && isEmpty(teacherOpenCourseId)){
|
|
|
|
@ -807,7 +809,6 @@ getRandomMergeResourcesQuestionListByChapterTestQuestion
|
|
|
|
|
AND b.teacher_open_course_question_setting_type = 'CHAPTER_EXERCISE'
|
|
|
|
|
) t
|
|
|
|
|
where 1=1
|
|
|
|
|
and t.question_status = 1
|
|
|
|
|
@// 题目ID优先级高
|
|
|
|
|
@if(!isEmpty(resourcesQuestionIdPlural)) {
|
|
|
|
|
and find_in_set(t.teacher_open_course_merge_resources_question_id, #resourcesQuestionIdPlural#)
|
|
|
|
|