浏览代码

获取聊天列表代码优化

fangqing 5 月之前
父节点
当前提交
8ace6257c8
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      ruoyi-system/src/main/resources/mapper/system/CommunityChatMsgMapper.xml

+ 12 - 0
ruoyi-system/src/main/resources/mapper/system/CommunityChatMsgMapper.xml

@@ -43,6 +43,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
               WHERE (sender_id = #{userId}
                   OR receiver_id = #{userId})
                 and type = #{type}
+                and (
+                          (
+                                      sender_id = #{userId} AND (
+                                  is_delete IS NULL OR is_delete !=  1
+                                  )
+                              )
+                          OR (
+                                      receiver_id = #{userId} AND (
+                                  receiver_is_delete IS NULL OR receiver_is_delete !=   1
+                                  )
+                              )
+                  )
               GROUP BY chat_user_id) latest
                  JOIN community_chat_msg r ON
             (