From 30c1c9d16a57d2bbc7cd1511d02c5ddcc6a143f6 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Tue, 08 Jun 2021 16:10:44 +0800 Subject: [PATCH] modify --- src/main/resources/mapper/otc/OtcMsgUserListDao.xml | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mapper/otc/OtcMsgUserListDao.xml b/src/main/resources/mapper/otc/OtcMsgUserListDao.xml index 88c3f56..b484781 100644 --- a/src/main/resources/mapper/otc/OtcMsgUserListDao.xml +++ b/src/main/resources/mapper/otc/OtcMsgUserListDao.xml @@ -6,13 +6,18 @@ select a.id id, a.is_read isRead, - a.last_msg_time lastMsgTime + a.target_id targetId, + a.member_id memberId, + a.last_msg_time lastMsgTime, + b.name nickname from otc_msg_user_list a + left join member b on a.target_id = b.id <where> <if test="record!=null"> a.member_id = #{record.memberId} - or - a.target_id = #{record.memberId} + <if test="record.nickname != null and record.nickname != ''"> + and b.name like concat('%', #{record.nickname},'%') + </if> </if> </where> order by a.create_time desc @@ -23,12 +28,15 @@ * from otc_msg_user_list a <where> - (a.member_id = #{memberId} and a.target_id = #{targetId}) - or - (a.member_id = #{targetId} and a.target_id = #{memberId}) + a.member_id = #{memberId} and a.target_id = #{targetId} </where> order by a.create_time desc </select> + <select id="selectChatListByToAndFrom" resultType="com.xcong.excoin.modules.otc.entity.OtcMsgUserListEntity"> + select * from otc_msg_user_list + where member_id=#{from} and target_id=#{to} + </select> + </mapper> \ No newline at end of file -- Gitblit v1.9.1