<!-- VoteRecordMapper.xml -->
<mapper namespace="com.ruoyi.novel.mapper.VoteRecordMapper">

    <resultMap id="VoteRecordResult" type="VoteRecord">
        <id property="id" column="id" />
        <result property="userId" column="user_id" />
        <result property="storyId" column="story_id" />
        <result property="optionId" column="option_id" />
        <result property="voteTime" column="vote_time" />
        <result property="generatedContent" column="generated_content"
                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
        <result property="notifyStatus" column="notify_status" />
    </resultMap>

    <update id="incrementOptionVote">
        UPDATE novel_story_option
        SET vote_count = vote_count + 1
        WHERE id = #{optionId}
    </update>
</mapper>