|
@@ -538,7 +538,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -561,7 +568,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -580,7 +594,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -590,7 +611,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -599,7 +627,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -608,7 +643,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -628,7 +670,14 @@
|
|
|
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 != ''">
|
|
|
- and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="searchType == 1">
|
|
|
+ and eb.book_name = #{bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.book_name like concat('%',#{bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -638,24 +687,49 @@
|
|
|
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}
|
|
|
- <if test = "dealType == 1">
|
|
|
- and eq.deal_status in (0, 1) and eb.handle_user_id=#{userId}
|
|
|
- </if>
|
|
|
- <if test = "dealType == 2">
|
|
|
- and eq.deal_status in (3, 7) and eb.auditing_user_id=#{userId}
|
|
|
- </if>
|
|
|
- <if test = "dealType == 4">
|
|
|
- and eq.deal_status in (5, 8) and eb.analysis_user_id=#{userId}
|
|
|
- </if>
|
|
|
- <if test = "dealType == 5">
|
|
|
- and eq.deal_status in (9, 10) and eb.analysis_auditer_id=#{userId}
|
|
|
- </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>
|
|
|
+ <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
|
|
|
|
|
@@ -1159,7 +1233,14 @@
|
|
|
and t.grade = #{map.grade}
|
|
|
</if>
|
|
|
<if test="map.bookName != null and map.bookName != '' ">
|
|
|
- and t.book_name like concat('%',#{map.bookName},'%')
|
|
|
+ <choose>
|
|
|
+ <when test="map.searchType == 1">
|
|
|
+ and t.book_name = #{map.bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t.book_name like concat('%',#{map.bookName},'%')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
<if test="map.semester != null and map.semester != '' and map.semester > 0 ">
|
|
|
and t.semester = #{map.semester}
|
|
@@ -1170,6 +1251,9 @@
|
|
|
<if test="map.bookYear != null and map.bookYear != '' ">
|
|
|
and t.book_year = #{map.bookYear}
|
|
|
</if>
|
|
|
+ <if test="map.assignedBatch != null and map.assignedBatch != '' ">
|
|
|
+ and t.assigned_batch = like concat('%',#{map.assignedBatch},'%')
|
|
|
+ </if>
|
|
|
order by t.updated_time desc,t.book_name
|
|
|
</select>
|
|
|
|
|
@@ -1649,7 +1733,14 @@
|
|
|
and analysis_auditer_id is not null)
|
|
|
</if>
|
|
|
<if test="req.bookName != null and req.bookName != ''">
|
|
|
- and book_name like '%${req.bookName}%'
|
|
|
+ <choose>
|
|
|
+ <when test="req.searchType == 1">
|
|
|
+ and book_name = #{req.bookName}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and book_name like '%${req.bookName}%'
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
<if test="req.subject != null and req.subject != ''">
|
|
|
and course_name = #{req.subject}
|
|
@@ -1672,6 +1763,9 @@
|
|
|
<if test="req.endTime != null and req.endTime != ''">
|
|
|
and '${req.endTime} 23:59:59' > create_time
|
|
|
</if>
|
|
|
+ <if test="req.assignedBatch != null and req.assignedBatch != ''">
|
|
|
+ and assigned_batch like '%${req.assignedBatch}%'
|
|
|
+ </if>
|
|
|
order by create_time desc
|
|
|
limit #{offset}, #{pageSize}) eb
|
|
|
left join kmt_exercise_book_teacher_record ebtrHandle
|
|
@@ -1880,4 +1974,26 @@
|
|
|
<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>
|
|
|
+ <select id="findExerciseBookCourseByQuestionId" 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
|
|
|
+ where eq.id=#{questionId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findExerciseQuestionByQuestionId" 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.id=#{questionId}
|
|
|
+ </select>
|
|
|
</mapper>
|