查询聊天记录最后一条
This commit is contained in:
parent
b15914f219
commit
13e75b5b5e
@ -60,16 +60,35 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectChatList" resultType="com.dd.admin.business.chat.domain.ChatVo"
|
<select id="selectChatList" resultType="com.dd.admin.business.chat.domain.ChatVo"
|
||||||
parameterType="java.lang.String">
|
parameterType="java.lang.String">
|
||||||
SELECT
|
SELECT
|
||||||
*, b.AVATAR_URL AS fromAvatar
|
c.*
|
||||||
FROM
|
FROM
|
||||||
business_chat a
|
(
|
||||||
LEFT JOIN business_author b ON a.FROM_ID = b.AUTHOR_ID
|
SELECT
|
||||||
WHERE
|
DISTINCT a.FROM_ID,
|
||||||
a.TO_ID = #{toId}
|
a.CHAT_ID,
|
||||||
GROUP BY
|
a.FROM_NAME,
|
||||||
a.TO_ID = #{toId}
|
a.TO_ID,
|
||||||
ORDER BY
|
a.TO_NAME,
|
||||||
a.create_time DESC
|
a.MESSAGE_TYPE,
|
||||||
|
a.MESSAGE_STATUS,
|
||||||
|
a.CONTENT,
|
||||||
|
a.RESOURCE_URL,
|
||||||
|
a.DELETED,
|
||||||
|
a.CREATE_TIME,
|
||||||
|
a.IP_ADDRESS,
|
||||||
|
a.IP_REAL_ADDRESS,
|
||||||
|
b.AVATAR_URL
|
||||||
|
AS fromAvatar
|
||||||
|
FROM
|
||||||
|
business_chat a
|
||||||
|
LEFT JOIN business_author b ON a.FROM_ID = b.AUTHOR_ID
|
||||||
|
WHERE
|
||||||
|
a.TO_ID = #{toId}
|
||||||
|
ORDER BY
|
||||||
|
a.create_time DESC
|
||||||
|
) c
|
||||||
|
GROUP BY
|
||||||
|
c.TO_ID = #{toId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user