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.

32 lines
1.2 KiB

<?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.hc.business.mapper.QuestionAnswerMapper">
<resultMap type="questionAnswer" id="QuestionAnswerMap">
<result property="questionAnswerId" column="question_answer_id" jdbcType="INTEGER"/>
<result property="questionId" column="question_id" jdbcType="INTEGER"/>
<result property="questionAnswer" column="question_answer" jdbcType="VARCHAR"/>
<result property="isTrue" column="is_true" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
question_answer_id,
question_id,
question_answer,
is_true
</sql>
<select id="queryByQuestionId" resultMap="QuestionAnswerMap">
SELECT
<include refid="Base_Column_List"/>
FROM question_answer
WHERE question_id =#{questionId}
</select>
<select id="selectAnswerIdListByQuestionId" resultType="java.lang.Integer">
SELECT question_answer_id
FROM question_answer
WHERE question_id = #{questionId,jdbcType=INTEGER}
AND is_true = 1
</select>
</mapper>