<?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.imooc.mapper.FansMapperCustom" >
  
    <select id="queryMyFollows" resultType="com.imooc.vo.VlogerVO" parameterType="map">

        SELECT
            u.id as vlogerId,
            u.nickname as nickname,
            u.face as face,
            f.is_fan_friend_of_mine as bothFriend,
            f.created_time as createdTime
        FROM
            t_fans f
        LEFT JOIN
            t_users u
        ON
            f.vloger_id = u.id
        WHERE
            f.fan_id = #{paramMap.myId}
        ORDER BY
            f.created_time
        ASC

    </select>

  <select id="queryMyFans" resultType="com.imooc.vo.FansVO" parameterType="map">

        SELECT
            u.id as fanId,
            u.nickname as nickname,
            u.face as face,
            f.is_fan_friend_of_mine as bothFriend,
            f.created_time as createdTime
        FROM
            t_fans f
        LEFT JOIN
            t_users u
        ON
            f.fan_id = u.id
        WHERE
            f.vloger_id = #{paramMap.myId}
        ORDER BY
            u.nickname
        ASC

    </select>

</mapper>