package com.microservices.pms.document.mapper;

import com.microservices.pms.document.domain.PmsDocumentUserFavorite;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户收藏文档Mapper接口
 * 
 * @author 万佳
 * @date 2024-01-17
 */
@Mapper
public interface PmsDocumentUserFavoriteMapper 
{
    /**
     * 查询用户收藏文档列表
     * 
     * @param pmsDocumentUserFavorite 用户收藏文档
     * @return 用户收藏文档集合
     */
    public List<PmsDocumentUserFavorite> selectPmsDocumentUserFavoriteList(PmsDocumentUserFavorite pmsDocumentUserFavorite);

    /**
     * 新增用户收藏文档
     * 
     * @param pmsDocumentUserFavorite 用户收藏文档
     * @return 结果
     */
    public int insertPmsDocumentUserFavorite(PmsDocumentUserFavorite pmsDocumentUserFavorite);

    int deletePmsDocumentUserFavoriteByDocId(@Param("userId") Long userId, @Param("documentId") Long documentId);

    Boolean isDocumentInFavorites(@Param("userId") Long userId, @Param("documentId") Long documentId);
}
