<?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.mall.product.mapper.CommentReplayMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.product.domain.entity.CommentReplayEntity">
        <id column="id" property="id"/>
        <id column="comment_id" property="commentId"/>
        <id column="reply_id" property="replyId"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,comment_id,reply_id
    </sql>

    <!-- 分页查询商品评价回复关系内容 -->
    <select id="selectListByPage" resultType="com.mall.product.domain.vo.CommentReplayVo">
        select
        <include refid="Base_Column_List"/>
        from pms_comment_replay
        <where>
            <if test="dto.id != null and dto.id != ''">
                and id like CONCAT('%',#{dto.id},'%')
            </if>
            <if test="dto.commentId != null and dto.commentId != ''">
                and comment_id like CONCAT('%',#{dto.commentId},'%')
            </if>
            <if test="dto.replyId != null and dto.replyId != ''">
                and reply_id like CONCAT('%',#{dto.replyId},'%')
            </if>
        </where>
    </select>

</mapper>
