<?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.wzj.soopin.member.mapper.FansMapper" >




  <select id="getFollowedVlogerIds" resultType="com.wzj.soopin.member.domain.po.Fans" parameterType="map">

    SELECT vloger_id, is_fan_friend_of_mine FROM t_fans
    WHERE fan_id = #{currentUserId}
    AND vloger_id IN
    <foreach collection='vlogerIds' item='vlogerId' open='(' separator=',' close=')'>
    #{vlogerId}
    </foreach>

  </select>

  <!-- 根据vlogerId统计粉丝数量 -->
  <select id="countFansByVlogerId" resultType="java.lang.Integer">
    SELECT COUNT(*) FROM t_fans
    WHERE vloger_id = #{vlogerId}
  </select>

</mapper>
