feat:添加判断

pg_adapter
wangxy 9 months ago
parent a7551a80dc
commit 2a045a24a9

@ -26,6 +26,10 @@ public interface ElPaperQuAnswerMapper extends BaseMapper<ElPaperQuAnswer> {
*/ */
List<PaperQuAnswerExtDTO> list(@Param("paperId") String paperId, @Param("quId") String quId); List<PaperQuAnswerExtDTO> list(@Param("paperId") String paperId, @Param("quId") String quId);
} }

@ -36,4 +36,17 @@
ORDER BY pa.sort ASC ORDER BY pa.sort ASC
</select> </select>
<select id="listForShow" resultMap="ListResultMap">
SELECT pa.id,pa.paper_id,pa.answer_id,pa.qu_id,pa.checked,pa.sort,pa.abc,qa.content,qa.is_right,qa.image
FROM el_paper_qu_answer pa
LEFT JOIN el_qu_answer qa ON pa.answer_id=qa.id
WHERE pa.paper_id=#{paperId} AND pa.qu_id=#{quId}
ORDER BY pa.sort ASC
</select>
</mapper> </mapper>

@ -33,7 +33,17 @@
AND is_right=true AND is_right=true
AND qu_type &lt; 4 AND qu_type &lt; 4
</select> </select>
<select id="listForPaperResult" resultType="com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO">
<resultMap id="ListResultMap" extends="BaseResultMap" type="com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO">
<result column="image" property="image" />
<result column="content" property="content" />
<collection property="answerList" column="{paperId=paper_id,quId=qu_id}"
select="com.ruoyi.system.mapper.ElPaperQuAnswerMapper.listForShow" />
</resultMap>
<select id="listForPaperResult" resultMap="ListResultMap">
SELECT pq.*,eq.content,eq.image SELECT pq.*,eq.content,eq.image
FROM el_paper_qu pq FROM el_paper_qu pq
LEFT JOIN el_qu eq ON pq.qu_id = eq.id LEFT JOIN el_qu eq ON pq.qu_id = eq.id

Loading…
Cancel
Save