From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 23 十一月 2019 18:30:01 +0800
Subject: [PATCH] 配置文件修改

---
 fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml
index 3019f33..c63442a 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml
@@ -17,8 +17,10 @@
 			jdbcType="TIMESTAMP" />
 		<result column="mdrs_latest_content" property="latestContent"
 			jdbcType="VARCHAR" />
+		<result column="mdrs_latest_content_time" property="latestContentTime"
+			jdbcType="TIMESTAMP" />
 	</resultMap>
-	<sql id="Base_Column_List">mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content
+	<sql id="Base_Column_List">mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content,mdrs_latest_content_time
 	</sql>
 	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
 		parameterType="java.lang.Long">
@@ -27,13 +29,22 @@
 		from yeshi_ec_msg_device_read_state where mdrs_id =
 		#{id,jdbcType=BIGINT}
 	</select>
-	<select id="selectByDeviceAndPlatformAndType" resultMap="BaseResultMap">
+	<select id="selectByDeviceAndPlatformAndType" resultMap="BaseResultMap" useCache="false" flushCache="true">
 		select
 		<include refid="Base_Column_List" />
 		from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and
 		mdrs_platform=#{platform} and mdrs_type=#{type}
 	</select>
-	<select id="listByDeviceAndPlatform" resultMap="BaseResultMap">
+	
+	<select id="selectByDeviceAndPlatformAndTypeForUpdate" resultMap="BaseResultMap" useCache="false" flushCache="true">
+		select
+		<include refid="Base_Column_List" />
+		from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and
+		mdrs_platform=#{platform} and mdrs_type=#{type} for update
+	</select>
+	
+	
+	<select id="listByDeviceAndPlatform" resultMap="BaseResultMap"  useCache="false" flushCache="true">
 		select
 		<include refid="Base_Column_List" />
 		from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and
@@ -45,9 +56,9 @@
 	<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState"
 		useGeneratedKeys="true" keyProperty="id">insert into
 		yeshi_ec_msg_device_read_state
-		(mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content)
+		(mdrs_id,mdrs_device,mdrs_platform,mdrs_type,mdrs_read_time,mdrs_unread_count,mdrs_create_time,mdrs_update_time,mdrs_latest_content,mdrs_latest_content_time)
 		values
-		(#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{platform,jdbcType=INTEGER},#{type,jdbcType=VARCHAR},#{readTime,jdbcType=TIMESTAMP},#{unReadCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{latestContent,jdbcType=VARCHAR})
+		(#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{platform,jdbcType=INTEGER},#{type,jdbcType=VARCHAR},#{readTime,jdbcType=TIMESTAMP},#{unReadCount,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{latestContent,jdbcType=VARCHAR},#{latestContentTime,jdbcType=TIMESTAMP})
 	</insert>
 	<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState"
 		useGeneratedKeys="true" keyProperty="id">
@@ -62,6 +73,7 @@
 			<if test="createTime != null">mdrs_create_time,</if>
 			<if test="updateTime != null">mdrs_update_time,</if>
 			<if test="latestContent != null">mdrs_latest_content,</if>
+			<if test="latestContentTime != null">mdrs_latest_content_time,</if>
 		</trim>
 		values
 		<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -73,7 +85,8 @@
 			<if test="unReadCount != null">#{unReadCount,jdbcType=INTEGER},</if>
 			<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
 			<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
-			<if test="latestContent != null">#{latestContent,jdbcType=VARCHAR}</if>
+			<if test="latestContent != null">#{latestContent,jdbcType=VARCHAR},</if>
+			<if test="latestContentTime != null">#{latestContentTime,jdbcType=TIMESTAMP}</if>
 		</trim>
 	</insert>
 	<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState">update
@@ -85,8 +98,10 @@
 		#{unReadCount,jdbcType=INTEGER},mdrs_create_time =
 		#{createTime,jdbcType=TIMESTAMP},mdrs_update_time =
 		#{updateTime,jdbcType=TIMESTAMP} ,mdrs_latest_content
-		=#{latestContent,jdbcType=VARCHAR} where mdrs_id =
-		#{id,jdbcType=BIGINT}</update>
+		=#{latestContent,jdbcType=VARCHAR},mdrs_latest_content_time
+		=#{latestContentTime,jdbcType=TIMESTAMP} where mdrs_id =
+		#{id,jdbcType=BIGINT}
+	</update>
 	<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState">
 		update yeshi_ec_msg_device_read_state
 		<set>
@@ -100,10 +115,13 @@
 			<if test="id !=null">mdrs_id =#{id,jdbcType=BIGINT},</if>
 			<if test="latestContent !=null">mdrs_latest_content =#{latestContent,jdbcType=VARCHAR},
 			</if>
+			<if test="latestContentTime !=null">mdrs_latest_content_time =#{latestContentTime,jdbcType=TIMESTAMP},
+			</if>
 		</set>
 		where mdrs_id = #{id,jdbcType=BIGINT}
 	</update>
 	<update id="setAllMsgRead">update yeshi_ec_msg_device_read_state set
 		mdrs_read_time=now(),mdrs_unread_count=0,mdrs_update_time=now() where
-		mdrs_device=#{device} and mdrs_platform=#{platform}</update>
+		mdrs_device=#{device} and mdrs_platform=#{platform}
+	</update>
 </mapper>

--
Gitblit v1.8.0