package com.lion.lionwebsite.Dao;

import com.lion.lionwebsite.Domain.CRC32Cache;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CRC32CacheMapper {
    @Insert("insert into CRC32Cache (path, lastModifyTime, crc32) values (#{path}, #{lastModifyTime}, #{crc32})")
    void insertCache(CRC32Cache crc32Cache);

    @Select("select * from CRC32Cache where path=#{path}")
    CRC32Cache selectCache(String path);

    @Select("select * from CRC32Cache where path like '%' || #{name} || '%'")
    CRC32Cache selectCacheByName(String name);

//    @Update("update CRC32Cache set lastModifyTime=#{lastModifyTime}, crc32=#{crc32} where path=#{path}")
//    void updateCache(CRC32Cache crc32Cache);

    @Delete("delete from CRC32Cache where path=#{path}")
    void deleteCacheByPath(String path);

}
