|
@@ -432,7 +432,28 @@
|
|
|
WHERE er.id_ = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getRegistration" resultMap="ExamRegistration">
|
|
|
- SELECT * FROM exam_registration WHERE examination_basic_id_ = #{examId} AND student_id_ =#{studentId} AND subject_id_=#{subjectId} AND level_ = #{level} LIMIT 1
|
|
|
- </select>
|
|
|
+ <select id="getRegistration" resultMap="ExamRegistration">
|
|
|
+ SELECT * FROM exam_registration
|
|
|
+ <where>
|
|
|
+ <if test="examId != null">
|
|
|
+ AND examination_basic_id_ = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ AND student_id_ =#{studentId}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND subject_id_=#{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="level != null">
|
|
|
+ AND level_ = #{level}
|
|
|
+ </if>
|
|
|
+ <if test="statusEnumList != null">
|
|
|
+ AND status_ IN
|
|
|
+ <foreach collection="statusEnumList" item="status" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
</mapper>
|