<?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.index_id + 1), ',', -1) tag
            from eb_store_product_reply r
            join (
                select 0 index_id union all
                select 1 index_id union all
                select 2 index_id union all
                select 3 index_id union all
                select 4 index_id union all
                select 5 index_id union all
                select 6 index_id union all
                select 7 index_id union all
                select 8 index_id union all
                select 9 index_id
            ) b on b.index_id <![CDATA[<]]> (length(r.review_tags) - length(replace(r.review_tags,',','')) + 1)
         	where r.product_id = #{id}
        ) t group by t.tag
    </select>

</mapper>
