|
@@ -0,0 +1,98 @@
|
|
|
|
|
+<?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.kede.common.dao.ChatMsgOptimizeMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="com.kede.common.model.ChatMsgOptimize" id="ChatMsgOptimizeMap">
|
|
|
|
|
+ <result property="msgid" column="msgid" jdbcType="VARCHAR"/>
|
|
|
|
|
+ <result property="msgtime" column="msgtime" jdbcType="TIMESTAMP"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="ChatMsgOptimizeAllSql">
|
|
|
|
|
+ msgid, msgtime
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <!--查询单个-->
|
|
|
|
|
+ <select id="selectById" resultMap="ChatMsgOptimizeMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="ChatMsgOptimizeAllSql"/>
|
|
|
|
|
+ from chat_msg_optimize
|
|
|
|
|
+ where msgid = #{msgid}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!--新增所有列-->
|
|
|
|
|
+ <insert id="insert" keyProperty="msgid" useGeneratedKeys="true">
|
|
|
|
|
+ insert into chat_msg_optimize(msgtime)
|
|
|
|
|
+ values (#{msgtime})
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertBatch">
|
|
|
|
|
+ insert into chat_msg_optimize(msgtime)
|
|
|
|
|
+ values
|
|
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
|
|
+ (#{entity.msgtime})
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="msgid" useGeneratedKeys="true">
|
|
|
|
|
+ insert into chat_msg_optimize(msgtime)
|
|
|
|
|
+ values
|
|
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
|
|
+ (#{entity.msgtime})
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ on duplicate key update
|
|
|
|
|
+ msgtime = values(msgtime)
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <!--通过主键修改数据-->
|
|
|
|
|
+ <update id="update">
|
|
|
|
|
+ update chat_msg_optimize
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <if test="msgtime != null">
|
|
|
|
|
+ msgtime = #{msgtime},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where msgid = #{msgid}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <!--查询指定行数据-->
|
|
|
|
|
+ <select id="findChatMsgOptimizeList" resultMap="ChatMsgOptimizeMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="ChatMsgOptimizeAllSql"/>
|
|
|
|
|
+
|
|
|
|
|
+ from chat_msg_optimize
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="msgid != null and msgid != ''">
|
|
|
|
|
+ and msgid = #{msgid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="msgtime != null">
|
|
|
|
|
+ and msgtime = #{msgtime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ <if test="page_sql != null">
|
|
|
|
|
+ ${page_sql}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!--统计总行数-->
|
|
|
|
|
+ <select id="findChatMsgOptimizeCount" resultType="java.lang.Integer">
|
|
|
|
|
+ select count(1)
|
|
|
|
|
+ from chat_msg_optimize
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="msgid != null and msgid != ''">
|
|
|
|
|
+ and msgid = #{msgid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="msgtime != null">
|
|
|
|
|
+ and msgtime = #{msgtime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!--通过主键删除-->
|
|
|
|
|
+ <delete id="deleteById">
|
|
|
|
|
+ delete
|
|
|
|
|
+ from chat_msg_optimize
|
|
|
|
|
+ where msgid = #{msgid}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+</mapper>
|
|
|
|
|
+
|