|
|
@@ -5,8 +5,8 @@
|
|
|
<resultMap type="com.kede.common.model.ChatMsg" id="ChatMsgMap">
|
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
<result property="msgid" column="msgid" jdbcType="VARCHAR"/>
|
|
|
- <result property="action" column="action" jdbcType="VARCHAR"/>
|
|
|
- <result property="from" column="from" jdbcType="VARCHAR"/>
|
|
|
+ <result property="actionType" column="action_type" jdbcType="VARCHAR"/>
|
|
|
+ <result property="fromId" column="from_id" jdbcType="VARCHAR"/>
|
|
|
<result property="fromName" column="from_name" jdbcType="VARCHAR"/>
|
|
|
<result property="tolist" column="tolist" jdbcType="VARCHAR"/>
|
|
|
<result property="tolistName" column="tolist_name" jdbcType="VARCHAR"/>
|
|
|
@@ -18,7 +18,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="ChatMsgAllSql">
|
|
|
- id, msgid, `action`, `from`, from_name, tolist, tolist_name, roomid, msgtime, msgtype, content, create_time
|
|
|
+ id, msgid, action_type, from_id, from_name, tolist, tolist_name, roomid, msgtime, msgtype, content, create_time
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
@@ -31,36 +31,36 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into chat_msg(msgid, action, from, from_name, tolist, tolist_name, roomid, msgtime, msgtype, content,
|
|
|
- create_time)
|
|
|
- values (#{msgid}, #{action}, #{from}, #{fromName}, #{tolist}, #{tolistName}, #{roomid}, #{msgtime}, #{msgtype},
|
|
|
- #{content}, #{createTime})
|
|
|
+ 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>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
- insert into chat_msg(msgid, action, from, 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, msgtime, msgtype,
|
|
|
+ content, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.msgid}, #{entity.action}, #{entity.from}, #{entity.fromName}, #{entity.tolist},
|
|
|
+ (#{entity.msgid}, #{entity.actionType}, #{entity.fromId}, #{entity.fromName}, #{entity.tolist},
|
|
|
#{entity.tolistName}, #{entity.roomid}, #{entity.msgtime}, #{entity.msgtype}, #{entity.content},
|
|
|
#{entity.createTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into chat_msg(msgid, action, from, 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, msgtime, msgtype,
|
|
|
+ content, create_time)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.msgid}, #{entity.action}, #{entity.from}, #{entity.fromName}, #{entity.tolist},
|
|
|
+ (#{entity.msgid}, #{entity.actionType}, #{entity.fromId}, #{entity.fromName}, #{entity.tolist},
|
|
|
#{entity.tolistName}, #{entity.roomid}, #{entity.msgtime}, #{entity.msgtype}, #{entity.content},
|
|
|
#{entity.createTime})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
msgid = values(msgid),
|
|
|
- action = values(action),
|
|
|
- from = values(from),
|
|
|
+ action_type = values(action_type),
|
|
|
+ from_id = values(from_id),
|
|
|
from_name = values(from_name),
|
|
|
tolist = values(tolist),
|
|
|
tolist_name = values(tolist_name),
|
|
|
@@ -78,11 +78,11 @@
|
|
|
<if test="msgid != null and msgid != ''">
|
|
|
msgid = #{msgid},
|
|
|
</if>
|
|
|
- <if test="action != null and action != ''">
|
|
|
- action = #{action},
|
|
|
+ <if test="actionType != null and actionType != ''">
|
|
|
+ action_type = #{actionType},
|
|
|
</if>
|
|
|
- <if test="from != null and from != ''">
|
|
|
- from = #{from},
|
|
|
+ <if test="fromId != null and fromId != ''">
|
|
|
+ from_id = #{fromId},
|
|
|
</if>
|
|
|
<if test="fromName != null and fromName != ''">
|
|
|
from_name = #{fromName},
|
|
|
@@ -125,11 +125,11 @@
|
|
|
<if test="msgid != null and msgid != ''">
|
|
|
and msgid = #{msgid}
|
|
|
</if>
|
|
|
- <if test="action != null and action != ''">
|
|
|
- and action = #{action}
|
|
|
+ <if test="actionType != null and actionType != ''">
|
|
|
+ and action_type = #{actionType}
|
|
|
</if>
|
|
|
- <if test="from != null and from != ''">
|
|
|
- and from = #{from}
|
|
|
+ <if test="fromId != null and fromId != ''">
|
|
|
+ and from_id = #{fromId}
|
|
|
</if>
|
|
|
<if test="fromName != null and fromName != ''">
|
|
|
and from_name = #{fromName}
|
|
|
@@ -172,11 +172,11 @@
|
|
|
<if test="msgid != null and msgid != ''">
|
|
|
and msgid = #{msgid}
|
|
|
</if>
|
|
|
- <if test="action != null and action != ''">
|
|
|
- and action = #{action}
|
|
|
+ <if test="actionType != null and actionType != ''">
|
|
|
+ and action_type = #{actionType}
|
|
|
</if>
|
|
|
- <if test="from != null and from != ''">
|
|
|
- and from = #{from}
|
|
|
+ <if test="fromId != null and fromId != ''">
|
|
|
+ and from_id = #{fromId}
|
|
|
</if>
|
|
|
<if test="fromName != null and fromName != ''">
|
|
|
and from_name = #{fromName}
|
|
|
@@ -205,7 +205,6 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
<!--通过主键删除-->
|
|
|
<delete id="deleteById">
|
|
|
delete
|