package com.lion.lionwebsite.Dao.normal;

import org.apache.ibatis.annotations.*;

import java.util.ArrayList;

@Mapper
public interface CollectMapper {
    @Insert("insert into collect (gid, collector) values (#{gid}, #{collector})")
    void collect(@Param("gid") int gid, @Param("collector") int collector);

    @Delete("delete from collect where collector=#{collector} and gid=#{gid}")
    void disCollect(@Param("gid") int gid, @Param("collector") int collector);

    @Select("select count(id) from collect where collector=#{collector} and gid=#{gid}")
    int isCollect(@Param("gid") int gid, @Param("collector") int collector);

    @Select("select gid from collect where collector=#{collector}")
    ArrayList<Integer> selectGidByCollector(int collector);

    @Select("select collector from collect where gid=#{gid}")
    ArrayList<Integer> selectCollectorByGid(int gid);
}
