<?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.ZccmQuestionAnswerMapper">

    <resultMap type="zccmquestionAnswer" 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 zccm_question_answer
        WHERE question_id =#{questionId}
    </select>

    <select id="selectAnswerIdListByQuestionId" resultType="java.lang.Integer">
        SELECT question_answer_id
        FROM zccm_question_answer
        WHERE question_id = #{questionId,jdbcType=INTEGER}
        AND is_true = 1
    </select>
</mapper>