<?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.zbkj.service.dao.StoreProductReplyDao">

    <select id="getReviewTags" resultType="com.zbkj.common.vo.ReplyReviewTagsVo">
        select t.tag, count(1) num from (
            select
            substring_index(SUBSTRING_INDEX(r.review_tags, ',', b.help_topic_id + 1), ',', -1) tag
            from eb_store_product_reply r
            JOIN help_topic b ON b.help_topic_id <![CDATA[<]]> (length(r.review_tags) - length(replace(r.review_tags,',','')) + 1)
            where r.product_id = #{id}
        ) t GROUP BY t.tag
    </select>

</mapper>
