u
This commit is contained in:
1 parent
a6dbe24dd4
commit
52b16ed2b0
21 files changed
+444
-107
No files matched your search
+12
-3
@@ -9,13 +9,11 @@
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT
|
||||
f.b_id AS id,
|
||||
f.b_friend_id AS friendId,
|
||||
u.b_name AS friendName,
|
||||
u.b_avatar AS friendAvatar,
|
||||
f.b_unread_count AS unreadCount,
|
||||
m.b_id AS lastMessageId,
|
||||
m.b_send_time AS lastMessageTime,
|
||||
m.b_send_time AS lastMessageTime,
|
||||
m.b_type AS lastMessageType,
|
||||
m.b_content AS lastMessageContent,
|
||||
ROW_NUMBER() OVER (
|
||||
@@ -63,4 +61,15 @@
|
||||
WHERE b_user_id = #{userId} and b_friend_id = #{friendId}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectFriendProfile" resultType="cn.link56.im.model.vo.FriendProfileVO">
|
||||
SELECT
|
||||
f.b_friend_id AS friendId,
|
||||
u.b_name AS friendName,
|
||||
u.b_avatar AS friendAvatar,
|
||||
f.b_unread_count AS unreadCount
|
||||
FROM b_im_friend f
|
||||
INNER JOIN b_company_user u ON f.b_friend_id = u.b_id
|
||||
WHERE f.b_user_id = #{userId} AND f.b_friend_id = #{friendId}
|
||||
</select>
|
||||
</mapper>
|
||||
+15
-3
@@ -14,12 +14,10 @@
|
||||
g.b_avatar AS groupAvatar,
|
||||
gu.b_unread_count AS unreadCount,
|
||||
|
||||
m.b_id AS lastMessageId,
|
||||
m.b_send_time AS lastMessageTime,
|
||||
m.b_type AS lastMessageType,
|
||||
m.b_content AS lastMessageContent,
|
||||
|
||||
u.b_id AS lastMessageSenderId,
|
||||
u.b_name AS lastMessageSenderName,
|
||||
|
||||
ROW_NUMBER() OVER (
|
||||
@@ -29,7 +27,7 @@
|
||||
) AS rn
|
||||
FROM b_im_group g
|
||||
INNER JOIN b_im_group_user gu ON g.b_id = gu.b_group_id
|
||||
LEFT JOIN b_im_group_message m ON gu.b_last_message_id = m.b_id
|
||||
LEFT JOIN b_im_group_message m ON g.b_last_message_id = m.b_id
|
||||
LEFT JOIN b_company_user u ON m.b_sender_id = u.b_id
|
||||
WHERE gu.b_user_id = #{userId}
|
||||
<if test="name != null and name != ''">
|
||||
@@ -51,4 +49,18 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectGroupProfile"
|
||||
resultType="cn.link56.im.model.vo.GroupProfileVO">
|
||||
SELECT
|
||||
g.b_id AS groupId,
|
||||
g.b_name AS groupName,
|
||||
g.b_avatar AS groupAvatar,
|
||||
gu.b_unread_count AS unreadCount
|
||||
FROM b_im_group g
|
||||
INNER JOIN b_im_group_user gu ON g.b_id = gu.b_group_id
|
||||
WHERE gu.b_user_id = #{userId}
|
||||
AND g.b_id = #{groupId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user