You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?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.ruoyi.system.mapper.ElPaperQuMapper">
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.paper.ElPaperQu">
|
|
|
|
<id column="id" property="id" />
|
|
|
|
<result column="paper_id" property="paperId" />
|
|
|
|
<result column="qu_id" property="quId" />
|
|
|
|
<result column="qu_type" property="quType" />
|
|
|
|
<result column="answered" property="answered" />
|
|
|
|
<result column="answer" property="answer" />
|
|
|
|
<result column="sort" property="sort" />
|
|
|
|
<result column="score" property="score" />
|
|
|
|
<result column="actual_score" property="actualScore" />
|
|
|
|
<result column="is_right" property="isRight" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id,paper_id,qu_id,
|
|
|
|
qu_type,answered,answer,
|
|
|
|
sort,score,actual_score,
|
|
|
|
is_right
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 计算总分 -->
|
|
|
|
<select id="sumObjective" resultType="int">
|
|
|
|
SELECT IFNULL(SUM(actual_score),0) as total
|
|
|
|
FROM el_paper_qu
|
|
|
|
WHERE paper_id=#{paperId}
|
|
|
|
AND is_right=true
|
|
|
|
AND qu_type < 4
|
|
|
|
</select>
|
|
|
|
<select id="listForPaperResult" resultType="com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO">
|
|
|
|
SELECT pq.*,eq.content,eq.image
|
|
|
|
FROM el_paper_qu pq
|
|
|
|
LEFT JOIN el_qu eq ON pq.qu_id = eq.id
|
|
|
|
WHERE pq.paper_id=#{paperId}
|
|
|
|
ORDER BY pq.sort ASC
|
|
|
|
</select>
|
|
|
|
</mapper>
|