From 823d625c8c3cfd44925880038d06bc011d68a328 Mon Sep 17 00:00:00 2001 From: fangyuan <527392886@qq.com> Date: 星期四, 16 二月 2023 09:19:48 +0800 Subject: [PATCH] 配置修改 --- ycl-platform/src/main/resources/mapper/NewsInformationDao.xml | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml b/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml index 1c30fe2..c51a481 100644 --- a/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml +++ b/ycl-platform/src/main/resources/mapper/NewsInformationDao.xml @@ -34,7 +34,42 @@ <insert id="insertOneInformation" keyProperty="id" useGeneratedKeys="true"> insert into news_website.news_information(title, content, publish_time, is_sign, create_time, send_to, image_url) values (#{entity.title}, #{entity.content}, #{entity.publishTime}, #{entity.isSign}, #{entity.createTime}, #{entity.sendTo}, #{entity.imageUrl}) - </insert> + + <select id="selectInformationById" resultType="com.ycl.entity.NewsInformation" parameterType="int"> + select * from news_information where id=#{InformationId} + </select> + + <select id="selectAllInformation" resultType="com.ycl.entity.NewsInformation"> + select * from news_information + </select> + + <update id="updateInformationById" parameterType="com.ycl.entity.NewsInformation"> + 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