From ecad870fe1896c8c3e48506d50bb5818974253bf Mon Sep 17 00:00:00 2001
From: fangyuan <527392886@qq.com>
Date: 星期一, 16 一月 2023 11:33:58 +0800
Subject: [PATCH] 机场公安前后端联调内容

---
 ycl-platform/src/main/resources/mapper/NewsInformationDao.xml |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml b/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml
index a2921bd..c51a481 100644
--- a/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml
+++ b/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml
@@ -45,7 +45,30 @@
     </select>
 
     <update id="updateInformationById" parameterType="com.ycl.entity.NewsInformation">
-        update news_information set title=#{entity.title},content=#{entity.content},publish_time=#{entity.publishTime}, is_sign=#{entity.isSign}, create_time=#{entity.createTime}, send_to=#{entity.sendTo}, image_url=#{entity.imageUrl}
+        update news_information
+        <trim prefix="set" suffixOverrides=",">
+            <if test="entity.title!=null and entity.title!=''">
+                title=#{entity.title},
+            </if>
+            <if test="entity.content!=null and entity.content!=''">
+                content=#{entity.content},
+            </if>
+            <if test="entity.publishTime!=null ">
+                publish_time=#{entity.publishTime},
+            </if>
+            <if test="entity.isSign!=null and entity.isSign!=''">
+                is_sign=#{entity.isSign},
+            </if>
+            <if test="entity.createTime!=null ">
+                create_time=#{entity.createTime},
+            </if>
+            <if test="entity.sendTo!=null and entity.sendTo!=''">
+                send_to=#{entity.sendTo},
+            </if>
+            <if test="entity.imageUrl!=null and entity.imageUrl!=''">
+                image_url=#{entity.imageUrl},
+            </if>
+        </trim>
         where id=#{entity.id}
     </update>
 </mapper>

--
Gitblit v1.8.0