Helius
2021-05-28 40238efd8a82e2b13266a890e2990e22fdfa9b3b
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
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xcong.excoin.modules.otc.dao.OtcMsgUserListDao">
 
    <select id="getMsgList" resultType="com.xcong.excoin.modules.otc.vo.MsgListVo">
        select
               a.id id,
               a.is_read isRead,
               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}
                <if test="record.nickname != null and record.nickname != ''">
                    and b.name like concat('%',  #{record.nickname},'%')
                </if>
            </if>
        </where>
        order by a.create_time desc
    </select>
 
    <select id="selectListByMemberIdAndTargetId" resultType="com.xcong.excoin.modules.otc.entity.OtcMsgUserListEntity">
        select
              *
        from otc_msg_user_list a
        <where>
                    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>