33 KiB
queryByCondition
-
根据不为空的参数进行分页查询
select @pageTag(){ t.*, ta.student_name, ta.student_sn, tb.class_name @} from question_log_summary t inner join student ta on ta.student_id = t.person_id and ta.student_status = 1 inner join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 where 1=1
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("questionLogSummary.query")# @if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @}
queryByConditionQuery
-
根据不为空的参数进行分页查询(无权限)
select @pageTag(){ @// 学生排名,单次试卷范围内的排名 RANK() over ( PARTITION BY t.question_setting_type, t.question_log_summary_from_type, t.question_setting_id ORDER BY t.question_log_summary_student_total_score DESC ) AS student_rank, -- 学生排名,单次试卷范围内的排名 t.*, ta.student_name, ta.student_sn, tb.class_name @} from question_log_summary t inner join student ta on ta.student_id = t.person_id and ta.student_status = 1 inner join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 where 1=1
@if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @}
deleteQuestionLogSummaryByIds
-
批量删除(假删除)
update question_log_summary set question_log_summary_status = 2 where find_in_set(question_log_summary_id,#ids#)
logicDeleteByQuestionSettingIds
-
批量删除(假删除)
update question_log_summary set question_log_summary_status = 2 where find_in_set(question_setting_id,#questionSettingIds#) and question_log_summary_status = 1
deleteByIds
-
批量删除(真删除)
delete from question_log_summary where find_in_set(question_log_summary_id,#ids#)
getByIds
select * from question_log_summary where find_in_set(question_log_summary_id,#ids#)
updateGivenByIds
-
批量更新指定字段,无论此字段是否有值
update question_log_summary set @if(contain("questionSettingId",_given)){ @if(isEmpty(questionSettingId)){ question_setting_id = null , @}else{ question_setting_id = #questionSettingId# , @} @} @if(contain("questionSettingName",_given)){ @if(isEmpty(questionSettingName)){ question_setting_name = null , @}else{ question_setting_name = #questionSettingName# , @} @} @if(contain("questionSettingType",_given)){ @if(isEmpty(questionSettingType)){ question_setting_type = null , @}else{ question_setting_type = #questionSettingType# , @} @} @if(contain("questionLogSummaryFromType",_given)){ @if(isEmpty(questionLogSummaryFromType)){ question_log_summary_from_type = null , @}else{ question_log_summary_from_type = #questionLogSummaryFromType# , @} @} @if(contain("questionSettingTotalScore",_given)){ @if(isEmpty(questionSettingTotalScore)){ question_setting_total_score = null , @}else{ question_setting_total_score = #questionSettingTotalScore# , @} @} @if(contain("personId",_given)){ @if(isEmpty(personId)){ person_id = null , @}else{ person_id = #personId# , @} @} @if(contain("questionLogIds",_given)){ @if(isEmpty(questionLogIds)){ question_log_ids = null , @}else{ question_log_ids = #questionLogIds# , @} @} @if(contain("questionLogSummaryQuestionTotalCount",_given)){ @if(isEmpty(questionLogSummaryQuestionTotalCount)){ question_log_summary_question_total_count = null , @}else{ question_log_summary_question_total_count = #questionLogSummaryQuestionTotalCount# , @} @} @if(contain("questionLogSummaryStudentDoCount",_given)){ @if(isEmpty(questionLogSummaryStudentDoCount)){ question_log_summary_student_do_count = null , @}else{ question_log_summary_student_do_count = #questionLogSummaryStudentDoCount# , @} @} @if(contain("questionLogSummarySuccessCount",_given)){ @if(isEmpty(questionLogSummarySuccessCount)){ question_log_summary_success_count = null , @}else{ question_log_summary_success_count = #questionLogSummarySuccessCount# , @} @} @if(contain("questionLogSummaryErrorCount",_given)){ @if(isEmpty(questionLogSummaryErrorCount)){ question_log_summary_error_count = null , @}else{ question_log_summary_error_count = #questionLogSummaryErrorCount# , @} @} @if(contain("questionLogSummarySuccessRate",_given)){ @if(isEmpty(questionLogSummarySuccessRate)){ question_log_summary_success_rate = null , @}else{ question_log_summary_success_rate = #questionLogSummarySuccessRate# , @} @} @if(contain("questionLogSummaryCurrentPassRate",_given)){ @if(isEmpty(questionLogSummaryCurrentPassRate)){ question_log_summary_current_pass_rate = null , @}else{ question_log_summary_current_pass_rate = #questionLogSummaryCurrentPassRate# , @} @} @if(contain("questionLogSummaryIsPass",_given)){ @if(isEmpty(questionLogSummaryIsPass)){ question_log_summary_is_pass = null , @}else{ question_log_summary_is_pass = #questionLogSummaryIsPass# , @} @} @if(contain("questionLogSummaryStatus",_given)){ @if(isEmpty(questionLogSummaryStatus)){ question_log_summary_status = null , @}else{ question_log_summary_status = #questionLogSummaryStatus# , @} @} @if(contain("questionLogSummaryAddTime",_given)){ @if(isEmpty(questionLogSummaryAddTime)){ question_log_summary_add_time = null , @}else{ question_log_summary_add_time = #questionLogSummaryAddTime# , @} @} @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# , @} @} question_log_summary_id = question_log_summary_id where find_in_set(question_log_summary_id,#questionLogSummaryIdPlural#)
getQuestionLogSummaryValues
-
根据不为空的参数进行查询
select t.*, ta.student_name, ta.student_sn, tb.class_name from question_log_summary t inner join student ta on ta.student_id = t.person_id and ta.student_status = 1 inner join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 where 1=1
@if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else{ and t.question_log_summary_status != 2 @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(userId)){ and t.user_id =#userId# @}
getValuesByQuery
-
根据不为空的参数进行查询
select t.*, ta.student_name, ta.student_sn, tb.class_name from question_log_summary t inner join student ta on ta.student_id = t.person_id and ta.student_status = 1 inner join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 where 1=1 and #function("questionLogSummary.query")# @if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @}
getValuesByQueryNotWithPermission
-
根据不为空的参数进行查询(不包含权限)
select t.*, ta.student_name, ta.student_sn, tb.class_name from question_log_summary t inner join student ta on ta.student_id = t.person_id and ta.student_status = 1 inner join school_class tb on tb.class_id = ta.class_id and tb.class_status = 1 where 1=1 @if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @}
getExcelValues
-
根据不为空的参数进行查询导入需要的参数
SELECT * FROM ( ( select MAX(LENGTH(t.question_setting_id)) question_setting_id, MAX(LENGTH(t.question_setting_name)) question_setting_name, MAX(LENGTH(t.question_setting_type)) question_setting_type, MAX(LENGTH(t.question_log_summary_from_type)) question_log_summary_from_type, MAX(LENGTH(t.question_setting_total_score)) question_setting_total_score, MAX(LENGTH(t.person_id)) person_id, MAX(LENGTH(t.question_log_ids)) question_log_ids, MAX(LENGTH(t.question_log_summary_question_total_count)) question_log_summary_question_total_count, MAX(LENGTH(t.question_log_summary_student_do_count)) question_log_summary_student_do_count, MAX(LENGTH(t.question_log_summary_success_count)) question_log_summary_success_count, MAX(LENGTH(t.question_log_summary_error_count)) question_log_summary_error_count, MAX(LENGTH(t.question_log_summary_success_rate)) question_log_summary_success_rate, MAX(LENGTH(t.question_log_summary_current_pass_rate)) question_log_summary_current_pass_rate, MAX(LENGTH(t.question_log_summary_is_pass)) question_log_summary_is_pass, MAX(LENGTH(t.question_log_summary_status)) question_log_summary_status, from question_log_summary t where 1=1 and #function("questionLogSummary.query")# @if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @} ) UNION ALL ( select t.question_setting_id , t.question_setting_name , t.question_setting_type , t.question_log_summary_from_type , t.question_setting_total_score , t.person_id , t.question_log_ids , t.question_log_summary_question_total_count , t.question_log_summary_student_do_count , t.question_log_summary_success_count , t.question_log_summary_error_count , t.question_log_summary_success_rate , t.question_log_summary_current_pass_rate , t.question_log_summary_is_pass , t.question_log_summary_status , from question_log_summary t where 1=1 and #function("questionLogSummary.query")#
@if(!isEmpty(questionLogSummaryId)){ and t.question_log_summary_id =#questionLogSummaryId# @} @if(!isEmpty(questionLogSummaryIdPlural)){ and find_in_set(t.question_log_summary_id,#questionLogSummaryIdPlural#) @} @if(!isEmpty(questionSettingId)){ and t.question_setting_id =#questionSettingId# @} @if(!isEmpty(questionSettingIdPlural)){ and find_in_set(t.question_setting_id,#questionSettingIdPlural#) @} @if(!isEmpty(questionSettingName)){ and t.question_setting_name =#questionSettingName# @} @if(!isEmpty(questionSettingType)){ and t.question_setting_type =#questionSettingType# @} @if(!isEmpty(questionLogSummaryFromType)){ and t.question_log_summary_from_type =#questionLogSummaryFromType# @} @if(!isEmpty(questionSettingTotalScore)){ and t.question_setting_total_score =#questionSettingTotalScore# @} @if(!isEmpty(personId)){ and t.person_id =#personId# @} @if(!isEmpty(personIdPlural)){ and find_in_set(t.person_id,#personIdPlural#) @} @if(!isEmpty(questionLogIds)){ and t.question_log_ids =#questionLogIds# @} @if(!isEmpty(questionLogSummaryQuestionTotalCount)){ and t.question_log_summary_question_total_count =#questionLogSummaryQuestionTotalCount# @} @if(!isEmpty(questionLogSummaryStudentDoCount)){ and t.question_log_summary_student_do_count =#questionLogSummaryStudentDoCount# @} @if(!isEmpty(questionLogSummarySuccessCount)){ and t.question_log_summary_success_count =#questionLogSummarySuccessCount# @} @if(!isEmpty(questionLogSummaryErrorCount)){ and t.question_log_summary_error_count =#questionLogSummaryErrorCount# @} @if(!isEmpty(questionLogSummarySuccessRate)){ and t.question_log_summary_success_rate =#questionLogSummarySuccessRate# @} @if(!isEmpty(questionLogSummaryCurrentPassRate)){ and t.question_log_summary_current_pass_rate =#questionLogSummaryCurrentPassRate# @} @if(!isEmpty(questionLogSummaryIsPass)){ and t.question_log_summary_is_pass =#questionLogSummaryIsPass# @} @if(isEmpty(questionLogSummaryStatus) && isEmpty(questionLogSummaryStatusPlural)){ and t.question_log_summary_status != 2 @}else{ @if(!isEmpty(questionLogSummaryStatus)){ and t.question_log_summary_status =#questionLogSummaryStatus# @}else if(!isEmpty(questionLogSummaryStatusPlural)){ and find_in_set(t.question_log_summary_status,#questionLogSummaryStatusPlural#) @} @} @if(!isEmpty(questionLogSummaryAddTime)){ and t.question_log_summary_add_time =#questionLogSummaryAddTime# @} @if(!isEmpty(orgId)){ and t.org_id =#orgId# @} @if(!isEmpty(orgIdPlural)){ and find_in_set(t.org_id,#orgIdPlural#) @} @if(!isEmpty(userId)){ and t.user_id =#userId# @} @if(!isEmpty(userIdPlural)){ and find_in_set(t.user_id,#userIdPlural#) @} @if(!isEmpty(studentSnOrName)){ and (ta.student_sn like #'%'+studentSnOrName+'%'# or ta.student_name like #'%'+studentSnOrName+'%'#) @} @if(!isEmpty(schoolClassIdPlural)){ and find_in_set(ta.class_id, #schoolClassIdPlural#) @} ) )t
analysisPageQuery
-
题目配置,统计分析接口。用于分析所有题目类型的平均值
select
@pageTag(){ z.* @} from ( select
ta.teacher_open_course_question_setting_name as question_setting_name, ta.teacher_open_course_question_setting_id as question_setting_id, ta.teacher_open_course_question_start_time as start_time, ta.teacher_open_course_question_end_time as end_time, ta.teacher_open_course_question_setting_type as question_setting_type,
count((ab.resources_question_snapshot_id)) as question_total_count, count(distinct(ta.teacher_open_course_question_setting_id)) as total_setting_count, round(avg(question_setting_total_score), 1) as avg_question_setting_total_score,
round(avg(question_log_summary_student_total_score), 1) as avg_student_score,
round(avg(question_log_summary_question_total_count), 1) as avg_question_total_count,
round(avg(question_log_summary_student_do_count), 1) as avg_question_log_summary_student_do_count,
round(avg(question_log_summary_success_count), 1) as avg_correct_count,
round(avg(question_log_summary_error_count), 1)as avg_wrong_count,
round(avg(question_log_summary_success_rate), 1) as avg_question_log_summary_success_rate,
round(avg(question_log_summary_is_pass), 1) as avg_question_log_summary_is_pass,
round(avg(finish_second_time), 1) as avg_finish_second_time
from resources_question_snapshot ab left join teacher_open_course_question_setting ta on ta.teacher_open_course_question_setting_id = ab.teacher_open_course_question_setting_id left join question_log_summary t on t.question_setting_id = ab.teacher_open_course_question_setting_id where 1 @if(!isEmpty(questionSettingType)) { 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# and ta.teacher_open_course_question_setting_status = 1 AND ta.teacher_open_course_question_setting_push_status = 1 AND ta.teacher_open_course_question_setting_name is not null group by
ta.teacher_open_course_question_setting_id, ta.teacher_open_course_question_setting_name, ta.teacher_open_course_question_setting_type, ta.teacher_open_course_question_start_time, ta.teacher_open_course_question_end_time ) z
analysisAvg
-
平均值分析
select
round(avg(question_setting_total_score), 1) as avg_question_setting_total_score,
round(avg(question_log_summary_student_total_score), 1) as avg_student_score,
round(avg(question_log_summary_question_total_count), 1) as avg_question_total_count,
round(avg(question_log_summary_student_do_count), 1) as avg_question_log_summary_student_do_count,
round(avg(question_log_summary_success_count), 1) as avg_correct_count,
round(avg(question_log_summary_error_count), 1)as avg_wrong_count,
round(avg(question_log_summary_success_rate), 1) as avg_question_log_summary_success_rate,
round(avg(question_log_summary_is_pass), 1) as avg_question_log_summary_is_pass,
round(avg(finish_second_time), 1) as avg_finish_second_time
from question_log_summary t where 1 @if(!isEmpty(questionSettingType)) { and t.question_setting_type = #questionSettingType#
@} @if(!isEmpty(questionSettingType)) { and find_in_set(t.question_setting_id, #questionSettingIds#)
@} and t.question_log_summary_status = 1
homeworkFileAnalysisPageQuery
-
附件作业的统计分析接口
select
@pageTag(){ z.* @} from ( SELECT ta.teacher_open_course_question_setting_name AS question_setting_name, ta.teacher_open_course_question_setting_id AS question_setting_id, ta.teacher_open_course_question_start_time AS start_time, ta.teacher_open_course_question_end_time AS end_time, ta.teacher_open_course_question_setting_type AS question_setting_type, IFNULL(round( avg( question_log_summary_student_total_score ), 1 ), 0) AS avg_student_score, IFNULL(round( avg( question_log_summary_success_rate ), 1 ), 0) AS avg_question_log_summary_success_rate, IFNULL(round( avg( question_log_summary_is_pass ), 1 ), 0) AS avg_question_log_summary_is_pass FROM teacher_open_course_question_setting ta LEFT JOIN question_log_summary t ON t.question_setting_id = ta.teacher_open_course_question_setting_id where 1 @if(!isEmpty(questionSettingType)) { and ta.teacher_open_course_question_setting_type = #questionSettingType# @} @if(!isEmpty(teacherOpenCourseId)) { and ta.teacher_open_course_id = #teacherOpenCourseId# @} and ta.teacher_open_course_question_setting_status = 1 AND ta.teacher_open_course_question_setting_push_status = 1 AND ta.teacher_open_course_question_setting_name is not null GROUP BY ta.teacher_open_course_question_setting_name, ta.teacher_open_course_question_setting_id, ta.teacher_open_course_question_start_time, ta.teacher_open_course_question_end_time, ta.teacher_open_course_question_setting_type ) z