<?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="cn.iocoder.yudao.module.knowledge.mapper.TQuestionAnswersMapper">

    <resultMap type="cn.iocoder.yudao.module.knowledge.entity.TQuestionAnswers" id="tQuestionAnswersMap">
        <result property="id" column="id"/>
        <result property="questionStemId" column="question_stem_id"/>
        <result property="content" column="content"/>
        <result property="fileUrl" column="file_url"/>
        <result property="options" column="options"/>
    </resultMap>


    <update id="deleteByQuestionStemId">
        update t_question_answers
        <set>
            deleted = 1,
        </set>
        where question_stem_id = #{aLong}
    </update>

    <select id="selectByQuestionStemId"
            parameterType="Long"
            resultType="cn.iocoder.yudao.module.knowledge.entity.TQuestionAnswers">
        SELECT
        *
        FROM
        t_question_answers
        <where>
            <if test="id != null ">and question_stem_id = #{id}</if>
        </where>
    </select>

</mapper>
