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

import cn.reghao.jutil.jdk.db.BaseMapper;
import cn.reghao.tnb.user.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);
}
