From 9d35ba657fa5e3add766405d76e3ff8c4dcd4ad4 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 04 七月 2020 15:38:00 +0800
Subject: [PATCH] 多系统兼容优化

---
 fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
index ef0f810..937a1a7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
@@ -16,8 +16,9 @@
 		<result column="an_updatetime" property="updateTime" jdbcType="TIMESTAMP" />
 		<result column="an_begin_time" property="beginTime" jdbcType="TIMESTAMP"/>
    		<result column="an_end_time" property="endTime" jdbcType="TIMESTAMP"/>
+		<result column="an_system" property="system" jdbcType="VARCHAR" />
 	</resultMap>
-	<sql id="Base_Column_List">an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime
+	<sql id="Base_Column_List">an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime,an_system
 	</sql>
 	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
 		parameterType="java.lang.Long">
@@ -30,12 +31,12 @@
 		parameterType="java.lang.String">
 		select
 		<include refid="Base_Column_List" />
-		from yeshi_ec_apppage_notification where an_type = #{0}
+		from yeshi_ec_apppage_notification where an_type = #{type} and an_system=#{system}
 	</select>
 
 	<select id="listValidByType" resultMap="BaseResultMap" parameterType="java.lang.String">
 		SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_apppage_notification 
-		WHERE an_type = #{0} AND an_show = 1 
+		WHERE an_type = #{type} AND an_system=#{system} AND an_show = 1
 		 	AND IF(an_begin_time IS NULL,TRUE, an_begin_time<![CDATA[<=]]> NOW()) 
 	  		AND IF(an_end_time IS NULL,TRUE, an_end_time <![CDATA[>=]]> NOW())
 	</select>
@@ -47,9 +48,9 @@
 	<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
 		useGeneratedKeys="true" keyProperty="id">insert into
 		yeshi_ec_apppage_notification
-		(an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime)
+		(an_id,an_type,an_show,an_can_close,an_content,an_content_url,an_md5,an_createtime,an_begin_time,an_end_time,an_updatetime,an_system)
 		values
-		(#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{show,jdbcType=BOOLEAN},#{canClose,jdbcType=BOOLEAN},#{content,jdbcType=VARCHAR},#{contentUrl,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beginTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
+		(#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{show,jdbcType=BOOLEAN},#{canClose,jdbcType=BOOLEAN},#{content,jdbcType=VARCHAR},#{contentUrl,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beginTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{system,jdbcType=VARCHAR})
 	</insert>
 	<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification"
 		useGeneratedKeys="true" keyProperty="id">
@@ -66,6 +67,7 @@
 		    <if test="beginTime != null">an_begin_time,</if>
      		<if test="endTime != null">an_end_time,</if>
 			<if test="updateTime != null">an_updatetime,</if>
+			<if test="system != null">an_system,</if>
 		</trim>
 		values
 		<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -80,6 +82,7 @@
 			<if test="beginTime != null">#{beginTime,jdbcType=TIMESTAMP},</if>
      		<if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
 			<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
+			<if test="system != null">#{system,jdbcType=VARCHAR},</if>
 		</trim>
 	</insert>
 	<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">update
@@ -91,7 +94,8 @@
 		#{contentUrl,jdbcType=VARCHAR},an_md5 =
 		#{md5,jdbcType=VARCHAR},an_createtime =
 		#{createTime,jdbcType=TIMESTAMP},an_begin_time = #{beginTime,jdbcType=TIMESTAMP},an_end_time = #{endTime,jdbcType=TIMESTAMP},an_updatetime =
-		#{updateTime,jdbcType=TIMESTAMP} where an_id = #{id,jdbcType=BIGINT}
+		#{updateTime,jdbcType=TIMESTAMP},an_system =
+		#{system,jdbcType=VARCHAR} where an_id = #{id,jdbcType=BIGINT}
 	</update>
 	<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.help.AppPageNotification">
 		update yeshi_ec_apppage_notification
@@ -106,6 +110,7 @@
 			<if test="beginTime != null">an_begin_time=#{beginTime,jdbcType=TIMESTAMP},</if>
      		<if test="endTime != null">an_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
 			<if test="updateTime != null">an_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
+			<if test="system != null">an_system=#{system,jdbcType=VARCHAR},</if>
 		</set>
 		where an_id = #{id,jdbcType=BIGINT}
 	</update>
@@ -113,7 +118,7 @@
 	
 	<select id="listQuery" resultMap="BaseResultMap">
 	    SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_apppage_notification
-	    WHERE 1=1
+	    WHERE 1=1 AND an_system=#{system}
 		   <if test='key != null and key != ""'>
 		   	   AND (an_type like '%${key}%' or an_content like '%${key}%') 
 		   </if>
@@ -129,7 +134,7 @@
    
    <select id="countQuery" resultType="java.lang.Long">
 	    SELECT IFNULL(count(an_id),0)  FROM yeshi_ec_apppage_notification 
-	    WHERE 1=1
+	    WHERE 1=1 AND an_system=#{system}
 		    <if test='key != null and key != ""'>
 		   	   AND (an_type like '%${key}%' or an_content like '%${key}%') 
 		   </if>

--
Gitblit v1.8.0