<?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="org.springblade.modules.answerRecord.mapper.AnswerRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="answerRecordResultMap" type="org.springblade.modules.answerRecord.entity.AnswerRecordEntity">
|
</resultMap>
|
|
|
<select id="selectAnswerRecordPage" resultMap="answerRecordResultMap">
|
select * from jczz_answer_record where is_deleted = 0
|
</select>
|
|
<resultMap type="org.springblade.modules.answerRecord.dto.AnswerRecordDTO" id="AnswerRecordDTOResult">
|
<result property="id" column="id"/>
|
<result property="subjectChoicesId" column="subject_choices_id"/>
|
<result property="subjectChoicesType" column="subject_choices_type"/>
|
<result property="subjectOptionId" column="subject_option_id"/>
|
<result property="answerOption" column="answer_option"/>
|
<result property="answerScore" column="answer_score"/>
|
<result property="propertyId" column="property_id"/>
|
<result property="scoreId" column="score_id"/>
|
<result property="answer" column="answer"/>
|
<result property="createTime" column="create_time"/>
|
</resultMap>
|
|
<sql id="selectAnswerRecord">
|
select
|
id,
|
subject_choices_id,
|
subject_choices_type,
|
subject_option_id,
|
answer_option,
|
answer_score,
|
property_id,
|
score_id,
|
answer,
|
create_time
|
from
|
jczz_answer_record
|
</sql>
|
|
<select id="selectAnswerRecordById" parameterType="long" resultMap="AnswerRecordDTOResult">
|
<include refid="selectAnswerRecord"/>
|
where
|
id = #{id}
|
</select>
|
|
<select id="selectAnswerRecordList" parameterType="org.springblade.modules.answerRecord.dto.AnswerRecordDTO"
|
resultMap="AnswerRecordDTOResult">
|
<include refid="selectAnswerRecord"/>
|
<where>
|
<if test="id != null ">and id = #{id}</if>
|
<if test="subjectChoicesId != null ">and subject_choices_id = #{subjectChoicesId}</if>
|
<if test="subjectChoicesType != null ">and subject_choices_type = #{subjectChoicesType}</if>
|
<if test="subjectOptionId != null ">and subject_option_id = #{subjectOptionId}</if>
|
<if test="answerOption != null and answerOption != ''">and answer_option = #{answerOption}</if>
|
<if test="answerScore != null ">and answer_score = #{answerScore}</if>
|
<if test="propertyId != null ">and property_id = #{propertyId}</if>
|
<if test="scoreId != null ">and score_id = #{scoreId}</if>
|
<if test="answer != null ">and answer = #{answer}</if>
|
<if test="createTime != null ">and create_time = #{createTime}</if>
|
</where>
|
</select>
|
|
</mapper>
|