You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 KiB

queryByCondition

  • 根据不为空的参数进行分页查询

    select @pageTag(){ t.* @} from general_question_log t where 1=1
    @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
    and #function("generalQuestionLog.query")# @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @}

queryByConditionQuery

  • 根据不为空的参数进行分页查询(无权限)

    select @pageTag(){ t.* @} from general_question_log t where 1=1
    @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @}

deleteGeneralQuestionLogByIds

  • 批量删除(假删除)

    update general_question_log set general_question_log_status = 2 where find_in_set(general_question_log_id,#ids#) and (general_question_log_status = 1 or general_question_log_status is null)

logicDeleteBySettingIds

  • 根据题目配置IDs批量删除假删除

    update general_question_log set general_question_log_status = 2 where find_in_set(general_question_setting_id,#settingIds#) and (general_question_log_status = 1 or general_question_log_status is null)

deleteBySettingIds

  • 根据题目配置IDs批量删除假删除

    delete from general_question_log where find_in_set(general_question_setting_id,#settingIds#)

deleteByIds

  • 批量删除(真删除)

    delete from general_question_log where find_in_set(general_question_log_id,#ids#)

getByIds

select * from general_question_log where find_in_set(general_question_log_id,#ids#)

updateGivenByIds

  • 批量更新指定字段,无论此字段是否有值

    update general_question_log set @if(contain("generalQuestionSettingId",_given)){ @if(isEmpty(generalQuestionSettingId)){ general_question_setting_id = null , @}else{ general_question_setting_id = #generalQuestionSettingId# , @} @} @if(contain("generalResourcesQuestionSnapshotId",_given)){ @if(isEmpty(generalResourcesQuestionSnapshotId)){ general_resources_question_snapshot_id = null , @}else{ general_resources_question_snapshot_id = #generalResourcesQuestionSnapshotId# , @} @} @if(contain("generalQuestionLogAnswer",_given)){ @if(isEmpty(generalQuestionLogAnswer)){ general_question_log_answer = null , @}else{ general_question_log_answer = #generalQuestionLogAnswer# , @} @} @if(contain("generalResourcesQuestionLogType",_given)){ @if(isEmpty(generalResourcesQuestionLogType)){ general_resources_question_log_type = null , @}else{ general_resources_question_log_type = #generalResourcesQuestionLogType# , @} @} @if(contain("generalQuestionLogUploadFile",_given)){ @if(isEmpty(generalQuestionLogUploadFile)){ general_question_log_upload_file = null , @}else{ general_question_log_upload_file = #generalQuestionLogUploadFile# , @} @} @if(contain("generalQuestionLogAddTime",_given)){ @if(isEmpty(generalQuestionLogAddTime)){ general_question_log_add_time = null , @}else{ general_question_log_add_time = #generalQuestionLogAddTime# , @} @} @if(contain("generalQuestionLogStatus",_given)){ @if(isEmpty(generalQuestionLogStatus)){ general_question_log_status = null , @}else{ general_question_log_status = #generalQuestionLogStatus# , @} @} @if(contain("studentId",_given)){ @if(isEmpty(studentId)){ student_id = null , @}else{ student_id = #studentId# , @} @} @if(contain("studentScore",_given)){ @if(isEmpty(studentScore)){ student_score = null , @}else{ student_score = #studentScore# , @} @} @if(contain("questionType",_given)){ @if(isEmpty(questionType)){ question_type = null , @}else{ question_type = #questionType# , @} @} @if(contain("questionScore",_given)){ @if(isEmpty(questionScore)){ question_score = null , @}else{ question_score = #questionScore# , @} @} @if(contain("questionStem",_given)){ @if(isEmpty(questionStem)){ question_stem = null , @}else{ question_stem = #questionStem# , @} @} @if(contain("questionOptionA",_given)){ @if(isEmpty(questionOptionA)){ question_option_a = null , @}else{ question_option_a = #questionOptionA# , @} @} @if(contain("questionOptionB",_given)){ @if(isEmpty(questionOptionB)){ question_option_b = null , @}else{ question_option_b = #questionOptionB# , @} @} @if(contain("questionOptionC",_given)){ @if(isEmpty(questionOptionC)){ question_option_c = null , @}else{ question_option_c = #questionOptionC# , @} @} @if(contain("questionOptionD",_given)){ @if(isEmpty(questionOptionD)){ question_option_d = null , @}else{ question_option_d = #questionOptionD# , @} @} @if(contain("questionOptionE",_given)){ @if(isEmpty(questionOptionE)){ question_option_e = null , @}else{ question_option_e = #questionOptionE# , @} @} @if(contain("questionAnswer",_given)){ @if(isEmpty(questionAnswer)){ question_answer = null , @}else{ question_answer = #questionAnswer# , @} @} @if(contain("questionAnalysis",_given)){ @if(isEmpty(questionAnalysis)){ question_analysis = null , @}else{ question_analysis = #questionAnalysis# , @} @} @if(contain("isTuck",_given)){ @if(isEmpty(isTuck)){ is_tuck = null , @}else{ is_tuck = #isTuck# , @} @} @if(contain("isErrorFavorite",_given)){ @if(isEmpty(isErrorFavorite)){ is_error_favorite = null , @}else{ is_error_favorite = #isErrorFavorite# , @} @} @if(contain("orgId",_given)){ @if(isEmpty(orgId)){ org_id = null , @}else{ org_id = #orgId# , @} @} @if(contain("userId",_given)){ @if(isEmpty(userId)){ user_id = null , @}else{ user_id = #userId# , @} @} general_question_log_id = general_question_log_id where find_in_set(general_question_log_id,#generalQuestionLogIdPlural#)

getGeneralQuestionLogValues

  • 根据不为空的参数进行查询

    select t.* from general_question_log t where 1=1
    @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else{ and t.general_question_log_status != 2 @} @if(!isEmpty(studentId)){ and t.student_id =#studentId# @} @if(!isEmpty(studentScore)){ and t.student_score =#studentScore# @} @if(!isEmpty(questionType)){ and t.question_type =#questionType# @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(userId)){ and t.user_id =#userId# @}

getValuesByQuery

  • 根据不为空的参数进行查询

    select t.* from general_question_log t where 1=1 and #function("generalQuestionLog.query")# @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @}

getValuesByQueryNotWithPermission

  • 根据不为空的参数进行查询(不包含权限)

    select t.* from general_question_log t where 1=1 @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @}

getExcelValues

  • 根据不为空的参数进行查询导入需要的参数

    SELECT * FROM ( ( select MAX(LENGTH(t.general_question_setting_id)) general_question_setting_id, MAX(LENGTH(t.general_resources_question_snapshot_id)) general_resources_question_snapshot_id, MAX(LENGTH(t.general_question_log_answer)) general_question_log_answer, MAX(LENGTH(t.general_question_log_upload_file)) general_question_log_upload_file, MAX(LENGTH(t.general_question_log_add_time)) general_question_log_add_time, MAX(LENGTH(t.general_question_log_status)) general_question_log_status, MAX(LENGTH(t.student_id)) student_id, MAX(LENGTH(t.student_score)) student_score, MAX(LENGTH(t.question_type)) question_type, MAX(LENGTH(t.question_score)) question_score, MAX(LENGTH(t.question_stem)) question_stem, MAX(LENGTH(t.question_option_a)) question_option_a, MAX(LENGTH(t.question_option_b)) question_option_b, MAX(LENGTH(t.question_option_c)) question_option_c, MAX(LENGTH(t.question_option_d)) question_option_d, MAX(LENGTH(t.question_option_e)) question_option_e, MAX(LENGTH(t.question_answer)) question_answer, MAX(LENGTH(t.question_analysis)) question_analysis, MAX(LENGTH(t.is_tuck)) is_tuck, MAX(LENGTH(t.is_error_favorite)) is_error_favorite, from general_question_log t where 1=1 and #function("generalQuestionLog.query")# @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @} ) UNION ALL ( select t.general_question_setting_id , t.general_resources_question_snapshot_id , t.general_question_log_answer , t.general_question_log_upload_file , t.general_question_log_add_time , t.general_question_log_status , t.student_id , t.student_score , t.question_type , t.question_score , t.question_stem , t.question_option_a , t.question_option_b , t.question_option_c , t.question_option_d , t.question_option_e , t.question_answer , t.question_analysis , t.is_tuck , t.is_error_favorite , from general_question_log t where 1=1 and #function("generalQuestionLog.query")#
    @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @if(!isEmpty(generalResourcesQuestionSnapshotId)){ and t.general_resources_question_snapshot_id =#generalResourcesQuestionSnapshotId# @} @if(!isEmpty(generalResourcesQuestionSnapshotIdPlural)){ and find_in_set(t.general_resources_question_snapshot_id,#generalResourcesQuestionSnapshotIdPlural#) @} @if(!isEmpty(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(questionAnalysis)){ and t.question_analysis =#questionAnalysis# @} @if(!isEmpty(isTuck)){ and t.is_tuck =#isTuck# @}

    @if(!isEmpty(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @} ) )t

studentScoreList

  • 根据不为空的参数进行分页查询(无权限) 查询得分总和 select @pageTag(){ tz.* @} from ( select t.student_id, ta.student_sn, ta.student_name, t.general_question_setting_id, sum(t.student_score) as sum_student_score from general_question_log t left join student ta on ta.student_id = t.student_id where 1=1
    @if(!isEmpty(generalQuestionLogId)){ and t.general_question_log_id =#generalQuestionLogId# @} @if(!isEmpty(generalQuestionLogIdPlural)){ and find_in_set(t.general_question_log_id,#generalQuestionLogIdPlural#) @} @if(!isEmpty(generalQuestionSettingId)){ and t.general_question_setting_id =#generalQuestionSettingId# @} @if(!isEmpty(generalResourcesQuestionLogType)){ and t.general_resources_question_log_type =#generalResourcesQuestionLogType# @} @if(!isEmpty(generalQuestionSettingIdPlural)){ and find_in_set(t.general_question_setting_id,#generalQuestionSettingIdPlural#) @} @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(generalQuestionLogAnswer)){ and t.general_question_log_answer =#generalQuestionLogAnswer# @} @if(!isEmpty(generalQuestionLogUploadFile)){ and t.general_question_log_upload_file =#generalQuestionLogUploadFile# @} @if(!isEmpty(generalQuestionLogAddTime)){ and t.general_question_log_add_time =#generalQuestionLogAddTime# @} @if(isEmpty(generalQuestionLogStatus) && isEmpty(generalQuestionLogStatusPlural)){ and t.general_question_log_status != 2 @}else{ @if(!isEmpty(generalQuestionLogStatus)){ and t.general_question_log_status =#generalQuestionLogStatus# @}else if(!isEmpty(generalQuestionLogStatusPlural)){ and find_in_set(t.general_question_log_status,#generalQuestionLogStatusPlural#) @} @} @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(generalQuestionLogUpdateTime)){ and t.general_question_log_update_time =#generalQuestionLogUpdateTime# @} @if(!isEmpty(generalQuestionLogFinishTime)){ and t.general_question_log_finish_time =#generalQuestionLogFinishTime# @} @if(!isEmpty(isErrorFavorite)){ and (t.is_error_favorite =#isErrorFavorite# or t.student_score != t.question_score) @} @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#) @} group by t.student_id, ta.student_sn, ta.student_name, t.general_question_setting_id )tz

getQuestionLogScoreDetailsInfo

  • 查询学生详细得分信息,查询分数详细信息

    select @pageTag() { tz.* @} from ( select t.student_id, ta.student_name, ta.student_sn, ta.class_id, tb.class_name, count(distinct(t.general_resources_question_snapshot_id)) as question_count, sum(case when t.general_question_log_update_time is not null then 1 else 0 end) as finish_count, sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) as success_count, sum(case when t.general_question_log_update_time is not null and t.question_score <> t.student_score then 1 else 0 end) as error_count, sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then 1 else 0 end) / IF(count(distinct(t.general_resources_question_snapshot_id)) = 0, 1, count(distinct(t.general_resources_question_snapshot_id))) * 100 as success_rate, sum(case when t.general_question_log_update_time is not null and t.question_score = t.student_score then t.question_score else ifnull(t.student_score, 0) end) as student_score, sum(case when t.general_question_log_update_time is not null then 1 else 0 end) / IF(count(distinct(t.general_resources_question_snapshot_id)) = 0, 1, count(distinct(t.general_resources_question_snapshot_id))) finish_progress from general_question_log t left join general_resources_question_snapshot tc on tc.general_resources_question_snapshot_id = t.general_resources_question_snapshot_id 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 where 1 = 1 and t.general_question_setting_id = #generalQuestionSettingId# @if(!isEmpty(courseInfoId)){ and tc.business_course_info_id = #courseInfoId# @} @if(!isEmpty(studentOrName)){ and (ta.student_name like #'%'+studentOrName+'%'# or ta.student_sn like #'%'+studentOrName+'%'#) @} @if(!isEmpty(classId)){ and ta.class_id =#classId# @} @if(!isEmpty(studentId)){ and ta.student_id =#studentId# @} GROUP BY t.student_id, ta.student_name, ta.student_sn, ta.class_id, tb.class_name ) tz

validateQuestionLogAddTimeLatest

  • 验证前端传递过来的添加时间是否是最新的

    select if(t.general_question_log_update_time is null, true, t.general_question_log_update_time < #addTime#) from general_question_log t where 1 = 1 and t.general_question_setting_id = #questionSettingId# and FIND_IN_SET(t.general_resources_question_snapshot_id, #questionSnapshotIds#) and t.student_id = #studentId# and t.general_question_log_status = 1 order by general_question_log_add_time desc limit 1

verifyLogAddTypeIsReSend

  • 如果查询题目日志,只要是交卷的状态 则返回重新发题的标记

    SELECT COUNT(1) > 0 FROM general_question_setting t INNER JOIN general_question_log ta ON ta.general_question_setting_id = t.general_question_setting_id AND t.general_question_setting_status = 1 AND t.general_question_setting_type = #questionSettingType# AND t.general_question_setting_id = #questionSettingId# AND ta.general_question_log_status = 1 AND ta.student_id = #studentId# AND ta.question_log_add_type = #questionLogAddType# LIMIT 1

getNotSubmitQuestionLogs

  • 查询未提交的试卷

    SELECT * FROM general_question_log t WHERE NOT EXISTS ( SELECT 1 FROM question_log_summary ta WHERE ta.person_id = #studentId# AND ta.question_setting_id = #questionSettingId# AND FIND_IN_SET( t.general_question_log_id, ta.question_log_ids ) ) AND t.student_id = #studentId# AND t.general_question_setting_id = #questionSettingId#

getNotSubmitQuestionLogsCount

  • 查询未提交试卷的题目数量

    SELECT count(1) FROM general_question_log t WHERE NOT EXISTS ( SELECT 1 FROM question_log_summary ta WHERE ta.person_id = #studentId# AND ta.question_setting_id = #questionSettingId# AND FIND_IN_SET( t.general_question_log_id, ta.question_log_ids ) ) AND t.student_id = #studentId# AND t.general_question_setting_id = #questionSettingId#