<?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.ruoyi.web.modules.home.mapper.MemberShopFollowAppMapper">

    <select id="selectFollowShopList" resultType="com.ruoyi.web.modules.home.vo.MemberShopFollowItemVO">
        select f.shop_id as shopId,
               f.create_time as followTime,
               s.shop_name as shopName,
               s.shop_avatar as shopAvatar,
               s.shop_status as shopStatus,
               st.rating as rating,
               ifnull(st.fans_count, 0) as fansCount
        from biz_member_shop_follow f
        inner join biz_shop s on f.shop_id = s.shop_id and s.del_flag = '0'
        left join biz_shop_stats st on s.shop_id = st.shop_id
        where f.member_id = #{memberId}
        order by f.create_time desc, f.follow_id desc
    </select>

</mapper>
