|
@@ -2037,19 +2037,35 @@
|
|
|
|
|
|
<select id="findEditExerciseBooks" resultType="com.ssj.service.kmt.dto.exercise.ExerciseBookEditDto">
|
|
|
select distinct eb.id exercise_book_id, eb.book_name exercise_book_name from kmt_exercise_question_rollback rb, kmt_exercise_questions eq, kmt_exercise_book eb
|
|
|
- where rb.question_id=eq.id and eq.exercise_book_id=eb.id and rb.type=2 and eb.grade=#{request.grade}
|
|
|
- and eb.course_name=#{request.subject}
|
|
|
- and eb.version=#{request.versionType} and eb.semester=#{request.semester}
|
|
|
- <if test="request.bookName != null and request.bookName != ''">
|
|
|
- and eb.book_name like concat('%',#{request.bookName},'%')
|
|
|
- </if>
|
|
|
+ where rb.question_id=eq.id and eq.exercise_book_id=eb.id and rb.type=2
|
|
|
+ <choose>
|
|
|
+ <when test="request.questionId != null and request.questionId != ''">
|
|
|
+ and eq.id=#{request.questionId}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.grade=#{request.grade}
|
|
|
+ and eb.course_name=#{request.subject}
|
|
|
+ and eb.version=#{request.versionType} and eb.semester=#{request.semester}
|
|
|
+ <if test="request.bookName != null and request.bookName != ''">
|
|
|
+ and eb.book_name like concat('%',#{request.bookName},'%')
|
|
|
+ </if>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</select>
|
|
|
|
|
|
<select id="findEditExerciseQuestions" resultType="com.ssj.service.kmt.dto.exercise.ExerciseQuestionEditDto">
|
|
|
select eq.id question_id, eb.book_name exercise_book_name, eb.course_name, eb.grade, eb.version, eb.semester,
|
|
|
eq.deal_status, eb.book_type type, rb.create_time, rb.user_id from kmt_exercise_question_rollback rb,
|
|
|
kmt_exercise_questions eq, kmt_exercise_book eb
|
|
|
- where rb.question_id=eq.id and eq.exercise_book_id=eb.id and rb.type=2 and eb.id=#{exerciseBookId}
|
|
|
+ where rb.question_id=eq.id and eq.exercise_book_id=eb.id and rb.type=2
|
|
|
+ <choose>
|
|
|
+ <when test="request.questionId != null and request.questionId != ''">
|
|
|
+ and eq.id=#{request.getQuestionId}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and eb.id=#{request.exerciseBookId}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
order by rb.create_time desc
|
|
|
</select>
|
|
|
</mapper>
|