|
|
@@ -3,13 +3,13 @@
|
|
|
|
|
|
<mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.ChatDialogMapper">
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into im_chat_dialog
|
|
|
+ insert into chat_chat_dialog
|
|
|
(`chat_id`,`chat_type`,`receiver_id`,`disturb`,`robot`,`top`,`display`,`user_id`,`unread_num`)
|
|
|
values
|
|
|
(#{chatId},#{chatType},#{receiverId},#{disturb},#{robot},#{top},#{display},#{userId},#{unreadNum})
|
|
|
</insert>
|
|
|
<insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into im_chat_dialog
|
|
|
+ insert into chat_chat_dialog
|
|
|
(`chat_id`,`chat_type`,`receiver_id`,`disturb`,`robot`,`top`,`display`,`user_id`,`unread_num`)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
@@ -18,28 +18,28 @@
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateSetDisturb">
|
|
|
- update im_chat_dialog set update_time=now(),disturb=#{disturb}
|
|
|
+ update chat_chat_dialog set update_time=now(),disturb=#{disturb}
|
|
|
where id=#{dialogId} and user_id=#{userId}
|
|
|
</update>
|
|
|
<update id="updateSetTop">
|
|
|
- update im_chat_dialog set update_time=now(),top=#{top}
|
|
|
+ update chat_chat_dialog set update_time=now(),top=#{top}
|
|
|
where id=#{dialogId} and user_id=#{userId}
|
|
|
</update>
|
|
|
<update id="updateSetDisplay">
|
|
|
- update im_chat_dialog set update_time=now(),display=#{display}
|
|
|
+ update chat_chat_dialog set update_time=now(),display=#{display}
|
|
|
where id=#{dialogId} and user_id=#{userId}
|
|
|
</update>
|
|
|
<update id="updateSetClearUnread">
|
|
|
- update im_chat_dialog set update_time=now(),unread_num=unread_num+1
|
|
|
+ update chat_chat_dialog set update_time=now(),unread_num=unread_num+1
|
|
|
where receiver_id=#{receiverId} and user_id=#{userId}
|
|
|
</update>
|
|
|
<update id="updateSetIncreaseUnread">
|
|
|
- update im_chat_dialog set update_time=now(),unread_num=0
|
|
|
+ update chat_chat_dialog set update_time=now(),unread_num=0
|
|
|
where receiver_id=#{receiverId} and user_id=#{userId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteGroupChatDialog">
|
|
|
- delete from im_chat_dialog
|
|
|
+ delete from chat_chat_dialog
|
|
|
where receiver_id=#{groupId} and user_id in
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
@@ -47,15 +47,15 @@
|
|
|
</delete>
|
|
|
|
|
|
<select id="findByReceiverAndUserId" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
|
|
|
- select * from im_chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}
|
|
|
+ select * from chat_chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}
|
|
|
</select>
|
|
|
<select id="findChatDialog" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
|
|
|
- select * from im_chat_dialog
|
|
|
+ select * from chat_chat_dialog
|
|
|
where chat_type=#{chatType} and receiver_id=#{receiverId} and user_id=#{userId}
|
|
|
</select>
|
|
|
<select id="findChatDialogsByUserId" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
|
|
|
select *
|
|
|
- from im_chat_dialog
|
|
|
+ from chat_chat_dialog
|
|
|
where display is true and user_id=#{userId}
|
|
|
</select>
|
|
|
</mapper>
|