63 lines
2.8 KiB
XML
63 lines
2.8 KiB
XML
<?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.example.exam.exam.mapper.ExamQuestionAnswerMapper">
|
|
|
|
<resultMap type="ExamQuestionAnswer" id="ExamQuestionAnswerResult">
|
|
<result property="answerId" column="answer_id" />
|
|
<result property="quId" column="qu_id" />
|
|
<result property="isRight" column="is_right" />
|
|
<result property="image" column="image" />
|
|
<result property="content" column="content" />
|
|
<result property="contentIn" column="contentIn" />
|
|
<result property="scoreRate" column="score_rate" />
|
|
<result property="attribute" column="attribute" />
|
|
<result property="sort" column="sort" />
|
|
</resultMap>
|
|
<resultMap type="ExamPsKeyword" id="ExamPsKeywordResult">
|
|
<id property="id" column="id" jdbcType="VARCHAR"/>
|
|
<result property="quId" column="qu_id" jdbcType="VARCHAR"/>
|
|
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
|
|
<result property="key" column="key_name" jdbcType="VARCHAR"/>
|
|
<result property="value" column="key_value" jdbcType="VARCHAR"/>
|
|
<result property="rate" column="rate" jdbcType="VARCHAR"/>
|
|
<result property="type" column="type" jdbcType="VARCHAR"/>
|
|
<result property="sort" column="sort" jdbcType="VARCHAR"/>
|
|
|
|
</resultMap>
|
|
<sql id="selectExamQuestionAnswerVo">
|
|
select answer_id, qu_id, is_right, image, content,contentIn, score_rate,attribute,sort from exam_question_answer
|
|
</sql>
|
|
|
|
<select id="selectExamQuestionAnswerByQuId" resultMap="ExamQuestionAnswerResult">
|
|
<include refid="selectExamQuestionAnswerVo"/>
|
|
<where>
|
|
<if test="quId != null "> and qu_id = #{quId}</if>
|
|
</where>
|
|
ORDER BY sort ASC
|
|
</select>
|
|
|
|
|
|
<select id="selectAnswerFile" resultType="java.lang.String">
|
|
select url from exam_question_file where qu_id =#{quId} and file_type ='2'
|
|
</select>
|
|
|
|
|
|
<select id="selectCountPointByQuId" resultType="java.lang.String">
|
|
SELECT SUM(score_rate) AS totalKeyScore
|
|
FROM exam_question_answer
|
|
WHERE qu_id =#{quId};
|
|
</select>
|
|
|
|
|
|
<select id="selectExamQuestionAnswerScoreByAnswerId" resultType="java.lang.String">
|
|
select score_rate from exam_question_answer where answer_id =#{answerId}
|
|
</select>
|
|
<select id="selectPsAnswerById" resultMap="ExamPsKeywordResult">
|
|
select id,qu_id,parent_id,key_name,key_value,rate,type from exam_ps_keyword where qu_id=#{quId}
|
|
and type='1'
|
|
order by sort asc
|
|
|
|
</select>
|
|
</mapper> |