package com.lion.lionwebsite.Dao.cache;

import com.lion.lionwebsite.Domain.GidToKey;
import com.lion.lionwebsite.Domain.ImageKeyCache;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ImageCacheMapper {
    @Insert("insert into ImageKeyCache values (#{gid}, #{imgkey}, #{page})")
    void insertImageKeyCache(ImageKeyCache imageKeyCache);

    @Insert("insert into gidToKey values (#{gid}, #{key}, #{pages})")
    void insertGidToKey(GidToKey gidToKey);

    @Select("select * from ImageKeyCache where gid=#{gid} and page=#{page}")
    ImageKeyCache selectImageKeyCacheByGidAndPage(@Param("gid") String gid, @Param("page") int page);

    @Select("select * from gidToKey where gid=#{gid}")
    GidToKey selectKeyByGid(String gid);

}
