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/teacherOpenCourseQuestionSe...

39 KiB

queryByCondition

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

    select @pageTag(){ t.* @} from teacher_open_course_question_setting t where 1=1
    @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
    and #function("teacherOpenCourseQuestionSetting.query")# @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(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds# @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(isEmpty(teacherOpenCourseQuestionSettingStatus) && isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and t.teacher_open_course_question_setting_status != 2 @}else{ @if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){ and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus# @}else if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#) @} @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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#) @} @pageIgnoreTag() { ORDER BY CONVERT(regexp_replace ( t.teacher_open_course_question_setting_name, '[^0-9]+', '' ),unsigned) asc @}

queryByConditionQuery

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

    select @pageTag(){ t.* @} from teacher_open_course_question_setting t 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#) @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @// 如果数据是ALL则代表全部班级都可以看到 @if(!isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ and IF ( t.teacher_open_course_question_setting_school_class_ids = 'ALL', TRUE, t.teacher_open_course_question_setting_school_class_ids REGEXP #strUtil.join('|', teacherOpenCourseQuestionSettingSchoolClassIds)#) @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(isEmpty(teacherOpenCourseQuestionSettingStatus) && isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and t.teacher_open_course_question_setting_status != 2 @}else{ @if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){ and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus# @}else if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#) @} @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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#) @} @pageIgnoreTag() { order by t.teacher_open_course_question_setting_id asc @}

