package com.org.oss.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.org.oss.entity.SysOss;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysOssMapper extends BaseMapper<SysOss> {

    @Select("SELECT * FROM sys_oss WHERE url = #{fileUrl}")
    SysOss findByUrl(@Param("fileUrl") String fileUrl);

    @Select("SELECT * FROM sys_oss WHERE real_path = #{realPath}")
    SysOss findByRealPath(@Param("realPath") String realPath);

    @Select("select * from sys_oss where real_path like concat('%', #{suffix})")
    List<SysOss> findByRealPathSuffix(@Param("suffix") String suffix);
}
