package org.jeecg.modules.oroqen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.oroqen.entity.OroqenUserFavorite;

import java.util.List;

/**
 * @Description: 用户收藏
 * @Author: jeecg-boot
 * @Date: 2025-01-08
 * @Version: V1.0
 */
public interface OroqenUserFavoriteMapper extends BaseMapper<OroqenUserFavorite> {

    /**
     * 根据用户ID查询收藏
     */
    List<OroqenUserFavorite> selectByUserId(@Param("userId") String userId);

    /**
     * 根据用户ID和收藏类型查询收藏
     */
    List<OroqenUserFavorite> selectByUserIdAndType(@Param("userId") String userId, @Param("favoriteType") Integer favoriteType);

    /**
     * 检查是否已收藏
     */
    OroqenUserFavorite selectByUserIdAndTarget(@Param("userId") String userId, @Param("favoriteType") Integer favoriteType, @Param("targetId") String targetId);
}