27 lines
728 B
Java
27 lines
728 B
Java
package com.designhub.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.designhub.entity.Notification;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
/**
|
|
* 通知消息Mapper接口
|
|
*/
|
|
@Mapper
|
|
public interface NotificationMapper extends BaseMapper<Notification> {
|
|
|
|
/**
|
|
* 批量标记为已读
|
|
*/
|
|
@Update("UPDATE notification SET is_read = 1, read_time = NOW() WHERE receiver_id = #{receiverId} AND is_read = 0 AND deleted = 0")
|
|
int markAllAsRead(@Param("receiverId") Long receiverId);
|
|
|
|
/**
|
|
* 获取未读数量
|
|
*/
|
|
long countUnread(@Param("receiverId") Long receiverId);
|
|
}
|
|
|