35 lines
1.2 KiB
XML
35 lines
1.2 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.ExamMysqlKeywordMapper">
|
|
|
|
<resultMap type="ExamMysqlKeyword" id="ExamMysqlKeywordResult">
|
|
<result property="keywordId" column="keyword_id" />
|
|
<result property="answerId" column="answer_id" />
|
|
<result property="keyword" column="keyword" />
|
|
<result property="scoreRate" column="score_rate" />
|
|
</resultMap>
|
|
|
|
<sql id="selectExamMysqlKeywordVo">
|
|
select keyword_id, answer_id, keyword, score_rate from exam_mysql_keyword
|
|
</sql>
|
|
<select id="selectListByAnswerId" resultMap="ExamMysqlKeywordResult">
|
|
|
|
<include refid="selectExamMysqlKeywordVo"/>
|
|
where answer_id =#{answerId}
|
|
</select>
|
|
<select id="selectByAnswerIds" resultType="java.lang.String" parameterType="java.util.List">
|
|
SELECT CAST(SUM(CAST(score_rate AS UNSIGNED)) AS CHAR)
|
|
FROM exam_mysql_keyword
|
|
WHERE answer_id IN
|
|
<foreach collection="list" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |