龚焕茏
2024-07-16 65c6651f36f292674ad5f3966937dd22e5968326
src/main/resources/mapper/ExamPaperAnswerMapper.xml
@@ -657,5 +657,16 @@
    )
  </select>
  <select id="getTemplateOtherExamAnswer" resultType="com.mindskip.xzs.domain.ExamPaperAnswer">
    SELECT id, user_score FROM t_exam_paper_answer WHERE exam_paper_id IN
        (SELECT exam_paper_id FROM t_exam_templates_user_count WHERE user_id = #{createUser} AND exam_templates_id =
            (SELECT exam_templates_id FROM t_exam_templates_user_count WHERE exam_paper_id = #{examPaperId} LIMIT 1))
    HAVING MAX(user_score) ORDER BY create_time DESC LIMIT 1
  </select>
  <select id="getPaperOtherExamAnswer" resultType="com.mindskip.xzs.domain.ExamPaperAnswer">
    SELECT id, user_score FROM t_exam_paper_answer WHERE exam_paper_id = #{examPaperId} AND create_user = #{createUser}
    HAVING MAX(user_score) ORDER BY create_time DESC LIMIT 1
  </select>
</mapper>