|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
|
|
queryByCondition
|
|
|
|
|
===
|
|
|
|
|
* 根据不为空的参数进行分页查询
|
|
|
|
@ -416,42 +417,7 @@ studentScoreList
|
|
|
|
|
@//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
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionSettingId)){
|
|
|
|
|
and t.teacher_open_course_question_setting_id =#teacherOpenCourseQuestionSettingId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionSettingIdPlural)){
|
|
|
|
|
and find_in_set(t.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
AND t.teacher_open_course_question_log_status = 2
|
|
|
|
|
AND ta.student_sn IS NOT NULL
|
|
|
|
|
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
|
|
|
|
|
) b
|
|
|
|
|
WHERE
|
|
|
|
|
a.student_id = b.student_id
|
|
|
|
|
AND a.student_sn = b.student_sn
|
|
|
|
|
AND a.sum_student_score < b.sum_student_score
|
|
|
|
|
)
|
|
|
|
|
WHERE 1=1
|
|
|
|
|
ORDER BY
|
|
|
|
|
add_time ASC
|
|
|
|
|
)tz
|
|
|
|
@ -1070,4 +1036,153 @@ getChapterExerciseParticipantsValuesNumber
|
|
|
|
|
@if(isNotEmpty(teacherOpenCourseQuestionSettingIdPlural)) {
|
|
|
|
|
AND FIND_IN_SET(a.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
GROUP BY a.student_id
|
|
|
|
|
GROUP BY a.student_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPageList
|
|
|
|
|
===
|
|
|
|
|
* 根据不为空的条件查询分页列表,条件成立的情况下,会联合question_log_summary表查出最新的做题记录
|
|
|
|
|
select
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*,
|
|
|
|
|
ta.student_name,
|
|
|
|
|
ta.student_sn,
|
|
|
|
|
tb.class_name
|
|
|
|
|
@}
|
|
|
|
|
from teacher_open_course_question_log t
|
|
|
|
|
left join student ta on ta.student_id = t.student_id and ta.student_status = 1
|
|
|
|
|
left join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1
|
|
|
|
|
@ // 如果关联类型不为空,则关联题目配置表
|
|
|
|
|
@if(!isEmpty(questionSettingType)){
|
|
|
|
|
inner join teacher_open_course_question_setting tc on tc.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id
|
|
|
|
|
@}
|
|
|
|
|
where 1=1
|
|
|
|
|
@if(!isEmpty(questionSettingType)) {
|
|
|
|
|
and find_in_set(t.teacher_open_course_question_log_id, (
|
|
|
|
|
select question_log_ids from question_log_summary qls where 1=1
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionSettingId)){
|
|
|
|
|
and qls.question_setting_id =#teacherOpenCourseQuestionSettingId#
|
|
|
|
|
@}
|
|
|
|
|
and qls.question_setting_type = #questionSettingType#
|
|
|
|
|
@if(!isEmpty(studentId)){
|
|
|
|
|
and qls.person_id =#studentId#
|
|
|
|
|
@}else{
|
|
|
|
|
and qls.person_id =t.student_id
|
|
|
|
|
@}
|
|
|
|
|
and qls.question_log_summary_status=1
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogId)){
|
|
|
|
|
and t.teacher_open_course_question_log_id =#teacherOpenCourseQuestionLogId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogIdPlural)){
|
|
|
|
|
and find_in_set(t.teacher_open_course_question_log_id,#teacherOpenCourseQuestionLogIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionSettingId)){
|
|
|
|
|
and t.teacher_open_course_question_setting_id =#teacherOpenCourseQuestionSettingId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionSettingIdPlural)){
|
|
|
|
|
and find_in_set(t.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesQuestionSnapshotId)){
|
|
|
|
|
and t.resources_question_snapshot_id =#resourcesQuestionSnapshotId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(resourcesQuestionSnapshotIdPlural)){
|
|
|
|
|
and find_in_set(t.resources_question_snapshot_id,#resourcesQuestionSnapshotIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogAnswer)){
|
|
|
|
|
and t.teacher_open_course_question_log_answer =#teacherOpenCourseQuestionLogAnswer#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogUploadFile)){
|
|
|
|
|
and t.teacher_open_course_question_log_upload_file =#teacherOpenCourseQuestionLogUploadFile#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogAddTime)){
|
|
|
|
|
and t.teacher_open_course_question_log_add_time =#teacherOpenCourseQuestionLogAddTime#
|
|
|
|
|
@}
|
|
|
|
|
@if(isEmpty(teacherOpenCourseQuestionLogStatus) && isEmpty(teacherOpenCourseQuestionLogStatusPlural)){
|
|
|
|
|
@// and t.teacher_open_course_question_log_status != 2
|
|
|
|
|
@}else{
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogStatus)){
|
|
|
|
|
and t.teacher_open_course_question_log_status =#teacherOpenCourseQuestionLogStatus#
|
|
|
|
|
@}else if(!isEmpty(teacherOpenCourseQuestionLogStatusPlural)){
|
|
|
|
|
and find_in_set(t.teacher_open_course_question_log_status,#teacherOpenCourseQuestionLogStatusPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(studentId)){
|
|
|
|
|
and t.student_id =#studentId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(studentIdPlural)){
|
|
|
|
|
and find_in_set(t.student_id,#studentIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(studentScore)){
|
|
|
|
|
and t.student_score =#studentScore#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionType)){
|
|
|
|
|
and t.question_type =#questionType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionTypePlural)){
|
|
|
|
|
and find_in_set(t.question_type,#questionTypePlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionScore)){
|
|
|
|
|
and t.question_score =#questionScore#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionStem)){
|
|
|
|
|
and t.question_stem =#questionStem#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionOptionA)){
|
|
|
|
|
and t.question_option_a =#questionOptionA#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionOptionB)){
|
|
|
|
|
and t.question_option_b =#questionOptionB#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionOptionC)){
|
|
|
|
|
and t.question_option_c =#questionOptionC#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionOptionD)){
|
|
|
|
|
and t.question_option_d =#questionOptionD#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionOptionE)){
|
|
|
|
|
and t.question_option_e =#questionOptionE#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionAnswer)){
|
|
|
|
|
and t.question_answer =#questionAnswer#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(isTuck)){
|
|
|
|
|
and t.is_tuck =#isTuck#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogUpdateTime)){
|
|
|
|
|
and t.teacher_open_course_question_log_update_time =#teacherOpenCourseQuestionLogUpdateTime#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teacherOpenCourseQuestionLogFinishTime)){
|
|
|
|
|
and t.teacher_open_course_question_log_finish_time =#teacherOpenCourseQuestionLogFinishTime#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(isErrorFavorite)){
|
|
|
|
|
and (t.is_error_favorite =#isErrorFavorite#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionLogAddType)){
|
|
|
|
|
and t.question_log_add_type = #questionLogAddType#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgIdPlural)){
|
|
|
|
|
and find_in_set(t.org_id,#orgIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userIdPlural)){
|
|
|
|
|
and find_in_set(t.user_id,#userIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(studentSnOrName)){
|
|
|
|
|
and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(schoolClassIdPlural)){
|
|
|
|
|
and find_in_set(ta.class_id, #schoolClassIdPlural#)
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(questionSettingType)){
|
|
|
|
|
and tc.teacher_open_course_question_setting_type = #questionSettingType#
|
|
|
|
|
and tc.teacher_open_course_question_setting_status = 1
|
|
|
|
|
and tc.teacher_open_course_question_setting_push_status = 1
|
|
|
|
|
@}
|