<?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>
|