package com.ytpm.dao;

import com.ytpm.middle.model.YtPlatformMessage;
import com.ytpm.middle.view.MessageRecordVO;
import com.ytpm.middle.view.MessageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

@Mapper
public interface MessageMapper {
    /**
     * 查询我的未读消息
     */
    List<MessageVO> getUnreadMessage(@Param("userId")String userId);

    /**
     * 标记消息已读
     */
    void markRead(@Param("messageId")String messageId, @Param("userId")String userId);

    /**
     * 查询消息信息
     */
    YtPlatformMessage queryMessage(@Param("messageId")String messageId);

    /**
     * 查询消息未被读取的记录
     */
    List<MessageRecordVO> queryUnreadRecord(@Param("messageId")String messageId, @Param("userId")String userId);

    void updateById(YtPlatformMessage msg);
}
