package cn.reghao.tnb.message.app.db.mapper;

import cn.reghao.jutil.jdk.web.db.BaseMapper;
import cn.reghao.tnb.message.app.model.po.UserMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author reghao
 * @date 2024-03-28 22:12:42
 */
@Mapper
public interface UserMessageMapper extends BaseMapper<UserMessage> {
    void updateSetRead(@Param("messageId") long messageId);

    int countByUnread(long userId);
    UserMessage findByMessageId(long messageId);
    List<UserMessage> findByUnread(long userId);
}
