12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.ssj.service.mapper.KmtExerciseMapper">
- <resultMap id="DistributionExerciseBookDTOResultMap" type="com.ssj.service.kmt.exercisesys.dto.DistributionExerciseBookDTO">
- <id column="exerciseBookId" property="exerciseBookId"/>
- <result column="importDate" property="importDate"/>
- <result column="subject" property="subject"/>
- <result column="grade" property="grade"/>
- <result column="version_name" property="versionName"/>
- <result column="semester" property="semester"/>
- <result column="book_name" property="bookName"/>
- <result column="book_type" property="bookType"/>
- <result column="unitNum" property="unitNum"/>
- <result column="courseNum" property="courseNum"/>
- <result column="intHandleAccuracy" property="intHandleAccuracy"/>
- <result column="intHandleAuditAccuracy" property="intHandleAuditAccuracy"/>
- <result column="intAnalysisAccuracy" property="intAnalysisAccuracy"/>
- <result column="assigned_batch" property="assignedBatch"/>
- <collection property="handleUserList" ofType="com.ssj.service.kmt.exercisesys.dto.DistributionTeacherDTO">
- <result column="handlerTeacherId" property="teacherId"/>
- <result column="handlerSalaryGiven" property="salaryGiven"/>
- <result column="handlerSalaryGivenTime" property="salaryGivenTime"/>
- <result column="handlerName" property="teacherName"/>
- <result column="handlerDistributeTime" property="createTime"/>
- </collection>
- <collection property="auditingUserList" ofType="com.ssj.service.kmt.exercisesys.dto.DistributionTeacherDTO">
- <result column="handlerAuditUserTeacherId" property="teacherId"/>
- <result column="handlerAuditUserSalaryGiven" property="salaryGiven"/>
- <result column="handlerAuditUserSalaryGivenTime" property="salaryGivenTime"/>
- <result column="handlerAuditUserName" property="teacherName"/>
- <result column="handlerAuditUserDistributeTime" property="createTime"/>
- </collection>
- <collection property="analysisUserList" ofType="com.ssj.service.kmt.exercisesys.dto.DistributionTeacherDTO">
- <result column="analyserTeacherId" property="teacherId"/>
- <result column="analyserSalaryGiven" property="salaryGiven"/>
- <result column="analyserSalaryGivenTime" property="salaryGivenTime"/>
- <result column="analyserName" property="teacherName"/>
- <result column="analyserDistributeTime" property="createTime"/>
- </collection>
- <collection property="analysisAuditerList" ofType="com.ssj.service.kmt.exercisesys.dto.DistributionTeacherDTO">
- <result column="analysisAuditUserTeacherId" property="teacherId"/>
- <result column="analysisAuditUserSalaryGiven" property="salaryGiven"/>
- <result column="analysisAuditUserSalaryGivenTime" property="salaryGivenTime"/>
- <result column="analysisAuditUserName" property="teacherName"/>
- <result column="analysisAuditUserDistributeTime" property="createTime"/>
- </collection>
- </resultMap>
- <resultMap id="ExportDistributionExerciseBookDTOResultMap" type="com.ssj.service.kmt.exercisesys.dto.ExportDistributionExerciseBookDTO">
- <id column="exercise_book_id" property="exerciseBookId"/>
- <result column="import_date" property="importDate"/>
- <result column="subject" property="subject"/>
- <result column="grade" property="grade"/>
- <result column="version_name" property="versionName"/>
- <result column="semester" property="semester"/>
- <result column="book_name" property="bookName"/>
- <result column="book_type" property="bookType"/>
- <result column="unit_count" property="unitNum"/>
- <result column="course_count" property="courseNum"/>
- </resultMap>
- <select id="findWrongQuestionKnowHowDetailIdList" resultType="java.lang.String">
- select kmt_exercise_question_know.how_details_id
- from kmt_exercise_question_know
- where kmt_exercise_question_know.question_id = #{questionId}
- union all
- select kmt_exercise_question_know.how_details_id
- from kmt_exercise_question_know,
- kmt_exercise_questions brother,
- kmt_exercise_questions
- where kmt_exercise_question_know.question_id = brother.id
- and brother.parent_id = kmt_exercise_questions.parent_id
- and kmt_exercise_questions.id = #{questionId}
- and ifnull(length(kmt_exercise_questions.parent_id), 0) > 0
- </select>
- <!-- 查询题目列表 -->
- <select id="findKmtExerciseQuestionsByIdIn" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion" >
- select eq.id, eq.book_id, eq.unit_id, eq.book_course_id,
- eb.auditing_user_id, eb.handle_user_id, eb.analysis_user_id, eb.analysis_auditer_id, eb.answer_correcter_id,
- eq.question_type, eq.source, eq.big_question_index, eq.analysis_submit_time, eq.page_index,
- eq.image, eq.precision_percent, eq.create_time, eq.deal_status, eq.remark, eq.analysis_submit_type,
- eq.answer_image, eq.num, eq.small_question_name, eq.parent_id, eq.big_name, eq.real_exam_type, eq.publish_time,
- eq.update_type, eq.difficulty_level, eq.training_skill, eq.course_name, eq.is_common_flag, eq.question_year, eq.exercise_book_id, eq.es_loaded,
- eq.analysis_handler_submit_time, eq.question_class_type, eq.repulse_time,
- eq.proofread_status, eq.question_path, eq.handler_submit_time
- from kmt_exercise_questions eq
- left join kmt_exercise_book eb on eq.exercise_book_id=eb.id where eq.id in
- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- limit 0, 5000
- </select>
- <!-- 查询打回题目列表 -->
- <select id="findKmtExerciseQuestionRollbacks" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestionRollback">
- SELECT * FROM kmt_exercise_question_rollback where question_id in
- <foreach collection="questionIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- and type=#{dealType}
- </select>
- <!-- 查询待加工审核的题目 -->
- <select id="findQuestionByBookCourseIdAndUserId" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eb.handle_user_id, eb.auditing_user_id, eb.analysis_user_id, eb.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason, eq.from_user_id, eq.to_user_id,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, eq.proofread_status, eq.question_path, eq.num, eq.create_time
- from kmt_exercise_questions eq left join kmt_exercise_book eb on eq.exercise_book_id=eb.id
- where eq.book_course_id = #{bookCourseId} and (eq.exercise_book_id=#{exerciseBookId} or eq.is_common_flag = 0)
- <if test = "dealType == 2">
- and eq.deal_status in (3, 7)
- </if>
- <if test = "dealType == 1">
- and eq.deal_status < 2
- </if>
- <if test = "dealType == 4">
- and eq.deal_status in (5, 8)
- </if>
- <if test = "dealType == 5">
- and eq.deal_status in (9, 10)
- </if>
- <if test = "dealType == 6">
- and eq.deal_status >= 4 and eq.deal_status != 7 and eb.answer_correcter_id=#{userId} and eq.proofread_status = 0
- </if>
- <if test = "dealType == 7">
- and eq.proofread_status > 0 and eb.answer_correcter_id=#{userId}
- </if>
- <if test="dealType == 3 and rollbackType > 0 ">
- <if test="rollbackType == 1">
- and eq.deal_status != 2
- </if>
- <if test="rollbackType == 2">
- and eq.deal_status > 2
- </if>
- <if test="rollbackType == 3">
- and eq.deal_status > 3 and eq.deal_status != 7
- </if>
- <if test="rollbackType == 4">
- and eq.deal_status > 8
- </if>
- <if test="rollbackType == 5">
- and eq.deal_status > 10
- </if>
- </if>
- order by eq.num, eq.create_time
- </select>
- <!-- 查询待加工审核的题目 -->
- <select id="findQuestionByBookCourseId" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eb.handle_user_id, eb.auditing_user_id, eb.analysis_user_id, eb.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, eq.question_path
- from kmt_exercise_questions eq
- left join kmt_exercise_book eb on eq.exercise_book_id=eb.id
- where eq.book_course_id = #{bookCourseId}
- order by eq.num, eq.create_time
- limit 0, 5000
- </select>
- <!-- 查询打回理由记录 -->
- <select id="findQuestionRollbackRecord" resultType="com.ssj.service.kmt.dto.exercise.KmtExerciseQuestionRollBackInfo">
- select eqr.id, eqr.create_time, eqr.reason,eqr.user_id userId,eqr.to_user_id toUserId,user1.user_id tbUserId,user2.user_id tbToUserId, user1.name from_user, eqr.from_user_type from_type,user2.name to_user,
- eqr.to_user_type to_type from kmt_exercise_question_rollback eqr left join tb_lib_manager user1 on eqr.user_id = user1.user_id and user1.type in (17, 18)
- left join tb_lib_manager user2 on eqr.to_user_id = user2.user_id and user2.type in (17, 18)
- where eqr.question_id = #{questionId}
- order by eqr.create_time desc limit 20;
- </select>
- <!-- 查询打回理由记录老 -->
- <select id="findQuestionRollbackRecordOld" resultType="com.ssj.service.kmt.dto.exercise.ExerciseQuestionRollbacks">
- select eqr.id,eqr.create_time, eqr.reason, user1.name from_user, user1.type from_type, user2.name to_user,
- user2.type to_type from kmt_exercise_question_rollback eqr left join kmt_sys_user user1 on eqr.user_id = user1.id
- left join kmt_sys_user user2 on eqr.to_user_id = user2.id
- where eqr.question_id = #{questionId} order by eqr.create_time desc limit 20;
- </select>
- <select id="countWrongAndTotal" resultType="java.util.Map">
- select sum(ifnull(scon_homework_how_details.detail_count, 0)) wrong_count,
- sum(ifnull(scon_homework_how_details.total_count, 1)) total_count
- from scon_homework_how_details,
- scon_homework
- where scon_homework_how_details.homework_id = scon_homework.id
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time >= #{beginDateTime}
- and #{endDateTime} >= scon_homework.create_time
- and scon_homework_how_details.wrong_question_id is null
- union all
- select sum(if(kmt_homework_wrong_question.type = 1, 1, 0)) wrong_count, count(*) total_count
- from kmt_homework_wrong_question,
- scon_homework
- where kmt_homework_wrong_question.homework_id = scon_homework.id
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time >= #{beginDateTime}
- and #{endDateTime} >= scon_homework.create_time
- and kmt_homework_wrong_question.is_delete = 0
- </select>
- <select id="countPlatformCorrectionKnowledgeTimes" resultType="java.util.Map">
- select zyb_know_how_details_sort.alias, count(*) count_num
- from scon_homework_how_details,
- scon_homework,
- zyb_know_how_details_sort
- where scon_homework_how_details.homework_id = scon_homework.id
- and scon_homework_how_details.how_detail_id = zyb_know_how_details_sort.how_details_id
- and scon_homework_how_details.knowledge_version = zyb_know_how_details_sort.type
- and zyb_know_how_details_sort.stat = 2
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and scon_homework_how_details.wrong_question_id is null
- group by zyb_know_how_details_sort.alias
- </select>
- <select id="findWrongQuestion" resultType="java.util.Map">
- select kmt_homework_wrong_question.homework_id, kmt_homework_wrong_question.question_id
- from kmt_homework_wrong_question,
- scon_homework
- where kmt_homework_wrong_question.homework_id = scon_homework.id
- and scon_homework.vip_id = #{vipId}
- and scon_homework.subject = #{subject}
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and kmt_homework_wrong_question.is_delete = 0
- </select>
- <select id="countCampusCorrectionKnowledgeTimesByQuestionIds" resultType="java.util.Map">
- select khds.alias, count(distinct eqk.question_id) count_num
- from (select question_id, how_detail_sort_id
- from kmt_exercise_question_know
- where question_id in
- <foreach collection="questionIdList" open="(" item="questionId" separator="," close=")">
- #{questionId}
- </foreach>
- ) eqk, zyb_know_how_details_sort khds
- where eqk.how_detail_sort_id = khds.id
- group by khds.alias
- </select>
- <select id="countKnowledgeMastery" resultType="java.util.Map">
- (select details_sort.alias,
- <if test="subject != null and subject != ''">
- <if test="subject == '语文' || subject == '数学'">
- details_sort.two_module module,
- </if>
- <if test="subject == '英语'">
- details_sort.module module,
- </if>
- </if>
- group_concat(how_sort.alias) how_name,
- sum(ifnull(scon_homework_how_details.detail_count, 0)) wrong_count,
- sum(ifnull(scon_homework_how_details.total_count, 1)) total_count,
- group_concat(details_sort.how_details_id) know_how_detail_id_str,
- group_concat(details_sort.type) knowledge_version_str
- from scon_homework_how_details,
- scon_homework,
- zyb_know_how_details_sort details_sort,
- zyb_know_how_details_sort how_sort
- where scon_homework_how_details.homework_id = scon_homework.id
- and scon_homework_how_details.how_detail_id = details_sort.how_details_id
- and scon_homework_how_details.knowledge_version = details_sort.type
- and details_sort.stat = 2
- and how_sort.how_id = details_sort.how_id
- and how_sort.stat = 1
- and how_sort.grade_num = details_sort.grade_num
- and how_sort.semester = details_sort.semester
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and scon_homework_how_details.wrong_question_id is null
- group by details_sort.alias)
- union all
- (select details_sort.alias,
- <if test="subject != null and subject != ''">
- <if test="subject == '语文' || subject == '数学'">
- details_sort.two_module module,
- </if>
- <if test="subject == '英语'">
- details_sort.module module,
- </if>
- </if>
- group_concat(how_sort.alias) how_name,
- sum(if(kmt_homework_wrong_question.type = 1, 1, 0)) wrong_count,
- count(*) total_count,
- group_concat(details_sort.how_details_id) know_how_detail_id_str,
- group_concat(details_sort.type) knowledge_version_str
- from kmt_homework_wrong_question,
- scon_homework,
- kmt_exercise_questions,
- kmt_exercise_book_course,
- kmt_exercise_question_know,
- zyb_know_how_details_sort details_sort,
- zyb_know_how_details_sort how_sort
- where kmt_homework_wrong_question.homework_id = scon_homework.id
- and kmt_homework_wrong_question.question_id = kmt_exercise_questions.id
- and kmt_exercise_questions.book_course_id = kmt_exercise_book_course.id
- and kmt_homework_wrong_question.question_id = kmt_exercise_question_know.question_id
- and kmt_exercise_question_know.how_details_id = details_sort.how_details_id
- and details_sort.type = kmt_exercise_book_course.version
- and details_sort.stat = 2
- and how_sort.how_id = details_sort.how_id
- and how_sort.stat = 1
- and how_sort.grade_num = details_sort.grade_num
- and how_sort.semester = details_sort.semester
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and kmt_homework_wrong_question.is_delete = 0
- group by details_sort.alias)
- </select>
- <select id="findMonthHomeworkCount" resultType="com.ssj.bean.sys.homework.domain.HomeworkCount">
- select *
- from scon_homework_count
- where vip_id = #{vipId}
- and data_type = 2
- and homework_month = #{homeworkMonth}
- </select>
- <!--查询题目列表关联的知识点id列表-->
- <select id="findHowDetailIdsByQuestionIds" resultType="java.lang.String">
- select how_details_id from kmt_exercise_question_know where question_id in
- <foreach collection="questionIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- group by how_details_id
- </select>
- <!--查询相似题-->
- <select id="findSimilarQuestionByIds" resultType="com.ssj.bean.conch.conch.dto.KmtExerciseQuestionProblemDto">
- select id question_id, big_question_index, question_path, num from kmt_exercise_questions where id in
- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- order by num
- </select>
- <select id="countPlatformCorrectionKnowledgeMastery" resultType="java.util.Map">
- select scon_homework_how_details.how_detail_id,
- scon_homework_how_details.knowledge_version version,
- scon_homework_how_details.grade,
- scon_homework_how_details.semester,
- sum(ifnull(scon_homework_how_details.detail_count, 0)) wrong_count,
- sum(ifnull(scon_homework_how_details.total_count, 1)) total_count
- from scon_homework_how_details,
- scon_homework,
- zyb_know_how_details_sort
- where scon_homework_how_details.homework_id = scon_homework.id
- and scon_homework_how_details.how_detail_id = zyb_know_how_details_sort.how_details_id
- and scon_homework_how_details.grade = zyb_know_how_details_sort.grade
- and scon_homework_how_details.semester = zyb_know_how_details_sort.semester
- and scon_homework_how_details.knowledge_version = zyb_know_how_details_sort.type
- and scon_homework.vip_id = #{vipId}
- <if test="subject != null and subject != ''">
- and scon_homework.subject = #{subject}
- </if>
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and scon_homework_how_details.wrong_question_id is null
- group by zyb_know_how_details_sort.alias
- </select>
- <select id="findWrongQuestion4Mastery" resultType="java.util.Map">
- select kmt_homework_wrong_question.question_id, kmt_homework_wrong_question.type
- from kmt_homework_wrong_question,
- scon_homework
- where kmt_homework_wrong_question.homework_id = scon_homework.id
- and scon_homework.vip_id = #{vipId}
- and scon_homework.subject = #{subject}
- and scon_homework.create_time > #{beginDateTimeStr}
- and #{endDateTimeStr} > scon_homework.create_time
- and kmt_homework_wrong_question.is_delete = 0
- </select>
- <select id="findKnowledgeByQuestionId" resultType="java.util.Map">
- select khds.how_details_id how_detail_id, khds.type version, khds.grade, khds.semester, khds.alias
- from (select how_detail_sort_id from kmt_exercise_question_know where question_id = #{questionId}) eqk,
- zyb_know_how_details_sort khds
- where eqk.how_detail_sort_id = khds.id
- </select>
- <!--查询未解析的题目-->
- <select id="findUnAnalysisBookCourse" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBookCourse">
- select distinct t1.id, t1.book_id, t1.course_name, t1.version, t1.grade,
- t1.semester, t1.book_name, t1.unit, t1.period, t1.unit_id,
- t1.period_sort, t1.unit_sort from kmt_exercise_book_course t1 left join kmt_exercise_questions t2
- on t1.id = t2.book_course_id where t1.analysis_user_id=#{analysisUserId} and t2.analysis_submit_type=0
- order by t1.unit_sort, t1.period_sort limit 0, #{maxCount}
- </select>
- <select id="findData2EsByQuestionList" resultType="java.util.Map">
- select k.id,
- k.question_id,
- k.how_details_id,
- k.how_details_kd_id,
- k.how_detail_sort_id,
- k.how_detail_kd_sort_id,
- k.version,
- date_format(k.create_time, '%Y-%m-%dT%H:%i:%s.000Z') create_time,
- book_id,
- unit_id,
- book_course_id,
- question_type,
- source,
- big_question_index,
- date_format(analysis_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_submit_time,
- page_index,
- image,
- precision_percent,
- auditing_user_id,
- handle_user_id,
- deal_status,
- remark,
- analysis_submit_type,
- answer_image,
- t.num,
- small_question_name,
- ifnull(parent_id, '') parent_id,
- big_name,
- real_exam_type,
- date_format(publish_time, '%Y-%m-%dT%H:%i:%s.000Z') publish_time,
- update_type,
- analysis_user_id,
- ifnull(difficulty_level, 0) difficulty_level,
- t.course_name,
- training_skill,
- concise_id,
- analysis_auditer_id,
- date_format(handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') handler_submit_time,
- date_format(analysis_handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_handler_submit_time,
- question_class_type,
- ifnull(khds.alias, '') knowledge_name,
- khds.course_name,
- khds.semester,
- khds.grade,
- date_format(t.repulse_time, '%Y-%m-%dT%H:%i:%s.000Z') repulse_time,
- t.question_path
- from (select *
- from kmt_exercise_question_know
- where question_id in
- <foreach collection="questionIdList" open="(" item="questionId" separator="," close=")">
- #{questionId}
- </foreach>
- limit 1000) k join kmt_exercise_questions t on k.question_id = t.id
- left join zyb_know_how_details_sort khds on k.how_detail_sort_id = khds.id
- </select>
- <select id="findAll2Es" resultType="java.util.Map">
- select k.id,
- k.question_id,
- k.how_details_id,
- k.how_details_kd_id,
- k.how_detail_sort_id,
- k.how_detail_kd_sort_id,
- k.version,
- date_format(k.create_time, '%Y-%m-%dT%H:%i:%s.000Z') create_time,
- book_id,
- unit_id,
- book_course_id,
- question_type,
- source,
- big_question_index,
- date_format(analysis_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_submit_time,
- page_index,
- image,
- precision_percent,
- auditing_user_id,
- handle_user_id,
- deal_status,
- remark,
- analysis_submit_type,
- answer_image,
- t.num,
- small_question_name,
- ifnull(parent_id, '') parent_id,
- big_name,
- real_exam_type,
- date_format(publish_time, '%Y-%m-%dT%H:%i:%s.000Z') publish_time,
- update_type,
- analysis_user_id,
- ifnull(difficulty_level, 0) difficulty_level,
- t.course_name,
- training_skill,
- concise_id,
- analysis_auditer_id,
- date_format(handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') handler_submit_time,
- date_format(analysis_handler_submit_time, '%Y-%m-%dT%H:%i:%s.000Z') analysis_handler_submit_time,
- question_class_type,
- ifnull(khds.alias, '') knowledge_name,
- khds.course_name,
- khds.semester,
- khds.grade,
- date_format(t.repulse_time, '%Y-%m-%dT%H:%i:%s.000Z') repulse_time,
- t.question_path
- from (select * from kmt_exercise_question_know where kmt_exercise_question_know.loaded = 0 limit #{pageSize}) k
- join kmt_exercise_questions t on k.question_id = t.id
- left join zyb_know_how_details_sort khds on k.how_detail_sort_id = khds.id
- </select>
- <select id="countQuestionByKnowledgeAndVersion" resultType="java.lang.Integer">
- select count(distinct question_id)
- from kmt_exercise_question_know
- where how_details_id in
- <foreach collection="knowledgeIdList" open="(" item="knowledgeId" separator="," close=")">
- #{knowledgeId}
- </foreach>
- and kmt_exercise_question_know.version = #{version}
- </select>
- <!--查询未加工练习册 where eb.had_handle = 0 and eb.handle_user_id=#{handleUserId}
- left join kmt_exercise_questions eq on eb.id=eq.book_id
- where eq.deal_status in (0, 1) and eb.handle_user_id=#{handleUserId}
- group by eb.id
- -->
- <select id="findUnHandleBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag != 3 and eb.had_handle=0 and eb.handle_user_id=#{handleUserId}
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <!--查询未分配加工人练习册-->
- <select id="findUndistributedHandlerBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.book_id id, group_concat(distinct eb.book_year order by eb.book_year asc) book_year_list, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.part_flag
- from kmt_exercise_book eb
- where eb.course_name=#{subject} and eb.semester=#{semester} and eb.version=#{versionType} and eb.grade=#{grade}
- and eb.handle_user_id is null
- group by eb.book_id
- </select>
- <!--查询未审核练习册 where eb.had_auditing=0 and eb.auditing_user_id=#{auditingUserId}
- left join kmt_exercise_questions eq on eb.id=eq.book_id
- where eq.deal_status in (3, 7) and eb.auditing_user_id=#{auditingUserId}
- group by eb.id
- -->
- <select id="findUnAuditingBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id,eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag != 3 and eb.had_auditing=0 and eb.auditing_user_id=#{auditingUserId}
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <!--查询未分配审核练习册-->
- <select id="findUndistributedAuditerBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.book_id id, group_concat(distinct eb.book_year order by eb.book_year asc) book_year_list, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.part_flag
- from kmt_exercise_book eb
- where eb.course_name=#{subject} and eb.semester=#{semester} and eb.version=#{versionType} and eb.grade=#{grade}
- and eb.auditing_user_id is null
- group by eb.book_id
- </select>
- <!--查询未加工解析的练习册-->
- <select id="findUnAnalysisHandleBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag != 3 and eb.analysis_handled=0 and eb.analysis_user_id=#{analysisUserId}
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <!--查询未审核解析的练习册-->
- <select id="findUnAnalysisAuditingBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag != 3 and eb.analysis_audited=0 and eb.analysis_auditer_id=#{analysisAuditerId}
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <select id="findUnCorrectAnswerBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exerciseBookId, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag !=3 and eb.answer_correcter_id=#{userId} and eb.answer_corrected_status = 0
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <select id="findCorrectedAnswerBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exerciseBookId, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag !=3 and eb.answer_correcter_id=#{userId} and eb.proofread_status > 0
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <!--查询未校对的练习册-->
- <select id="findExerciseBookListByIds" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type
- from kmt_exercise_book eb
- where id in
- <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </select>
- <!--查询所有练习册练习册-->
- <select id="findAllExerciseBooks" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type, eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb
- where eb.part_flag != 3 and eb.course_name=#{subject} and eb.semester=#{semester} and eb.version=#{versionType} and eb.grade=#{grade}
- <if test="bookName != null and bookName != ''">
- <choose>
- <when test="searchType == 1">
- and eb.book_name = #{bookName}
- </when>
- <otherwise>
- and eb.book_name like concat('%',#{bookName},'%')
- </otherwise>
- </choose>
- </if>
- </select>
- <!--查询待加工审核的练习册单元 -->
- <select id="findUnHandleExerciseBookCourse" resultType="com.ssj.service.kmt.dto.exercise.ExerciseUnitBookcourseDto">
- select ebc.unit_id id, ebc.unit name, ebc.id book_course_id, ebc.period book_course, ebc.period_sort from kmt_exercise_book_course ebc
- left join kmt_exercise_questions eq on ebc.id=eq.book_course_id
- left join kmt_exercise_book eb on eq.exercise_book_id = eb.id
- where eq.exercise_book_id=#{bookId}
- <choose>
- <when test = "dealType == 1">
- and eq.deal_status in (0, 1) and eb.handle_user_id=#{userId}
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <when test = "dealType == 2">
- and eq.deal_status in (3, 7) and eb.auditing_user_id=#{userId}
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <when test = "dealType == 4">
- and eq.deal_status in (5, 8) and eb.analysis_user_id=#{userId}
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <when test = "dealType == 5">
- and eq.deal_status in (9, 10) and eb.analysis_auditer_id=#{userId}
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <when test = "dealType == 6">
- and eq.deal_status >= 4 and eq.deal_status != 7 and eb.answer_correcter_id=#{userId} and eq.proofread_status = 0
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <when test = "dealType == 7">
- and eq.proofread_status > 0 and eb.answer_correcter_id=#{userId}
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </when>
- <otherwise>
- <if test="questionId != null and questionId != ''">
- and eq.id=#{questionId}
- </if>
- </otherwise>
- </choose>
- group by ebc.id
- order by ebc.period_sort
- </select>
- <!--查询待解析加工审核的练习册单元-->
- <select id="findAnalysisUnHandleExerciseBookCourse" resultType="com.ssj.service.kmt.dto.exercise.ExerciseUnitBookcourseDto">
- select ebu.id, ebu.unit name, ebc.id book_course_id, ebc.period book_course from kmt_exercise_book_unit ebu
- left join kmt_exercise_book_course ebc on ebu.id=ebc.unit_id
- left join kmt_exercise_questions eq on ebc.id=eq.book_course_id
- where ebu.book_id=#{bookId}
- <if test = "dealType == 2">
- and ebc.had_handle = 0
- </if>
- <if test = "dealType == 1">
- and ebc.had_auditing = 0
- </if>
- <if test = "dealType == 4">
- and eq.deal_status in (5, 8)
- </if>
- <if test = "dealType == 5">
- and eq.deal_status in (9, 10)
- </if>
- group by ebc.id
- order by ebu.num, ebc.period_sort
- </select>
- <!--查询练习册下所有单元课时-->
- <select id="findAllExerciseBookCourse" resultType="com.ssj.service.kmt.dto.exercise.ExerciseUnitBookcourseDto">
- select ebc.unit_id id, ebc.unit name, ebc.id book_course_id, ebc.period book_course, ebc.period_sort from kmt_exercise_book_course ebc
- where (ebc.book_id = #{bookId} and ebc.is_common_flag = 0) or (ebc.exercise_book_id=#{exerciseBookId} and ebc.is_common_flag = 1)
- order by ebc.period_sort
- </select>
- <!--查询练习册下所有单元课时-->
- <select id="findAllExerciseBookCourseByExerciseBookId" resultType="com.ssj.service.kmt.dto.exercise.ExerciseUnitBookcourseDto">
- select ebc.unit_id id, ebc.unit name, ebc.id book_course_id, ebc.period book_course, ebc.period_sort from kmt_exercise_book_course ebc
- where ebc.exercise_book_id=#{exerciseBookId}
- order by ebc.period_sort
- </select>
- <!--查询未加工/未审核的题目数量-->
- <select id ="findUnHandleQuestionCount" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_questions where book_course_id=#{bookCourseId}
- and id not in
- <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- <if test = "dealType == 2">
- and deal_status in (3, 7)
- </if>
- <if test = "dealType == 1">
- and deal_status < 2
- </if>
- </select>
- <!--查询未加工/未审核的课时数量-->
- <select id="findUnHandleBookCourseCount" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_book_course where unit_id=#{unitId}
- and id != #{bookCourseId}
- <if test = "dealType == 2">
- and had_auditing = 0
- </if>
- <if test = "dealType == 1">
- and had_handle = 0
- </if>
- </select>
- <!--查询未加工/未审核的单元数量-->
- <select id="findUnHandleUnitCount" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_book_unit where book_id=#{bookId}
- and id != #{unitId}
- <if test = "dealType == 2">
- and had_auditing = 0
- </if>
- <if test = "dealType == 1">
- and had_handle = 0
- </if>
- </select>
- <!--查询搜索的题目-->
- <select id="findKmtQuestionsById" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.num small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, parent_id, image question_image, eq.update_type
- from kmt_exercise_questions eq
- where (eq.id=#{questionId} or eq.parent_id=#{questionId}) and eq.question_class_type in (0, 2) and eq.book_id is null
- <choose>
- <when test="dealType == 1">
- and eq.handle_user_id = #{userId} and eq.deal_status < 2
- </when>
- <when test="dealType == 2">
- and eq.auditing_user_id = #{userId} and eq.deal_status in (3, 7)
- </when>
- <otherwise>
- and eq.deal_status != 6
- </otherwise>
- </choose>
- order by eq.num
- </select>
- <!--根据知识点分页查询题目-->
- <select id="findKmtQuestionByDetailId" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, parent_id, image question_image
- from kmt_exercise_questions eq
- left join kmt_exercise_question_know eqk on eq.id = eqk.question_id
- where eqk.how_detail_sort_id = #{howDetailsId}
- <if test = "howDetailsKdId != null and howDetailsKdId != ''">
- and eqk.how_detail_kd_sort_id= #{howDetailsKdId}
- </if>
- and eq.book_id is null and (((eq.parent_id is null or eq.parent_id='') and not exists (select 1 from kmt_exercise_questions tmpeq where tmpeq.parent_id = eq.id))
- or (eq.parent_id is not null and eq.parent_id != ''))
- <choose>
- <when test="dealType == 1">
- and eq.handle_user_id = #{userId} and eq.deal_status < 2
- </when>
- <when test="dealType == 2">
- and eq.auditing_user_id = #{userId} and eq.deal_status in (3, 7)
- </when>
- <otherwise>
- and eq.deal_status != 6
- </otherwise>
- </choose>
- <if test="userIdList.size() > 0">
- and (
- eq.handle_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- OR
- eq.auditing_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- )
- </if>
- group by eq.id
- order by eq.handler_submit_time, eq.parent_id, eq.num, eq.id
- </select>
- <!--根据年级,科目,版本,上下册分页查询题目-->
- <select id="findKmtQuestionByGradeSubjectVersionSemester" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, parent_id, image question_image
- from kmt_exercise_questions eq
- left join zyb_know_how_details_sort khds on eq.concise_id=khds.id
- where eq.book_id is null and eq.question_class_type in (0, 2)
- <if test = "grade != null and grade != ''">
- and khds.grade = #{grade}
- </if>
- <if test = "courseName != null and courseName != ''">
- and khds.course_name = #{courseName}
- </if>
- <if test = "type > 0">
- and khds.type = #{type}
- </if>
- <if test = "semester > 0">
- and khds.semester = #{semester}
- </if>
- <choose>
- <when test="dealType == 1">
- and eq.handle_user_id = #{userId} and eq.deal_status < 2
- </when>
- <when test="dealType == 2">
- and eq.auditing_user_id = #{userId} and eq.deal_status in (3, 7)
- </when>
- <otherwise>
- and eq.deal_status != 6
- </otherwise>
- </choose>
- <if test="userIdList.size() > 0">
- and (
- eq.handle_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- OR
- eq.auditing_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- )
- </if>
- group by eq.id
- order by eq.handler_submit_time, eq.parent_id, eq.num, eq.id
- </select>
- <!--分页查询所有题目-->
- <select id="findAllKmtQuestions" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, image question_image
- from kmt_exercise_questions eq
- where eq.book_id is null and (((eq.parent_id is null or eq.parent_id='') and not exists (select 1 from kmt_exercise_questions tmpeq where tmpeq.parent_id = eq.id))
- or (eq.parent_id is not null and eq.parent_id != ''))
- <choose>
- <when test="dealType == 1">
- and eq.handle_user_id = #{userId} and eq.deal_status < 2
- </when>
- <when test="dealType == 2">
- and eq.auditing_user_id = #{userId} and eq.deal_status in (3, 7)
- </when>
- <otherwise>
- and eq.deal_status != 6
- </otherwise>
- </choose>
- <if test="userIdList.size() > 0">
- and (
- eq.handle_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- OR
- eq.auditing_user_id in
- <foreach collection="userIdList" index="i" item="userId" open="(" close=")" separator=",">
- #{userId}
- </foreach>
- )
- </if>
- group by eq.id
- order by eq.handler_submit_time, eq.parent_id, eq.num, eq.id
- </select>
- <!--查询小题-->
- <select id="findSmallQuestionByParentIds" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, image question_image
- from kmt_exercise_questions eq
- where eq.parent_id in
- <foreach collection="parentIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- and eq.deal_status != 6
- order by eq.parent_id, eq.num
- </select>
- <!--查询大题-->
- <select id="findBigQuestionById" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id, eq.analysis_auditer_id, eq.book_course_id course_id,
- eq.big_question_index, eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason,
- eq.question_type question_types, eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, image question_image,eq.update_type
- from kmt_exercise_questions eq
- where eq.id = #{id}
- </select>
- <!--查询题目的知识点-->
- <select id="findQuestionKnowByQuestionIds" resultType="com.ssj.bean.kmt.kmt.model.QuestionListKnowModel">
- select eqk.question_id, hds.id how_details_id, hds.alias detail_name, hdks.id how_details_kd_id, hdks.alias kd_name,
- hds.grade, hds.course_name, hds.type version_type, hds.semester, khd.is_zt module_type, hs.alias how_name, hds.num, hdks.num
- from kmt_exercise_question_know eqk
- left join zyb_know_how_details_sort hds on eqk.how_detail_sort_id=hds.id
- left join zyb_know_how_details_sort hs on hds.how_id=hs.how_id and hds.type=hs.type and hds.semester=hs.semester and hds.grade=hs.grade and hs.stat=1
- left join zyb_know_how_details_sort hdks on eqk.how_detail_kd_sort_id=hdks.id
- left join zyb_know_how_details khd on hds.how_details_id=khd.id
- where question_id in
- <foreach collection="questionIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- order by eqk.question_id, hds.num, hdks.num
- </select>
- <!--查询kmt题目的知识点-->
- <select id="findKmtQuestionKnowByQuestionIds" resultType="com.ssj.bean.kmt.kmt.model.QuestionListKnowModel">
- select eqk.question_id, hds.id how_details_id, hds.alias detail_name, hdks.id how_details_kd_id, hdks.alias kd_name,
- hds.grade, hds.course_name, hds.type version_type, hds.semester, khd.is_zt module_type, hs.alias how_name
- from kmt_quality_question_know eqk
- left join zyb_know_how_details_sort hds on eqk.how_detail_sort_id=hds.id
- left join zyb_know_how_details_sort hs on hds.how_id=hs.how_id and hds.type=hs.type and hds.semester=hs.semester and hds.grade=hs.grade and hs.stat=1
- left join zyb_know_how_details_sort hdks on eqk.how_detail_kd_sort_id=hdks.id
- left join zyb_know_how_details khd on hds.how_details_id=khd.id
- where question_id in
- <foreach collection="questionIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- order by eqk.question_id, hds.num, hdks.num
- </select>
- <!--通过子题目id查询父题目-->
- <select id="findPrentQuestionByChildQuestionId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion">
- select parent.* from kmt_exercise_questions child left join kmt_exercise_questions parent on child.parent_id=parent.id
- where child.id=#{questionId} and parent.id is not null
- </select>
- <!--分页查询作业批改带学校的练习册-->
- <select id="findHomeworkCorrectFilterBooksBySchool" resultType="com.ssj.service.sys.homework.vo.HomeworkExerciseBookDto">
- select eb.id book_id, eb.book_name, eb.part_flag, eb.course_name, eb.version version_type, eb.semester from kmt_exercise_book eb
- left join scon_homework_exercise_except hee on eb.id=hee.except_book_id
- and hee.school=#{school}
- where hee.id is null and eb.course_name=#{subject}
- <if test="versionType > 0">
- and version=#{versionType}
- </if>
- and eb.semester=#{semester} and eb.grade=#{grade}
- and eb.book_type in (0, 1, 3)
- order by eb.id
- </select>
- <!--分页查询作业批改的练习册-->
- <select id="findHomeworkCorrectFilterBooks" resultType="com.ssj.service.sys.homework.vo.HomeworkExerciseBookDto">
- select eb.id book_id, eb.book_name, eb.part_flag, eb.course_name, eb.version version_type, eb.semester from kmt_exercise_book eb where eb.course_name=#{subject}
- and eb.semester=#{semester} and eb.grade=#{grade}
- <if test="versionType > 0">
- and version=#{versionType}
- </if>
- and eb.book_type in (0, 1, 3)
- order by eb.id
- </select>
- <!-- 查询练习册记录-->
- <select id="findExerciseBookById" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- select * from kmt_exercise_book where id=#{bookId}
- </select>
- <select id="findExerciseBookByBookIdAndYearAndType" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- select id, book_id from kmt_exercise_book where book_id=#{bookId} and book_year=#{bookYear}
- and book_type=#{bookType}
- limit 1
- </select>
- <!-- 查询练习册单元课时-->
- <select id="findByBookIds" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBookCourse">
- select eb.id book_id, ebc.book_name, ebc.unit_id, ebc.unit, ebc.id, ebc.period, ebc.grade,
- ebc.course_name, ebc.version, ebc.semester, eb.part_flag remark from kmt_exercise_book_course ebc
- left join kmt_exercise_book eb on ebc.book_id=eb.book_id where eb.id in
- <foreach collection="bookIds" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- order by eb.id,ebc.unit_sort,ebc.period_sort limit 5000
- </select>
- <!-- 删除加工的知识点 -->
- <delete id="deleteKmtExerciseQuestionKnowByQuestionIds">
- delete from kmt_exercise_question_know where question_id in
- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteKmtExerciseBookStatusCountByExerciseBookIds">
- delete from kmt_exercise_book_status_count where exercise_book_id in
- <foreach collection="exerciseBookIdSet" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 题目提交审核 -->
- <update id="updateKmtExerciseQuestion2Review">
- UPDATE kmt_exercise_questions set deal_status=3 WHERE id in
- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </update>
- <update id="updateLoadStatus">
- update kmt_exercise_question_know set loaded = 1 where loaded = 0 and id in
- <foreach collection="kmtExerciseQuestionKnowIdList" open="(" item="id" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <!--更新练习册为未加工-->
- <update id="updateKmtExerciseBookNotHandle">
- update kmt_exercise_book set had_handle=0 where id=#{id}
- </update>
- <!--更新练习册为未审核-->
- <update id="updateKmtExerciseBookNotAuditing">
- update kmt_exercise_book set had_auditing=0 where id=#{id}
- </update>
- <!--更新练习册为解析未加工-->
- <update id="updateKmtExerciseBookAnalysisNotHandle">
- update kmt_exercise_book set analysis_handled=0 where id=#{id}
- </update>
- <!--更新练习册为解析未审核-->
- <update id="updateKmtExerciseBookAnalysisNotAuditing">
- update kmt_exercise_book set analysis_audited=0 where id=#{id}
- </update>
- <!--更新练习册课时为未加工-->
- <update id="updateKmtExerciseBookCourseNotHandle">
- update kmt_exercise_book_course set had_handle=0, had_auditing=0 where id=#{id}
- </update>
- <!--更新练习册课时为未审核-->
- <update id="updateKmtExerciseBookCourseNotAuditing">
- update kmt_exercise_book_course set had_auditing=0 where id=#{id}
- </update>
- <update id="updateExerciseQuestionKnowEsLoadStatus">
- update kmt_exercise_question_know set loaded = #{newLoaded}
- where id in
- <foreach collection="kmtExerciseQuestionKnowIdList" open="(" item="kmtExerciseQuestionKnowId" separator="," close=")">
- #{kmtExerciseQuestionKnowId}
- </foreach>
- </update>
- <select id="getBookId" resultType="String" parameterType="java.util.Map">
- select id
- from kmt_exercise_book eb
- where eb.course_name = #{map.subject}
- and eb.grade = #{map.grade}
- and eb.semester = #{map.semester}
- and eb.book_type in (0, 1, 3)
- and not exists (
- select 1 from scon_homework_exercise_except t1
- where t1.school = #{map.school}
- and t1.grade = #{map.grade}
- and t1.course_name = #{map.subject}
- and eb.book_id = t1.except_book_id
- )
- <if test='map.version != null and map.version > 0'>
- and version = #{map.version}
- </if>
- </select>
- <select id="findAllChild" resultType="com.ssj.service.conch.parents.v2.dto.TrainRecommendQuestionDTO">
- select
- id,
- difficulty_level difficulty,
- question_type optionTypeInt,
- course_name,
- num
- from kmt_exercise_questions
- where parent_id = #{parentId}
- order by num
- </select>
- <sql id="exercisePublic" >
- t.id exerciseBookId,
- t.url1,
- t.url2,
- t.book_name bookName,
- t.press,
- t.course_name subject,
- t.grade,
- t.version,
- t.version_name versionName,
- t.semester,
- t.print_year printYear,
- t.book_year bookYear,
- t.book_year useYear,
- t.status,
- t.org_nums orgNums,
- t.progress,
- t.total_grade_priority priority,
- t.identified_nums identifiedNums,
- t.answer_correcter_id answerCorrecterId,
- t.book_type,
- t.check_time checkTime,
- t.ai_rollback_import aiRollbackImport,
- t.updated_time,
- t.assigned_batch
- </sql>
- <select id="findExerciseList" resultType="com.ssj.service.kmt.exercisesys.dto.Exercise1Dto" parameterType="java.util.Map">
- select
- <include refid="exercisePublic" />
- from kmt_exercise_book t
- where 1=1
- <!--未校对-->
- <if test='map.proofreadStatus == "0" '>
- and not exists (
- select 1 from kmt_exercise_book_status_count t1
- where t.id = t1.exercise_book_id
- and t1.data_status = 1
- and t1.status > 0
- and t1.status < 5
- )
- and t.status is not null
- and t.proofread_status = 0
- and t.answer_correcter_id is null
- and t.part_flag != 3
- </if>
- <if test="map.bookType != null and map.bookType != '' ">
- and t.book_type = ${map.bookType}
- </if>
- <if test="map.progress != null and map.progress != '' ">
- and t.progress = #{map.progress}
- </if>
- <if test="map.subject != null and map.subject != '' ">
- and t.course_name = #{map.subject}
- </if>
- <if test="map.grade != null and map.grade != '' ">
- and t.grade = #{map.grade}
- </if>
- <if test="map.bookName != null and map.bookName != '' ">
- and t.book_name like concat('%',#{map.bookName},'%')
- </if>
- <if test="map.semester != null and map.semester != '' and map.semester > 0 ">
- and t.semester = #{map.semester}
- </if>
- <if test="map.versionName != null and map.versionName != '' ">
- and t.version_name = #{map.versionName}
- </if>
- <if test="map.bookYear != null and map.bookYear != '' ">
- and t.book_year = #{map.bookYear}
- </if>
- order by t.updated_time desc,t.book_name
- </select>
- <select id="findTeacherExerciseList" resultType="com.ssj.service.kmt.exercisesys.dto.Exercise1Dto" parameterType="java.util.Map">
- select
- <include refid="exercisePublic" />
- ,t1.name teacherName, t1.user_id, t.create_time
- from kmt_exercise_book t
- left join tb_lib_manager t1 on t.answer_correcter_id = t1.user_id
- and t1.type = 17
- and t1.authority = 8
- and t1.state = 1
- where 1=1
- <if test="map.teacherName != null and map.teacherName != '' ">
- and t1.name regexp #{map.teacherName}
- </if>
- <if test="map.exerciseName != null and map.exerciseName != '' ">
- and t.book_name regexp #{map.exerciseName}
- </if>
- <if test="map.beginTime != null and map.beginTime != '' ">
- and t.check_time >= #{map.beginTime}
- </if>
- <if test="map.endTime != null and map.endTime != '' ">
- and t.check_time <= #{map.endTime}
- </if>
- <!--校对中-->
- <if test='map.type == "1" '>
- and t.part_flag != 3
- and t.answer_corrected_status = 0
- and t.answer_correcter_id is not null
- order by t1.name,t1.user_id,t.book_name
- </if>
- <!--已校对-->
- <if test='map.type == "2" '>
- and t.part_flag != 3
- and t.answer_corrected_status = 1
- order by t1.name,t1.user_id,t.book_name,t.create_time asc
- </if>
- </select>
- <select id="findLastExerciseRollbackByQuestionId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestionRollback">
- select * from kmt_exercise_question_rollback where question_id=#{questionId} order by create_time desc limit 1
- </select>
- <select id="findLibList" resultType="com.ssj.bean.weixin.libmy.domain.TbLibJoin" parameterType="java.util.Map">
- select t1.*
- from tb_lib_join t1
- where 1=1
- and t1.type = 1
- <if test="map.name != null and map.name != '' ">
- and t1.league_name regexp #{map.name}
- </if>
- and exists (
- select 1 from fx_merchant t2 where t1.id = t2.lib_id and t2.sign_service > 0
- )
- order by t1.league_name
- </select>
- <select id="findExerciseBookCount" resultType="com.ssj.service.kmt.exercisesys.dto.ExerciseBookCountDTO">
- select status,
- count(*) totalCount,
- sum(if(course_name = '语文', 1, 0)) chineseCount,
- sum(if(course_name = '数学', 1, 0)) mathCount,
- sum(if(course_name = '英语', 1, 0)) englishCount
- from kmt_exercise_book_status_count
- where data_status = 1
- group by status
- </select>
- <select id="findAllLib" resultType="java.util.Map">
- select t1.lib_id libId,t3.league_lat leagueLet,t3.league_lng leagueLng,t3.league_name leagueName, ifNull(t4.sign_service,0) signService
- from kmt_exercise_book_lib t1
- left join kmt_exercise_book t2 on t1.exercise_book_id =t2.id and t1.is_delete=0
- left join tb_lib_join t3 on t1.lib_id=t3.id
- left join fx_merchant t4 on t1.lib_id=t4.lib_id
- where t1.lib_id is not null and t1.lib_id !=''
- <if test="subject != null and subject != '' ">
- and t2.course_name=#{subject}
- </if>
- and t1.is_delete=0
- and t4.sign_service!=0
- and t4.sign_service is not null
- group by libId
- </select>
- <select id="findAllExerciseBook" resultType="com.ssj.service.kmt.dto.exercise.KmtExerciseBookLibDto">
- select distinct t1.book_id bookId, t1.book_name exerciseName,t1.version_name version,t1.total_grade_priority priority,t1.semester,t1.grade,t1.progress progress,t1.total_grade_priority totalPriority,t1.create_time createTime
- from kmt_exercise_book_lib t
- left join kmt_exercise_book t1 on t.exercise_book_id =t1.id
- where t.lib_id=#{libId}
- and t1.course_name=#{subject}
- and t.is_delete=0
- </select>
- <select id="findAllExportLib" resultType="java.util.Map">
- select distinct t1.exercise_book_id bookId, t1.lib_id libId,t3.league_lat leagueLet,t3.league_lng leagueLng,t3.league_name leagueName,ifNull(t4.sign_service,0)signService
- from kmt_exercise_book_lib t1
- left join kmt_exercise_book t2 on t1.exercise_book_id =t2.id
- left join tb_lib_join t3 on t1.lib_id=t3.id
- left join fx_merchant t4 on t1.lib_id=t4.lib_id
- where t1.lib_id is not null
- <if test="subject != null and subject != '' ">
- and t2.course_name=#{subject}
- </if>
- and t1.is_delete=0
- </select>
- <select id="findQuestionByParentId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion">
- select * from kmt_exercise_questions where (id in
- <foreach collection="parentIds" open="(" item="id" separator="," close=")">
- #{id}
- </foreach>or parent_id in
- <foreach collection="parentIds" open="(" item="id" separator="," close=")">
- #{id}
- </foreach>
- ) and deal_status != 6
- order by num
- limit 2000
- </select>
- <select id="findKmtExerciseQuestionRollbackListByQuestionId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestionRollback">
- select * from kmt_exercise_question_rollback where question_id= #{questionId} order by create_time desc
- </select>
- <select id="findByUserIdAndTypeIn" resultType="com.ssj.bean.weixin.libmy.domain.TbLibManager">
- select * from tb_lib_manager where user_id= #{userId}
- and type in(17,18) limit 1
- </select>
- <select id="findLibSignCount" resultType="com.ssj.service.kmt.exercisesys.dto.ExercisePriorityDto">
- select t1.id id,t1.exercise_book_id exerciseBookId,t1.lib_id libId,t2.sign_service signService from kmt_exercise_book_lib t1 left join fx_merchant t2
- on t1.lib_id=t2.lib_id
- where t1.exercise_book_id is not null
- and t1.is_delete=0
- limit 10000
- </select>
- <select id="findExerciseQuestionByExerciseBookId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion">
- select eq.id, eq.book_id, eq.unit_id, eq.book_course_id,
- eb.auditing_user_id, eb.handle_user_id, eb.analysis_user_id, eb.analysis_auditer_id, eb.answer_correcter_id,
- eq.question_type, eq.source, eq.big_question_index, eq.analysis_submit_time, eq.page_index,
- eq.image, eq.precision_percent, eq.create_time, eq.deal_status, eq.remark, eq.analysis_submit_type,
- eq.answer_image, eq.num, eq.small_question_name, eq.parent_id, eq.big_name, eq.real_exam_type, eq.publish_time,
- eq.update_type, eq.difficulty_level, eq.training_skill, eq.course_name, eq.is_common_flag, eq.question_year, eq.exercise_book_id, eq.es_loaded,
- eq.analysis_handler_submit_time, eq.question_class_type, eq.repulse_time, eq.handler_submit_time,
- eq.proofread_status, eq.question_path
- from kmt_exercise_questions eq
- left join kmt_exercise_book eb on eq.exercise_book_id=eb.id where eq.exercise_book_id=#{exerciseBookId} limit 10000
- </select>
- <select id="findExerciseQuestionByIds" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion">
- select eq.id, eq.book_id, eq.unit_id, eq.book_course_id,
- eb.auditing_user_id, eb.handle_user_id, eb.analysis_user_id, eb.analysis_auditer_id, eb.answer_correcter_id,
- eq.question_type, eq.source, eq.big_question_index, eq.analysis_submit_time, eq.page_index,
- eq.image, eq.precision_percent, eq.create_time, eq.deal_status, eq.remark, eq.analysis_submit_type,
- eq.answer_image, eq.num, eq.small_question_name, eq.parent_id, eq.big_name, eq.real_exam_type, eq.publish_time,
- eq.update_type, eq.difficulty_level, eq.training_skill, eq.course_name, eq.is_common_flag, eq.question_year, eq.exercise_book_id, eq.es_loaded,
- eq.analysis_handler_submit_time, eq.question_class_type, eq.repulse_time, eq.handler_submit_time,
- eq.proofread_status, eq.question_path
- from kmt_exercise_questions eq
- left join kmt_exercise_book eb on eq.exercise_book_id=eb.id where eq.id in
- <foreach collection="ids" open="(" item="id" separator="," close=")">
- #{id}
- </foreach>
- limit 10000
- </select>
- <!--更新练习册涉及到的机构签约数-->
- <update id="updateKmtExerciseBookByExerciseBookId">
- update kmt_exercise_book set exercise_relevancy_num=#{exerciseRelevancyNum} where id=#{exerciseBooId}
- </update>
- <select id="findAllExerciseBookBySignNum" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- select * from kmt_exercise_book
- where
- exercise_relevancy_num !=0
- and exercise_relevancy_num is not null
- order by exercise_relevancy_num desc
- limit 10000
- </select>
- <select id="findAnswerProofreadExerciseBookList"
- resultType="com.ssj.service.kmt.exercisesys.dto.AnswerProofreadExerciseBookDTO">
- select distinct t1.id exerciseBookId,
- t1.book_name,
- t1.course_name subject,
- t1.grade,
- t1.version,
- t1.semester,
- t1.proofread_status,
- t1.book_type,
- t1.latest_answer_wrong_date_time proofreadDate,
- t3.name
- from kmt_exercise_book t1 left join tb_lib_manager t3
- on t1.answer_correcter_id=t3.user_id
- and t3.type=17 and t3.authority=8 and t3.state=1
- where t1.proofread_status in (2, 3)
- <if test="req.subject != null and req.subject != ''">
- and t1.course_name = #{req.subject}
- </if>
- <if test="req.grade != null and req.grade != ''">
- and t1.grade = #{req.grade}
- </if>
- <if test="req.bookName != null and req.bookName != ''">
- and t1.book_name like concat('%',#{req.bookName},'%')
- </if>
- <if test="req.proofreadDate != null and req.proofreadDate != ''">
- and date(t1.latest_answer_wrong_date_time) = #{req.proofreadDate}
- </if>
- order by t1.proofread_status
- </select>
- <select id="findQuestionListAnswerWrong" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id, eq.course_name, eq.handle_user_id, eq.auditing_user_id, eq.analysis_user_id,
- eq.analysis_auditer_id, eq.book_course_id course_id, eq.big_question_index,
- eq.small_question_name small_question_index,
- eq.deal_status question_status, eq.create_time, eq.remark reason, eq.question_type question_types,
- eq.difficulty_level difficulty_levels, eq.real_exam_type real_exam_types,
- eq.training_skill training_skills, eq.parent_id, eq.question_path,eq.num
- from kmt_exercise_questions eq
- where eq.exercise_book_id = #{req.exerciseBookId}
- and eq.book_course_id = #{req.periodId}
- and eq.proofread_status = 2
- order by eq.num, eq.create_time
- </select>
- <select id="findRepulsedQuestion" resultType="com.ssj.service.kmt.dto.ExerciseQuetionDto">
- select eq.id question_id,
- eq.course_name,
- eb.handle_user_id,
- eb.auditing_user_id,
- eb.analysis_user_id,
- eb.analysis_auditer_id,
- eq.book_course_id course_id,
- eq.big_question_index,
- eq.small_question_name small_question_index,
- eq.deal_status question_status,
- eq.create_time,
- eq.remark reason,
- eq.from_user_id,
- eq.to_user_id,
- eq.question_type question_types,
- eq.difficulty_level difficulty_levels,
- eq.real_exam_type real_exam_types,
- eq.training_skill training_skills,
- eq.parent_id,
- eq.question_path,
- eq.num
- from kmt_exercise_questions eq
- left join kmt_exercise_book eb on eq.exercise_book_id=eb.id
- where eq.exercise_book_id = #{req.exerciseBookId}
- and eq.deal_status in
- <foreach collection="dealStatusList" open="(" item="dealStatus" separator="," close=")">
- #{dealStatus}
- </foreach>
- order by eq.num, eq.create_time, eq.deal_status
- limit 0, 5000
- </select>
- <update id="updateKmtExerciseBookById">
- update kmt_exercise_book set priority=#{priority} where id=#{id}
- </update>
- <update id="updateKmtExerciseBookByPriority">
- update kmt_exercise_book set total_grade_priority=#{totalGradePriority} where id=#{id}
- </update>
- <select id="findUnproofreadExerciseId" resultType="java.util.Map">
- select id from kmt_exercise_book eb where eb.answer_correcter_id is not null
- </select>
- <select id="findExerciseStatusByBookId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestion">
- select eq.* from kmt_exercise_questions eq left kmt_exercise_book eb on eq.exercise_book_id=eb.id where eb.answer_correcter_id is not null and eq.book_id=#{bookId}
- </select>
- <update id="updateExerciseBookStatusByIdAndStatus">
- update kmt_exercise_book set proofread_status=#{proofreadStatus} where id=#{id}
- </update>
- <update id="updateExerciseBookProofreadResult">
- update kmt_exercise_book set proofread_status=#{type}, latest_answer_wrong_date_time = now() where id=#{exerciseBookId}
- </update>
- <select id="countAnswerWrongQuestion" resultType="java.lang.Integer">
- select count(*) from kmt_exercise_questions where exercise_book_id = #{exerciseBookId} and proofread_status = 2 and deal_status not in (2, 6)
- and id not in
- <foreach collection="excludeQuestionIdSet" open="(" item="id" close=")" separator=",">
- #{id}
- </foreach>
- </select>
- <select id="teacherAnswerProofreadDetail" resultType="java.util.Map">
- select count(1) total,sum(answer_corrected_status) finishedNums
- from kmt_exercise_book
- where answer_correcter_id = #{userId}
- </select>
- <select id="findUnitAndPeriodList" resultType="com.ssj.service.kmt.dto.exercise.ExerciseUnitBookcourseDto">
- select ebc.unit_id id, ebc.unit name, ebc.id book_course_id, ebc.period book_course
- from kmt_exercise_book_course ebc
- where ebc.id in (select distinct book_course_id
- from kmt_exercise_questions
- where exercise_book_id = #{request.exerciseBookId} and proofread_status = 2)
- </select>
- <select id="findKmtExerciseQuestionErrorsByQuestionIds" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestionErrors">
- select * from kmt_exercise_question_errors where question_id in
- <foreach collection="questionIds" open="(" item="id" close=")" separator=",">
- #{id}
- </foreach>
- and error_user_auth=#{beType}
- </select>
- <select id="findKmtExerciseQuestionByErrorUserId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseQuestionErrors">
- select * from kmt_exercise_question_errors where error_user_id=#{userId} order by create_time desc
- </select>
- <select id="countQuestionErrorCountByExerciseBookId" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_question_errors where exercise_book_id=#{exerciseBookId}
- and error_user_id=#{userId} and error_user_auth=#{type}
- </select>
- <select id="findSameExerciseBookList" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- SELECT t.*
- FROM kmt_exercise_book t,
- (select book_name,
- course_name,
- grade,
- version_name,
- semester,
- book_type,
- book_year,
- COUNT(book_name) c1,
- COUNT(course_name) c2,
- COUNT(grade) c3,
- COUNT(version_name) c4,
- COUNT(semester) c5,
- COUNT(book_type) c6,
- COUNT(book_year) c7
- from kmt_exercise_book
- group by book_name, course_name, grade, version_name, semester, book_type, book_year
- HAVING c1 > 1
- and c2 > 1
- and c3 > 1
- and c4 > 1
- and c5 > 1
- and c6 > 1
- and c7 > 1) t1
- where t.book_name = t1.book_name
- and t.course_name = t1.course_name
- and t.grade = t1.grade
- and t.version_name = t1.version_name
- and t.semester = t1.semester
- and t.book_type = t1.book_type
- and t.book_year = t1.book_year
- order by t.book_name, t.course_name, t.grade, t.version_name, t.semester, t.book_type, t.book_year, t.part_flag
- </select>
- <select id="countUnFinishQuestionsByExerciseBookId" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_questions where exercise_book_id=#{exerciseBookId}
- <if test="type == 1">
- and deal_status in (0, 1)
- </if>
- <if test="type == 2">
- and deal_status in (3, 7)
- </if>
- <if test="type == 3">
- and deal_status in (5, 8)
- </if>
- <if test="type == 4">
- and deal_status in (9, 10)
- </if>
- </select>
- <select id="findDistributionCount"
- resultType="com.ssj.service.kmt.exercisesys.dto.ExerciseDistributionCountDTO">
- select sum(if(handle_user_id is null or auditing_user_id is null or analysis_user_id is null or
- analysis_auditer_id is null, 1, 0)) notDistributedExerciseBookCount,
- count(*) totalExerciseBookCount
- from kmt_exercise_book
- where part_flag <> 3
- </select>
- <select id="findDistributionExerciseBookList" resultMap="DistributionExerciseBookDTOResultMap">
- select eb.exerciseBookId,
- eb.importDate,
- eb.subject,
- eb.grade,
- eb.version_name,
- eb.semester,
- eb.book_name,
- eb.book_type,
- eb.assigned_batch,
- (select count(distinct unit_id)
- from kmt_exercise_book_course ebc
- where ebc.exercise_book_id = eb.exerciseBookId) unitNum,
- (select count(*)
- from kmt_exercise_book_course ebc
- where ebc.exercise_book_id = eb.exerciseBookId) courseNum,
- ebcHandle.accuracy intHandleAccuracy,
- ebcHandleAudit.accuracy intHandleAuditAccuracy,
- ebcAnalysis.accuracy intAnalysisAccuracy,
- ebtrHandle.teacher_id handlerTeacherId,
- ebtrHandle.teacher_name handlerName,
- ebtrHandle.salary_given handlerSalaryGiven,
- ebtrHandle.salary_given_time handlerSalaryGivenTime,
- ebtrHandle.create_time handlerDistributeTime,
- ebtrHandleAudit.teacher_id handlerAuditUserTeacherId,
- ebtrHandleAudit.teacher_name handlerAuditUserName,
- ebtrHandleAudit.salary_given handlerAuditUserSalaryGiven,
- ebtrHandleAudit.salary_given_time handlerAuditUserSalaryGivenTime,
- ebtrHandleAudit.create_time handlerAuditUserDistributeTime,
- ebtrAnalysis.teacher_id analyserTeacherId,
- ebtrAnalysis.teacher_name analyserName,
- ebtrAnalysis.salary_given analyserSalaryGiven,
- ebtrAnalysis.salary_given_time analyserSalaryGivenTime,
- ebtrAnalysis.create_time analyserDistributeTime,
- ebtrAnalysisAudit.teacher_id analysisAuditUserTeacherId,
- ebtrAnalysisAudit.teacher_name analysisAuditUserName,
- ebtrAnalysisAudit.salary_given analysisAuditUserSalaryGiven,
- ebtrAnalysisAudit.salary_given_time analysisAuditUserSalaryGivenTime,
- ebtrAnalysisAudit.create_time analysisAuditUserDistributeTime
- from (select id exerciseBookId,
- create_time importDate,
- course_name subject,
- grade,
- version_name,
- semester,
- book_name,
- book_type,
- handle_user_id,
- auditing_user_id,
- analysis_user_id,
- analysis_auditer_id,
- assigned_batch
- from kmt_exercise_book
- where (3 > part_flag or part_flag > 3)
- <if test="req.type == 1">
- and (
- <choose>
- <when test="(req.handler != null and req.handler > 0) or
- (req.handleAuditUser != null and req.handleAuditUser > 0) or
- (req.analyser != null and req.analyser > 0) or
- (req.analysisAuditUser != null and req.analysisAuditUser > 0)">
- <if test="req.handler != null and req.handler > 0">
- handle_user_id is null and
- </if>
- <if test="req.handleAuditUser != null and req.handleAuditUser > 0">
- auditing_user_id is null and
- </if>
- <if test="req.analyser != null and req.analyser > 0">
- analysis_user_id is null and
- </if>
- <if test="req.analysisAuditUser != null and req.analysisAuditUser > 0">
- analysis_auditer_id is null and
- </if>
- 1 = 1
- </when>
- <otherwise>
- handle_user_id is null
- or auditing_user_id is null
- or analysis_user_id is null
- or analysis_auditer_id is null
- </otherwise>
- </choose>
- )
- </if>
- <if test="req.type == 2">
- and (handle_user_id is not null
- and auditing_user_id is not null
- and analysis_user_id is not null
- and analysis_auditer_id is not null)
- </if>
- <if test="req.bookName != null and req.bookName != ''">
- and book_name like '%${req.bookName}%'
- </if>
- <if test="req.subject != null and req.subject != ''">
- and course_name = #{req.subject}
- </if>
- <if test="req.grade != null and req.grade != ''">
- and grade = #{req.grade}
- </if>
- <if test="req.version != null and req.version > 0">
- and version = #{req.version}
- </if>
- <if test="req.semester != null and req.semester > 0">
- and semester = #{req.semester}
- </if>
- <if test="req.bookType != null and req.bookType > -1">
- and book_type = #{req.bookType}
- </if>
- <if test="req.startTime != null and req.startTime != ''">
- and create_time > #{req.startTime}
- </if>
- <if test="req.endTime != null and req.endTime != ''">
- and '${req.endTime} 23:59:59' > create_time
- </if>
- order by create_time desc
- limit #{offset}, #{pageSize}) eb
- left join kmt_exercise_book_teacher_record ebtrHandle
- on eb.exerciseBookId = ebtrHandle.exercise_book_id and ebtrHandle.authority_type = 1
- left join kmt_exercise_book_count ebcHandle
- on eb.exerciseBookId = ebcHandle.exercise_book_id and ebcHandle.type = 1
- left join kmt_exercise_book_teacher_record ebtrHandleAudit
- on eb.exerciseBookId = ebtrHandleAudit.exercise_book_id and ebtrHandleAudit.authority_type = 2
- left join kmt_exercise_book_count ebcHandleAudit
- on eb.exerciseBookId = ebcHandleAudit.exercise_book_id and ebcHandleAudit.type = 2
- left join kmt_exercise_book_teacher_record ebtrAnalysis
- on eb.exerciseBookId = ebtrAnalysis.exercise_book_id and ebtrAnalysis.authority_type = 3
- left join kmt_exercise_book_count ebcAnalysis
- on eb.exerciseBookId = ebcAnalysis.exercise_book_id and ebcAnalysis.type = 3
- left join kmt_exercise_book_teacher_record ebtrAnalysisAudit
- on eb.exerciseBookId = ebtrAnalysisAudit.exercise_book_id and ebtrAnalysisAudit.authority_type = 4
- left join kmt_exercise_book_count ebcAnalysisAudit
- on eb.exerciseBookId = ebcAnalysisAudit.exercise_book_id and ebcAnalysisAudit.type = 4
- order by eb.importDate desc
- </select>
- <select id="countDistributionExerciseBook" resultType="java.lang.Integer">
- select count(*)
- from kmt_exercise_book
- where part_flag <> 3
- <if test="req.type == 1">
- and (
- <choose>
- <when test="(req.handler != null and req.handler > 0) or
- (req.handleAuditUser != null and req.handleAuditUser > 0) or
- (req.analyser != null and req.analyser > 0) or
- (req.analysisAuditUser != null and req.analysisAuditUser > 0)">
- <if test="req.handler != null and req.handler > 0">
- handle_user_id is null and
- </if>
- <if test="req.handleAuditUser != null and req.handleAuditUser > 0">
- auditing_user_id is null and
- </if>
- <if test="req.analyser != null and req.analyser > 0">
- analysis_user_id is null and
- </if>
- <if test="req.analysisAuditUser != null and req.analysisAuditUser > 0">
- analysis_auditer_id is null and
- </if>
- 1 = 1
- </when>
- <otherwise>
- handle_user_id is null
- or auditing_user_id is null
- or analysis_user_id is null
- or analysis_auditer_id is null
- </otherwise>
- </choose>
- )
- </if>
- <if test="req.type == 2">
- and (handle_user_id is not null
- and auditing_user_id is not null
- and analysis_user_id is not null
- and analysis_auditer_id is not null)
- </if>
- <if test="req.bookName != null and req.bookName != ''">
- and book_name like '%${req.bookName}%'
- </if>
- <if test="req.subject != null and req.subject != ''">
- and course_name = #{req.subject}
- </if>
- <if test="req.grade != null and req.grade != ''">
- and grade = #{req.grade}
- </if>
- <if test="req.version != null and req.version > 0">
- and version = #{req.version}
- </if>
- <if test="req.semester != null and req.semester > 0">
- and semester = #{req.semester}
- </if>
- <if test="req.bookType != null and req.bookType > -1">
- and book_type = #{req.bookType}
- </if>
- <if test="req.startTime != null and req.startTime != ''">
- and create_time > #{req.startTime}
- </if>
- <if test="req.endTime != null and req.endTime != ''">
- and '${req.endTime} 23:59:59' > create_time
- </if>
- </select>
- <update id="updateAnswerCorrecterIdByIds">
- update kmt_exercise_book set answer_correcter_id = #{teacherId}
- where id in
- <foreach collection="exerciseBookIds" open="(" item="exerciseBookId" separator="," close=")">
- #{exerciseBookId}
- </foreach>
- </update>
- <update id="updateAnswerCorrecterIdByExerciseBookIds">
- update kmt_exercise_questions set answer_correcter_id = #{teacherId}
- where exercise_book_id in
- <foreach collection="exerciseBookIds" open="(" item="exerciseBookId" separator="," close=")">
- #{exerciseBookId}
- </foreach>
- </update>
- <select id="findExportDistributionExerciseBookList" resultType="com.ssj.service.kmt.exercisesys.dto.ExportDistributionExerciseBookDTO">
- select ebdc.*, eb.assigned_batch
- from kmt_exercise_book_distribution_count ebdc join kmt_exercise_book eb on ebdc.exercise_book_id=eb.id
- <where>
- <if test="req.startTime != null and req.startTime != ''">
- and ebdc.import_date > #{req.startTime}
- </if>
- <if test="req.endTime != null and req.endTime != ''">
- and '${req.endTime} 23:59:59' > ebdc.import_date
- </if>
- </where>
- order by ebdc.import_date desc
- limit #{offset}
- </select>
- <select id="findDistributionTeacher"
- resultType="com.ssj.service.kmt.exercisesys.dto.DistributionTeacherDTO">
- select teacher_id,
- teacher_name,
- salary_given,
- salary_given_time
- <if test="authorityType == 1">
- , (select max(handler_submit_time)
- from kmt_exercise_questions eq
- where eq.exercise_book_id = #{exerciseBookId} and eq.deal_status > 0) lastSubmitTime
- </if>
- <if test="authorityType == 2">
- , (select max(publish_time)
- from kmt_exercise_questions eq
- where eq.exercise_book_id = #{exerciseBookId} and eq.deal_status > 3) lastSubmitTime
- </if>
- <if test="authorityType == 3">
- , (select max(analysis_handler_submit_time)
- from kmt_exercise_questions eq
- where eq.exercise_book_id = #{exerciseBookId} and eq.deal_status > 5) lastSubmitTime
- </if>
- <if test="authorityType == 4">
- , (select max(analysis_submit_time)
- from kmt_exercise_questions eq
- where eq.exercise_book_id = #{exerciseBookId} and eq.deal_status = 11) lastSubmitTime
- </if>
- from kmt_exercise_book_teacher_record
- where exercise_book_id = #{exerciseBookId}
- and teacher_id = #{userId}
- and authority_type = #{authorityType}
- order by create_time desc
- limit 1
- </select>
- <select id="findAllExerciseBookPage" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- select * from kmt_exercise_book
- where part_flag <> 3
- <if test="selectedExerciseBookIdList != null and selectedExerciseBookIdList.size > 0">
- and id in
- <foreach collection="selectedExerciseBookIdList" open="(" item="selectedExerciseBookId" separator="," close=")">
- #{selectedExerciseBookId}
- </foreach>
- </if>
- limit #{offset}, #{pageSize}
- </select>
- <select id="countNotCheckAnswerCount" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_questions where exercise_book_id=#{exerciseBookId}
- and deal_status != 2 and proofread_status = 0
- </select>
- <select id="countAllNotCheckAnswerCount" resultType="java.lang.Integer">
- select count(1) from kmt_exercise_questions where exercise_book_id=#{exerciseBookId}
- and proofread_status = 0
- </select>
- <select id="findExerciseBooksByBookId" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBook">
- select * from kmt_exercise_book where book_id=#{bookId}
- </select>
- <select id="findExerciseTeacherByExerciseBookIdsAndAuthType" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBookTeacherRecord">
- select * from kmt_exercise_book_teacher_record where exercise_book_id in
- <foreach collection="exerciseBookIds" open="(" item="id" separator="," close=")">
- #{id}
- </foreach>
- and authority_type = #{authType}
- </select>
- <select id="findBookCountByExerciseBookIdAndType" resultType="com.ssj.bean.kmt.kmt.domain.KmtExerciseBookCount">
- select * from kmt_exercise_book_count where exercise_book_id=#{exerciseBookId} and type=#{type} limit 1
- </select>
- <update id="updateKmtExerciseBookCountById">
- UPDATE kmt_exercise_book_count set accuracy=#{accuracy} WHERE id = #{bookCountId}
- </update>
- <select id="findAllDistinctLibBySubject" resultType="java.util.Map">
- SELECT DISTINCT lib_id FROM
- kmt_exercise_book_lib t
- LEFT JOIN kmt_exercise_book t1 ON t.exercise_book_id = t1.id
- WHERE
- t.is_delete = 0
- and t.lib_id is not null
- AND t1.course_name = #{subjct}
- </select>
- <select id="findSignService" resultType="com.ssj.bean.sys.fx.domain.Merchant">
- select * from fx_merchant where lib_id=#{libId} and sign_service is not null limit 1
- </select>
- <select id="findExerciseBookByQuestionId" resultType="com.ssj.service.kmt.dto.ExerciseBookDto">
- select eb.id exercise_book_id, eb.book_id id, eb.book_year, eb.book_name name, eb.grade, eb.course_name subject, eb.version version_type,
- eb.semester, eb.book_type,eb.ai_rollback_import aiRollbackImport
- from kmt_exercise_book eb, kmt_exercise_questions eq
- where eb.id=eq.exercise_book_id and eq.id=#{questionId} and eb.part_flag != 3
- </select>
- </mapper>
|