package com.imooc.mapper;

import com.imooc.my.mapper.MyMapper;
import com.imooc.pojo.Fans;
import com.imooc.vo.FansVO;
import com.imooc.vo.VlogerVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.Set;

//@Repository
//public interface FansMapper extends MyMapper<Fans> {
//    int updateByPrimaryKeySelective(Fans record);
//
//
//    @Select("<script> " +
//            "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> " +
//            "</script>")
//    List<Map<String, Object>> getFollowedVlogerIds(@Param("currentUserId")String currentUserId,@Param("vlogerIds")List<String> vlogerIds);
////    Set<String> getFollowedVlogerIds(
////            @Param("currentUserId") String currentUserId,
////            @Param("vlogerIds") List<String> vlogerIds
////    );
//
//}

@Repository
public interface FansMapper {
    int updateByPrimaryKeySelective(Fans record);
    public List<Map<String, Object>> getFollowedVlogerIds(@Param("currentUserId")String currentUserId,@Param("vlogerIds")List<String> vlogerIds);

    int insert(@Param("fansData") Map<String, Object> vlogData);

    public List<VlogerVO> selectByExample(@Param("paramMap") Map<String, Object> map);

    int delete(@Param("id") String id);
}