logicDeleteBySettingIds

  • 批量删除(假删除)

    update teacher_open_course_question_setting set teacher_open_course_question_setting_status = 2 where find_in_set(teacher_open_course_question_setting_id,#ids#)

deleteByIds

  • 批量删除(真删除)

    delete from teacher_open_course_question_setting where find_in_set(teacher_open_course_question_setting_id,#ids#)

getByIds

select * from teacher_open_course_question_setting where find_in_set(teacher_open_course_question_setting_id,#ids#)

updateGivenByIds

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

    update teacher_open_course_question_setting set @if(contain("teacherOpenCourseId",_given)){ @if(isEmpty(teacherOpenCourseId)){ teacher_open_course_id = null , @}else{ teacher_open_course_id = #teacherOpenCourseId# , @} @} @if(contain("teacherOpenCourseQuestionSettingSchoolClassIds",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ teacher_open_course_question_setting_school_class_ids = null , @}else{ teacher_open_course_question_setting_school_class_ids = #teacherOpenCourseQuestionSettingSchoolClassIds# , @} @} @if(contain("teacherOpenCourseQuestionSettingDoCount",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingDoCount)){ teacher_open_course_question_setting_do_count = null , @}else{ teacher_open_course_question_setting_do_count = #teacherOpenCourseQuestionSettingDoCount# , @} @} @if(contain("teacherOpenCourseQuestionSettingQuestionNoOrder",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ teacher_open_course_question_setting_question_no_order = null , @}else{ teacher_open_course_question_setting_question_no_order = #teacherOpenCourseQuestionSettingQuestionNoOrder# , @} @} @if(contain("teacherOpenCourseQuestionSettingOptionNoOrder",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ teacher_open_course_question_setting_option_no_order = null , @}else{ teacher_open_course_question_setting_option_no_order = #teacherOpenCourseQuestionSettingOptionNoOrder# , @} @} @if(contain("teacherOpenCourseQuestionSettingEndShowQa",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ teacher_open_course_question_setting_end_show_qa = null , @}else{ teacher_open_course_question_setting_end_show_qa = #teacherOpenCourseQuestionSettingEndShowQa# , @} @} @if(contain("teacherOpenCourseQuestionSettingEndShowTrueFalse",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ teacher_open_course_question_setting_end_show_true_false = null , @}else{ teacher_open_course_question_setting_end_show_true_false = #teacherOpenCourseQuestionSettingEndShowTrueFalse# , @} @} @if(contain("teacherOpenCourseQuestionSettingName",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingName)){ teacher_open_course_question_setting_name = null , @}else{ teacher_open_course_question_setting_name = #teacherOpenCourseQuestionSettingName# , @} @} @if(contain("teacherOpenCourseQuestionStartTime",_given)){ @if(isEmpty(teacherOpenCourseQuestionStartTime)){ teacher_open_course_question_start_time = null , @}else{ teacher_open_course_question_start_time = #teacherOpenCourseQuestionStartTime# , @} @} @if(contain("teacherOpenCourseQuestionEndTime",_given)){ @if(isEmpty(teacherOpenCourseQuestionEndTime)){ teacher_open_course_question_end_time = null , @}else{ teacher_open_course_question_end_time = #teacherOpenCourseQuestionEndTime# , @} @} @if(contain("teacherOpenCourseQuestionSettingType",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingType)){ teacher_open_course_question_setting_type = null , @}else{ teacher_open_course_question_setting_type = #teacherOpenCourseQuestionSettingType# , @} @} @if(contain("teacherOpenCourseQuestionSettingFile",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingFile)){ teacher_open_course_question_setting_file = null , @}else{ teacher_open_course_question_setting_file = #teacherOpenCourseQuestionSettingFile# , @} @} @if(contain("teacherOpenCourseQuestionSettingPushStatus",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ teacher_open_course_question_setting_push_status = null , @}else{ teacher_open_course_question_setting_push_status = #teacherOpenCourseQuestionSettingPushStatus# , @} @} @if(contain("teacherOpenCourseQuestionSettingStatus",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingStatus)){ teacher_open_course_question_setting_status = null , @}else{ teacher_open_course_question_setting_status = #teacherOpenCourseQuestionSettingStatus# , @} @} @if(contain("teacherOpenCourseQuestionSettingAddTime",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingAddTime)){ teacher_open_course_question_setting_add_time = null , @}else{ teacher_open_course_question_setting_add_time = #teacherOpenCourseQuestionSettingAddTime# , @} @} @if(contain("teacherOpenCourseQuestionSettingRequire",_given)){ @if(isEmpty(teacherOpenCourseQuestionSettingRequire)){ teacher_open_course_question_setting_require = null , @}else{ teacher_open_course_question_setting_require = #teacherOpenCourseQuestionSettingRequire# , @} @} @if(contain("teacherOpenCourseMergeCourseInfoId",_given)){ @if(isEmpty(teacherOpenCourseMergeCourseInfoId)){ teacher_open_course_merge_course_info_id = null , @}else{ teacher_open_course_merge_course_info_id = #teacherOpenCourseMergeCourseInfoId# , @} @} @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# , @} @} teacher_open_course_question_setting_id = teacher_open_course_question_setting_id where find_in_set(teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#)

getTeacherOpenCourseQuestionSettingValues

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

    select t.* from teacher_open_course_question_setting t where 1=1
    @if(!isEmpty(teacherOpenCourseQuestionSettingId)){ and t.teacher_open_course_question_setting_id =#teacherOpenCourseQuestionSettingId# @} @if(!isEmpty(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds# @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){ and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus# @}else{ and t.teacher_open_course_question_setting_status != 2 @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){ and find_in_set(t.teacher_open_course_merge_course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#) @}

getValuesByQuery

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

    select t.* from teacher_open_course_question_setting t where 1=1 and #function("teacherOpenCourseQuestionSetting.query")# @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(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds# @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(isEmpty(teacherOpenCourseQuestionSettingStatus) && isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and t.teacher_open_course_question_setting_status != 2 @}else{ @if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){ and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus# @}else if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#) @} @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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 teacher_open_course_question_setting t 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#) @} @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(teacherOpenCourseQuestionSettingSchoolClassIds)){ and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds# @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#) @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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(startTime) && !isEmpty(endTime)){ and t.teacher_open_course_question_setting_add_time between #startTime# AND #endTime# @}

getValuesByQueryNotWithPermission2

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

    #use("getValuesByQueryNotWithPermission")#

analysisOld

  • 题目配置,统计分析接口

    SELECT ifnull( count( DISTINCT ( ta.teacher_open_course_question_log_id ) ), 0 ) AS question_total_count, ifnull( count( DISTINCT ( t.teacher_open_course_question_setting_id )), 0 ) AS total_setting_count, round( avg( SUM( CASE WHEN ta.student_score > 0 THEN 1 ELSE 0 END ) ), 2 ) AS avg_correct_count, round( avg( SUM( CASE WHEN ta.student_score <= 0 THEN 1 ELSE 0 END ) ), 2 ) AS avg_wrong_count, round( SUM( ifnull( ta.student_score, 0 )) / count( distinct( ta.student_id ) ) , 2 ) AS avg_student_score, SUM( (SUM( t.student_score over()) ) > (SUM( t.question_score ) * ifnull(td.pass_rate, 0.6) ) ) / SUM( distinct( t.student_id ) ) * 100 AS pass_rate count( DISTINCT ( tc.school_class_id )) total_school_class_count FROM teacher_open_course_question_setting t LEFT JOIN teacher_open_course_question_log ta ON ta.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id AND ta.teacher_open_course_question_log_status = 1 LEFT JOIN resources_question_snapshot tb ON tb.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id AND tb.question_status = 1 LEFT JOIN teacher_open_course_merge_school_class tc ON tc.teacher_open_course_id = t.teacher_open_course_id AND tc.teacher_open_course_merge_school_class_status = 1 LEFT JOIN (select value as pass_rate from core_dict where type = 'pass_rate' order by create_time desc limit 1) td on 1 = 1 WHERE 1 = 1 AND t.teacher_open_course_question_setting_push_status = 1 AND t.teacher_open_course_question_setting_status = 1 AND t.teacher_open_course_id = #teacherOpenCourseId# AND t.teacher_open_course_question_setting_type = #questionSettingType#

analysis

  • 题目配置,统计分析接口。用于分析所有题目类型的平均值

    select
    t.question_log_summary_from_type,
    sum(t.question_setting_id) as total_setting_count, avg(question_setting_total_score) as avg_question_setting_total_score,
    avg(question_log_summary_student_total_score) as avg_student_score,
    avg(question_log_summary_question_total_count) as question_total_count,
    avg(question_log_summary_student_do_count) as avg_question_log_summary_student_do_count,
    avg(question_log_summary_success_count) as avg_correct_count,
    avg(question_log_summary_error_count) as avg_wrong_count,
    avg(question_log_summary_success_rate) as avg_question_log_summary_success_rate,
    avg(question_log_summary_is_pass) as avg_question_log_summary_is_pass,
    avg(finish_second_time) as avg_finish_second_time
    from question_log_summary t left join teacher_open_course_question_setting ta on ta.teacher_open_course_question_setting_id = t.question_setting_id where 1 = 1 and t.question_setting_type = #questionSettingType#
    and ta.teacher_open_course_question_setting_type = #questionSettingType#
    and t.question_log_summary_status = 1
    and ta.teacher_open_course_id = #teacherOpenCourseId# @if(!isEmpty(questionSettingId)){ and t.question_setting_id = #questionSettingId# @} and ta.teacher_open_course_question_setting_status = 1 AND ta.teacher_open_course_question_setting_push_status = 1 group by
    question_log_summary_from_type

documentArchiveChapter

  • 文档存档章节,统计分析接口。用于分析所有题目类型的平均值 SELECT ljq.question_log_summary_from_type, SUM(ljq.question_log_summary_question_total_count) AS question_total_count, ROUND(AVG(ljq.question_log_summary_success_count),2) AS avg_correct_count, ROUND(AVG(ljq.question_log_summary_error_count),2) AS avg_wrong_count, ROUND(AVG(ljq.question_log_summary_student_total_score),2) AS avg_student_score, ROUND(AVG(ljq.question_log_summary_student_do_count),2) AS avg_question_log_summary_student_do_count, ROUND(AVG(ljq.question_log_summary_success_rate),2) AS avg_question_log_summary_success_rate, ROUND(AVG(ljq.question_log_summary_is_pass),2) AS avg_question_log_summary_is_pass, ROUND(AVG(ljq.finish_second_time),2) AS avg_finish_second_time, SUM(ljq.question_setting_total_score) AS avg_question_setting_total_score FROM teacher_open_course_question_setting t LEFT JOIN ( SELECT q.question_setting_id, any_value(q.question_log_summary_from_type) AS question_log_summary_from_type, any_value(q.question_log_summary_question_total_count) AS question_log_summary_question_total_count, any_value(q.question_setting_total_score) AS question_setting_total_score, AVG(q.question_log_summary_success_count) AS question_log_summary_success_count, AVG(q.question_log_summary_error_count) AS question_log_summary_error_count, AVG(q.question_log_summary_student_total_score) AS question_log_summary_student_total_score, AVG(q.question_log_summary_student_do_count) AS question_log_summary_student_do_count, AVG(q.question_log_summary_success_rate) AS question_log_summary_success_rate, AVG(q.question_log_summary_is_pass) AS question_log_summary_is_pass, AVG(q.finish_second_time) AS finish_second_time FROM question_log_summary q GROUP BY q.question_setting_id ) ljq ON ljq.question_setting_id = t.teacher_open_course_question_setting_id WHERE t.teacher_open_course_question_setting_push_status = 1 AND t.teacher_open_course_question_setting_status = 1 AND t.teacher_open_course_id = #teacherOpenCourseId# AND t.teacher_open_course_question_setting_type = #questionSettingType# GROUP BY ljq.question_log_summary_from_type

getQuestionSettingScoreInfo

  • 查询题目配置页,的分数和用时情况

    select max(TIMEDIFF( t.teacher_open_course_question_log_update_time , t.teacher_open_course_question_log_add_time )) as finish_time, max(ifnull(t.teacher_open_course_question_log_finish_time , 0)) as finish_second_time, round(sum(ifnull(t.student_score , 0)), 1) as my_score from teacher_open_course_question_log t where 1 = 1 and t.teacher_open_course_question_log_status = 1 and t.question_log_add_type = 'FINALLY_SUBMIT' and t.teacher_open_course_question_setting_id = #questionSettingId# and t.student_id = #studentId#

queryByConditionQueryNotPage

  • 根据不为空的条件进行查询 select t.* from teacher_open_course_question_setting t where 1=1
    @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
    and #function("teacherOpenCourseQuestionSetting.query")# @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(teacherOpenCourseId)){ and t.teacher_open_course_id =#teacherOpenCourseId# @} @if(!isEmpty(teacherOpenCourseIdPlural)){ and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) @} @if(!isEmpty(teacherOpenCourseQuestionSettingSchoolClassIds)){ and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds# @} @if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){ and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount# @} @if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){ and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){ and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){ and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa# @} @if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){ and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse# @} @if(!isEmpty(teacherOpenCourseQuestionSettingName)){ and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName# @} @if(!isEmpty(teacherOpenCourseQuestionStartTime)){ and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime# @} @if(!isEmpty(teacherOpenCourseQuestionEndTime)){ and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingType)){ and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType# @} @if(!isEmpty(teacherOpenCourseQuestionSettingFile)){ and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile# @} @if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){ and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus# @} @if(isEmpty(teacherOpenCourseQuestionSettingStatus) && isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and t.teacher_open_course_question_setting_status != 2 @}else{ @if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){ and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus# @}else if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){ and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#) @} @} @if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){ and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime# @} @if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){ and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire# @} @if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){ and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId# @} @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#) @} ORDER BY CONVERT(regexp_replace ( t.teacher_open_course_question_setting_name, '[^0-9]+', '' ),unsigned) asc

getNotEmptyQuestionSetting

* 查询不为空的题目配置
select
t.*
from teacher_open_course_question_setting t
where 1=1  
@//题目不为空
and ( SELECT count( 1 ) FROM resources_question_snapshot tb WHERE tb.teacher_open_course_question_setting_id = t.teacher_open_course_question_setting_id AND tb.question_status = 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#)
@}
@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(teacherOpenCourseQuestionSettingSchoolClassIds)){
and t.teacher_open_course_question_setting_school_class_ids =#teacherOpenCourseQuestionSettingSchoolClassIds#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingDoCount)){
and t.teacher_open_course_question_setting_do_count =#teacherOpenCourseQuestionSettingDoCount#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingQuestionNoOrder)){
and t.teacher_open_course_question_setting_question_no_order =#teacherOpenCourseQuestionSettingQuestionNoOrder#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingOptionNoOrder)){
and t.teacher_open_course_question_setting_option_no_order =#teacherOpenCourseQuestionSettingOptionNoOrder#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingEndShowQa)){
and t.teacher_open_course_question_setting_end_show_qa =#teacherOpenCourseQuestionSettingEndShowQa#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingEndShowTrueFalse)){
and t.teacher_open_course_question_setting_end_show_true_false =#teacherOpenCourseQuestionSettingEndShowTrueFalse#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingName)){
and t.teacher_open_course_question_setting_name =#teacherOpenCourseQuestionSettingName#
@}
@if(!isEmpty(teacherOpenCourseQuestionStartTime)){
and t.teacher_open_course_question_start_time =#teacherOpenCourseQuestionStartTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionEndTime)){
and t.teacher_open_course_question_end_time =#teacherOpenCourseQuestionEndTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingType)){
and t.teacher_open_course_question_setting_type =#teacherOpenCourseQuestionSettingType#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingFile)){
and t.teacher_open_course_question_setting_file =#teacherOpenCourseQuestionSettingFile#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingPushStatus)){
and t.teacher_open_course_question_setting_push_status =#teacherOpenCourseQuestionSettingPushStatus#
@}
@if(isEmpty(teacherOpenCourseQuestionSettingStatus) && isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){
and t.teacher_open_course_question_setting_status != 2
@}else{
@if(!isEmpty(teacherOpenCourseQuestionSettingStatus)){
and t.teacher_open_course_question_setting_status =#teacherOpenCourseQuestionSettingStatus#
@}else if(!isEmpty(teacherOpenCourseQuestionSettingStatusPlural)){
and find_in_set(t.teacher_open_course_question_setting_status,#teacherOpenCourseQuestionSettingStatusPlural#)
@}
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){
and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){
and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire#
@}
@if(!isEmpty(teacherOpenCourseMergeCourseInfoId)){
and t.teacher_open_course_merge_course_info_id =#teacherOpenCourseMergeCourseInfoId#
@}
@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#)
@}