<?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="shop.alien.mapper.LifeFeedbackReplyMapper">

    <!-- 通用结果映射 -->
    <resultMap id="BaseResultMap" type="shop.alien.entity.store.LifeFeedbackReply">
        <id column="id" property="id" />
        <result column="feedback_id" property="feedbackId" />
        <result column="reply_type" property="replyType" />
        <result column="reply_content" property="replyContent" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <!-- 基础字段 -->
    <sql id="Base_Column_List">
        id, feedback_id, reply_type, reply_content, create_time, update_time
    </sql>

    <!-- 根据反馈ID查询回复列表 -->
    <select id="selectByFeedbackId" resultMap="BaseResultMap">
        SELECT 
            <include refid="Base_Column_List" />
        FROM life_feedback_reply
        WHERE feedback_id = #{feedbackId}
        ORDER BY create_time ASC
    </select>

</mapper>

