wang-hao-jie
2021-10-19 e48043a2df9ca0c73fe18298bab3c4d42ca5c0c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package cn.exrick.xboot.core.dao;
 
import cn.exrick.xboot.core.base.XbootBaseDao;
import cn.exrick.xboot.core.entity.MessageSend;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
 
/**
 * 消息发送数据处理层
 * @author Exrick
 */
public interface MessageSendDao extends XbootBaseDao<MessageSend, String> {
 
    /**
     * 通过消息id删除
     * @param messageId
     */
    @Modifying
    @Query("delete from MessageSend m where m.messageId = ?1")
    void deleteByMessageId(String messageId);
 
    /**
     * 批量更新消息状态
     * @param userId
     * @param status
     */
    @Modifying
    @Query("update MessageSend m set m.status=?2 where m.userId=?1")
    void updateStatusByUserId(String userId, Integer status);
 
    /**
     * 通过userId删除
     * @param userId
     * @param status
     */
    @Modifying
    @Query("delete from MessageSend m where m.userId = ?1 and m.status=?2")
    void deleteByUserId(String userId, Integer status);
}