|
|
@@ -11,6 +11,8 @@
|
|
|
<result property="tolist" column="tolist" jdbcType="VARCHAR"/>
|
|
|
<result property="tolistName" column="tolist_name" jdbcType="VARCHAR"/>
|
|
|
<result property="roomid" column="roomid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
+ <result property="roomName" column="room_name" jdbcType="VARCHAR"/>
|
|
|
<result property="msgtime" column="msgtime" jdbcType="TIMESTAMP"/>
|
|
|
<result property="msgtype" column="msgtype" jdbcType="VARCHAR"/>
|
|
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
@@ -18,7 +20,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="ChatMsgAllSql">
|
|
|
- id, msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, msgtime, msgtype, content, create_time
|
|
|
+ id, msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name, msgtime, msgtype, content, create_time
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -31,31 +33,31 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, msgtime, msgtype,
|
|
|
- content, create_time)
|
|
|
- values (#{msgid}, #{actionType}, #{fromId}, #{fromName}, #{tolist}, #{tolistName}, #{roomid}, #{msgtime},
|
|
|
- #{msgtype}, #{content}, #{createTime})
|
|
|
+ insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
+ msgtime, msgtype, content, create_time)
|
|
|
+ values (#{msgid}, #{actionType}, #{fromId}, #{fromName}, #{tolist}, #{tolistName}, #{roomid}, #{type},
|
|
|
+ #{roomName}, #{msgtime}, #{msgtype}, #{content}, #{createTime})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
- insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, msgtime, msgtype,
|
|
|
- content, create_time)
|
|
|
+ insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
+ msgtime, msgtype, 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.msgtime}, #{entity.msgtype}, #{entity.content},
|
|
|
- #{entity.createTime})
|
|
|
+ #{entity.tolistName}, #{entity.roomid}, #{entity.type}, #{entity.roomName}, #{entity.msgtime},
|
|
|
+ #{entity.msgtype}, #{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, msgtime, msgtype,
|
|
|
- content, create_time)
|
|
|
+ insert into chat_msg(msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, type, room_name,
|
|
|
+ msgtime, msgtype, 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.msgtime}, #{entity.msgtype}, #{entity.content},
|
|
|
- #{entity.createTime})
|
|
|
+ #{entity.tolistName}, #{entity.roomid}, #{entity.type}, #{entity.roomName}, #{entity.msgtime},
|
|
|
+ #{entity.msgtype}, #{entity.content}, #{entity.createTime})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
msgid = values(msgid),
|
|
|
@@ -65,6 +67,8 @@
|
|
|
tolist = values(tolist),
|
|
|
tolist_name = values(tolist_name),
|
|
|
roomid = values(roomid),
|
|
|
+ type = values(type),
|
|
|
+ room_name = values(room_name),
|
|
|
msgtime = values(msgtime),
|
|
|
msgtype = values(msgtype),
|
|
|
content = values(content),
|
|
|
@@ -96,6 +100,12 @@
|
|
|
<if test="roomid != null and roomid != ''">
|
|
|
roomid = #{roomid},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
+ <if test="roomName != null and roomName != ''">
|
|
|
+ room_name = #{roomName},
|
|
|
+ </if>
|
|
|
<if test="msgtime != null">
|
|
|
msgtime = #{msgtime},
|
|
|
</if>
|
|
|
@@ -143,6 +153,12 @@
|
|
|
<if test="roomid != null and roomid != ''">
|
|
|
and roomid = #{roomid}
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="roomName != null and roomName != ''">
|
|
|
+ and room_name = #{roomName}
|
|
|
+ </if>
|
|
|
<if test="msgtime != null">
|
|
|
and msgtime = #{msgtime}
|
|
|
</if>
|
|
|
@@ -190,6 +206,12 @@
|
|
|
<if test="roomid != null and roomid != ''">
|
|
|
and roomid = #{roomid}
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="roomName != null and roomName != ''">
|
|
|
+ and room_name = #{roomName}
|
|
|
+ </if>
|
|
|
<if test="msgtime != null">
|
|
|
and msgtime = #{msgtime}
|
|
|
</if>
|