|
|
@@ -15,12 +15,13 @@
|
|
|
<result property="roomName" column="room_name" jdbcType="VARCHAR"/>
|
|
|
<result property="msgtime" column="msgtime" jdbcType="TIMESTAMP"/>
|
|
|
<result property="msgtype" column="msgtype" jdbcType="VARCHAR"/>
|
|
|
+ <result property="msgurl" column="msgurl" jdbcType="VARCHAR"/>
|
|
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="ChatMsgAllSql">
|
|
|
- id, msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name, msgtime, msgtype, content, create_time
|
|
|
+ id, msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name, msgtime, msgtype, msgurl, content, create_time
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -34,30 +35,30 @@
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
- msgtime, msgtype, content, create_time)
|
|
|
+ msgtime, msgtype, msgurl, content, create_time)
|
|
|
values (#{msgid}, #{actionType}, #{fromId}, #{fromName}, #{tolist}, #{tolistName}, #{roomid}, #{type},
|
|
|
- #{roomName}, #{msgtime}, #{msgtype}, #{content}, #{createTime})
|
|
|
+ #{roomName}, #{msgtime}, #{msgtype}, #{msgurl}, #{content}, #{createTime})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
- msgtime, msgtype, content, create_time)
|
|
|
+ msgtime, msgtype, msgurl, content, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.msgid}, #{entity.actionType}, #{entity.fromId}, #{entity.fromName}, #{entity.tolist},
|
|
|
#{entity.tolistName}, #{entity.roomid}, #{entity.type}, #{entity.roomName}, #{entity.msgtime},
|
|
|
- #{entity.msgtype}, #{entity.content}, #{entity.createTime})
|
|
|
+ #{entity.msgtype}, #{entity.msgurl}, #{entity.content}, #{entity.createTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
- msgtime, msgtype, content, create_time)
|
|
|
+ msgtime, msgtype, msgurl, content, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
(#{entity.msgid}, #{entity.actionType}, #{entity.fromId}, #{entity.fromName}, #{entity.tolist},
|
|
|
#{entity.tolistName}, #{entity.roomid}, #{entity.type}, #{entity.roomName}, #{entity.msgtime},
|
|
|
- #{entity.msgtype}, #{entity.content}, #{entity.createTime})
|
|
|
+ #{entity.msgtype}, #{entity.msgurl}, #{entity.content}, #{entity.createTime})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
msgid = values(msgid),
|
|
|
@@ -71,6 +72,7 @@
|
|
|
room_name = values(room_name),
|
|
|
msgtime = values(msgtime),
|
|
|
msgtype = values(msgtype),
|
|
|
+ msgurl = values(msgurl),
|
|
|
content = values(content),
|
|
|
create_time = values(create_time)
|
|
|
</insert>
|
|
|
@@ -112,6 +114,9 @@
|
|
|
<if test="msgtype != null and msgtype != ''">
|
|
|
msgtype = #{msgtype},
|
|
|
</if>
|
|
|
+ <if test="msgurl != null and msgurl != ''">
|
|
|
+ msgurl = #{msgurl},
|
|
|
+ </if>
|
|
|
<if test="content != null and content != ''">
|
|
|
content = #{content},
|
|
|
</if>
|
|
|
@@ -165,6 +170,9 @@
|
|
|
<if test="msgtype != null and msgtype != ''">
|
|
|
and msgtype = #{msgtype}
|
|
|
</if>
|
|
|
+ <if test="msgurl != null and msgurl != ''">
|
|
|
+ and msgurl = #{msgurl}
|
|
|
+ </if>
|
|
|
<if test="content != null and content != ''">
|
|
|
and content = #{content}
|
|
|
</if>
|
|
|
@@ -218,6 +226,9 @@
|
|
|
<if test="msgtype != null and msgtype != ''">
|
|
|
and msgtype = #{msgtype}
|
|
|
</if>
|
|
|
+ <if test="msgurl != null and msgurl != ''">
|
|
|
+ and msgurl = #{msgurl}
|
|
|
+ </if>
|
|
|
<if test="content != null and content != ''">
|
|
|
and content = #{content}
|
|
|
</if>
|