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.
tianze-pro/web/src/main/resources/sql/jlw/teacherOpenCourseMergeResou...

20 KiB

queryByCondition

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

    select @pageTag(){ t.* @} from teacher_open_course_merge_resources_question t where 1=1
    @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
    and #function("teacherOpenCourseMergeResourcesQuestion.query")# @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @}

queryByConditionQuery

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

    select @pageTag(){ t.* @} from teacher_open_course_merge_resources_question t where 1=1
    @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @}

deleteTeacherOpenCourseMergeResourcesQuestionByIds

  • 批量删除

    delete from teacher_open_course_merge_resources_question where find_in_set(teacher_open_course_merge_resources_question_id,#ids#)

getByIds

select * from teacher_open_course_merge_resources_question where find_in_set(teacher_open_course_merge_resources_question_id,#ids#)

updateGivenByIds

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

    update teacher_open_course_merge_resources_question set @if(contain("teacherOpenCourseId",_given)){ @if(isEmpty(teacherOpenCourseId)){ teacher_open_course_id = null , @}else{ teacher_open_course_id = #teacherOpenCourseId# , @} @} @if(contain("teacherOpenCourseMergeCourseInfoId",_given)){ @if(isEmpty(teacherOpenCourseMergeCourseInfoId)){ course_info_id = null , @}else{ course_info_id = #teacherOpenCourseMergeCourseInfoId# , @} @} @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("questionStatus",_given)){ @if(isEmpty(questionStatus)){ question_status = null , @}else{ question_status = #questionStatus# , @} @} @if(contain("userId",_given)){ @if(isEmpty(userId)){ user_id = null , @}else{ user_id = #userId# , @} @} @if(contain("orgId",_given)){ @if(isEmpty(orgId)){ org_id = null , @}else{ org_id = #orgId# , @} @} teacher_open_course_merge_resources_question_id = teacher_open_course_merge_resources_question_id where find_in_set(teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#)

getTeacherOpenCourseMergeResourcesQuestionValues

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

    select t.* from teacher_open_course_merge_resources_question t where 1=1
    @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @}

getValuesByQuery

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

    select t.* from teacher_open_course_merge_resources_question t where 1=1 and #function("teacherOpenCourseMergeResourcesQuestion.query")# @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @}

getValuesByQueryNotWithPermission

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

    select t.* from teacher_open_course_merge_resources_question t where 1=1 @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @}

getExcelValues

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

    SELECT * FROM ( ( select MAX(LENGTH(t.teacher_open_course_id)) teacher_open_course_id, MAX(LENGTH(t.course_info_id)) course_info_id, 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.question_status)) question_status, from teacher_open_course_merge_resources_question t where 1=1 and #function("teacherOpenCourseMergeResourcesQuestion.query")# @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} ) UNION ALL ( select t.teacher_open_course_id , t.course_info_id , 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.question_status , from teacher_open_course_merge_resources_question t where 1=1 and #function("teacherOpenCourseMergeResourcesQuestion.query")#
    @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionId)){ and t.teacher_open_course_merge_resources_question_id =#teacherOpenCourseMergeResourcesQuestionId# @} @if(!isEmpty(teacherOpenCourseMergeResourcesQuestionIdPlural)){ and find_in_set(t.teacher_open_course_merge_resources_question_id,#teacherOpenCourseMergeResourcesQuestionIdPlural#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @} @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(questionStatus)){ and t.question_status =#questionStatus# @} @if(!isEmpty(questionStatusPlural)){ and find_in_set(t.question_status,#questionStatusPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} ) )t

getRandomMergeResourcesQuestionList

  • 根据题目设置随机出题

    select t.* from teacher_open_course_merge_resources_question t where 1=1 and t.question_status = 1 @if(!isEmpty(typeEnum)){ and find_in_set(t.question_type, #typeEnum#) @} @if(!isEmpty(selectCount)){ ORDER BY RAND() limit #selectCount# @}