浏览代码

fix 防溺水新闻

tjf 2 周之前
父节点
当前提交
85cea9ca89

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/manage/ColumnNewsController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.manage;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.manage.domain.ColumnNews;
+import com.ruoyi.manage.service.IColumnNewsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 新闻信息Controller
+ *
+ * @author boman
+ * @date 2025-07-31
+ */
+@RestController
+@RequestMapping("/manage/news")
+public class ColumnNewsController extends BaseController {
+    @Autowired
+    private IColumnNewsService columnNewsService;
+
+    /**
+     * 查询新闻信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ColumnNews columnNews) {
+        startPage();
+        List<ColumnNews> list = columnNewsService.selectColumnNewsList(columnNews);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出新闻信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:export')")
+    @Log(title = "新闻信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ColumnNews columnNews) {
+        List<ColumnNews> list = columnNewsService.selectColumnNewsList(columnNews);
+        ExcelUtil<ColumnNews> util = new ExcelUtil<ColumnNews>(ColumnNews.class);
+        util.exportExcel(response, list, "新闻信息数据");
+    }
+
+    /**
+     * 获取新闻信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:query')")
+    @GetMapping(value = "/{newsId}")
+    public AjaxResult getInfo(@PathVariable("newsId") Long newsId) {
+        return success(columnNewsService.selectColumnNewsByNewsId(newsId));
+    }
+
+    /**
+     * 新增新闻信息
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:add')")
+    @Log(title = "新闻信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ColumnNews columnNews) {
+        return toAjax(columnNewsService.insertColumnNews(columnNews));
+    }
+
+    /**
+     * 修改新闻信息
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:edit')")
+    @Log(title = "新闻信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ColumnNews columnNews) {
+        return toAjax(columnNewsService.updateColumnNews(columnNews));
+    }
+
+    /**
+     * 删除新闻信息
+     */
+    @PreAuthorize("@ss.hasPermi('manage:news:remove')")
+    @Log(title = "新闻信息", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{newsIds}")
+    public AjaxResult remove(@PathVariable Long[] newsIds) {
+        return toAjax(columnNewsService.deleteColumnNewsByNewsIds(newsIds));
+    }
+}

+ 3 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@@ -176,6 +176,7 @@ public class Constants {
     public static final String ZERO = "0";
     public static final String ONE = "1";
     public static final String TWO = "2";
+    public static final String TEN = "10";
     //上月告警统计key
     public static final String WARN_LAST_MONTH = "warn_last_month:";
     //坐标
@@ -202,4 +203,6 @@ public class Constants {
     public static final String TO_SERVER_PIC_POS= "toServer_picPos";
     //首页统计折线图往期年份数据
     public static final String WARN_MANAGE_LAST_YEAR = "warn_manage_last_year:";
+    //防溺水新闻:id value=阅读次数,每10次更新一下数据库
+    public static final String COLUMN_NEWS_NUM = "column_news_num:";
 }

+ 241 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/domain/ColumnNews.java

@@ -0,0 +1,241 @@
+package com.ruoyi.manage.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 新闻信息对象 column_news
+ * 
+ * @author boman
+ * @date 2025-07-31
+ */
+public class ColumnNews extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 新闻ID */
+    private Long newsId;
+
+    /** 新闻标题 */
+    @Excel(name = "新闻标题")
+    private String newsTitle;
+
+    /** 新闻缩略图地址 */
+    @Excel(name = "新闻缩略图地址")
+    private String newsImage;
+
+    /** 新闻内容 */
+    @Excel(name = "新闻内容")
+    private String newsContent;
+
+    /** 是否轮播图( N:否 Y:是) */
+    @Excel(name = "是否轮播图( N:否 Y:是)")
+    private String isRotation;
+
+    /** 是否头条 */
+    @Excel(name = "是否头条")
+    private String isTop;
+
+    /** 新闻状态 0:待审核 1:审核通过 2.审核未通过  */
+    @Excel(name = "新闻状态 0:待审核 1:审核通过 2.审核未通过 ")
+    private String status;
+
+    /** 是否删除(N正常 Y删除) */
+    @Excel(name = "是否删除", readConverterExp = "N=正常,Y=删除")
+    private String isDel;
+
+    /** 浏览数 */
+    @Excel(name = "浏览数")
+    private String viewsNum;
+
+    /** 外部链接 */
+    @Excel(name = "外部链接")
+    private String reprintUrl;
+
+    /** 作者 */
+    @Excel(name = "作者")
+    private String author;
+
+    /** 类型 1:新闻 2:视频 3:知识 */
+    @Excel(name = "类型 1:新闻 2:视频 3:知识")
+    private String newType;
+
+    /** 视频地址 */
+    @Excel(name = "视频地址")
+    private String newUrl;
+
+    /** 新闻日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "新闻日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date releaseTime;
+
+    public void setNewsId(Long newsId) 
+    {
+        this.newsId = newsId;
+    }
+
+    public Long getNewsId() 
+    {
+        return newsId;
+    }
+
+    public void setNewsTitle(String newsTitle) 
+    {
+        this.newsTitle = newsTitle;
+    }
+
+    public String getNewsTitle() 
+    {
+        return newsTitle;
+    }
+
+    public void setNewsImage(String newsImage) 
+    {
+        this.newsImage = newsImage;
+    }
+
+    public String getNewsImage() 
+    {
+        return newsImage;
+    }
+
+    public void setNewsContent(String newsContent) 
+    {
+        this.newsContent = newsContent;
+    }
+
+    public String getNewsContent() 
+    {
+        return newsContent;
+    }
+
+    public void setIsRotation(String isRotation) 
+    {
+        this.isRotation = isRotation;
+    }
+
+    public String getIsRotation() 
+    {
+        return isRotation;
+    }
+
+    public void setIsTop(String isTop) 
+    {
+        this.isTop = isTop;
+    }
+
+    public String getIsTop() 
+    {
+        return isTop;
+    }
+
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+
+    public void setIsDel(String isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public String getIsDel() 
+    {
+        return isDel;
+    }
+
+    public void setViewsNum(String viewsNum) 
+    {
+        this.viewsNum = viewsNum;
+    }
+
+    public String getViewsNum() 
+    {
+        return viewsNum;
+    }
+
+    public void setReprintUrl(String reprintUrl) 
+    {
+        this.reprintUrl = reprintUrl;
+    }
+
+    public String getReprintUrl() 
+    {
+        return reprintUrl;
+    }
+
+    public void setAuthor(String author) 
+    {
+        this.author = author;
+    }
+
+    public String getAuthor() 
+    {
+        return author;
+    }
+
+    public void setNewType(String newType) 
+    {
+        this.newType = newType;
+    }
+
+    public String getNewType() 
+    {
+        return newType;
+    }
+
+    public void setNewUrl(String newUrl) 
+    {
+        this.newUrl = newUrl;
+    }
+
+    public String getNewUrl() 
+    {
+        return newUrl;
+    }
+
+    public void setReleaseTime(Date releaseTime) 
+    {
+        this.releaseTime = releaseTime;
+    }
+
+    public Date getReleaseTime() 
+    {
+        return releaseTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("newsId", getNewsId())
+            .append("newsTitle", getNewsTitle())
+            .append("newsImage", getNewsImage())
+            .append("newsContent", getNewsContent())
+            .append("isRotation", getIsRotation())
+            .append("isTop", getIsTop())
+            .append("status", getStatus())
+            .append("isDel", getIsDel())
+            .append("viewsNum", getViewsNum())
+            .append("reprintUrl", getReprintUrl())
+            .append("author", getAuthor())
+            .append("newType", getNewType())
+            .append("newUrl", getNewUrl())
+            .append("releaseTime", getReleaseTime())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/mapper/ColumnNewsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.manage.mapper;
+
+import com.ruoyi.manage.domain.ColumnNews;
+
+import java.util.List;
+
+/**
+ * 新闻信息Mapper接口
+ * 
+ * @author boman
+ * @date 2025-07-31
+ */
+public interface ColumnNewsMapper 
+{
+    /**
+     * 查询新闻信息
+     * 
+     * @param newsId 新闻信息主键
+     * @return 新闻信息
+     */
+    public ColumnNews selectColumnNewsByNewsId(Long newsId);
+
+    /**
+     * 查询新闻信息列表
+     * 
+     * @param columnNews 新闻信息
+     * @return 新闻信息集合
+     */
+    public List<ColumnNews> selectColumnNewsList(ColumnNews columnNews);
+
+    /**
+     * 新增新闻信息
+     * 
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    public int insertColumnNews(ColumnNews columnNews);
+
+    /**
+     * 修改新闻信息
+     * 
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    public int updateColumnNews(ColumnNews columnNews);
+
+    /**
+     * 删除新闻信息
+     * 
+     * @param newsId 新闻信息主键
+     * @return 结果
+     */
+    public int deleteColumnNewsByNewsId(Long newsId);
+
+    /**
+     * 批量删除新闻信息
+     * 
+     * @param newsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteColumnNewsByNewsIds(Long[] newsIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/IColumnNewsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.manage.service;
+
+import com.ruoyi.manage.domain.ColumnNews;
+
+import java.util.List;
+
+/**
+ * 新闻信息Service接口
+ * 
+ * @author boman
+ * @date 2025-07-31
+ */
+public interface IColumnNewsService 
+{
+    /**
+     * 查询新闻信息
+     * 
+     * @param newsId 新闻信息主键
+     * @return 新闻信息
+     */
+    public ColumnNews selectColumnNewsByNewsId(Long newsId);
+
+    /**
+     * 查询新闻信息列表
+     * 
+     * @param columnNews 新闻信息
+     * @return 新闻信息集合
+     */
+    public List<ColumnNews> selectColumnNewsList(ColumnNews columnNews);
+
+    /**
+     * 新增新闻信息
+     * 
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    public int insertColumnNews(ColumnNews columnNews);
+
+    /**
+     * 修改新闻信息
+     * 
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    public int updateColumnNews(ColumnNews columnNews);
+
+    /**
+     * 批量删除新闻信息
+     * 
+     * @param newsIds 需要删除的新闻信息主键集合
+     * @return 结果
+     */
+    public int deleteColumnNewsByNewsIds(Long[] newsIds);
+
+    /**
+     * 删除新闻信息信息
+     * 
+     * @param newsId 新闻信息主键
+     * @return 结果
+     */
+    public int deleteColumnNewsByNewsId(Long newsId);
+}

+ 111 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/ColumnNewsServiceImpl.java

@@ -0,0 +1,111 @@
+package com.ruoyi.manage.service.impl;
+
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.manage.domain.ColumnNews;
+import com.ruoyi.manage.mapper.ColumnNewsMapper;
+import com.ruoyi.manage.service.IColumnNewsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import static com.ruoyi.common.constant.Constants.*;
+
+/**
+ * 新闻信息Service业务层处理
+ *
+ * @author boman
+ * @date 2025-07-31
+ */
+@Service
+public class ColumnNewsServiceImpl implements IColumnNewsService {
+    @Autowired
+    private ColumnNewsMapper columnNewsMapper;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 查询新闻信息
+     *
+     * @param newsId 新闻信息主键
+     * @return 新闻信息
+     */
+    @Override
+    public ColumnNews selectColumnNewsByNewsId(Long newsId) {
+        ColumnNews columnNews = columnNewsMapper.selectColumnNewsByNewsId(newsId);
+        String viewsNumOld = redisCache.getCacheObject(COLUMN_NEWS_NUM + newsId);
+        if (viewsNumOld != null) {
+            viewsNumOld = String.valueOf(Integer.parseInt(viewsNumOld) + 1);
+        }else {
+            redisCache.setCacheObject(COLUMN_NEWS_NUM + newsId, 1);
+        }
+        if (viewsNumOld.equals(TEN)) {
+            columnNews.setViewsNum(String.valueOf(Integer.parseInt(columnNews.getViewsNum()) + 10));
+            //如果有10个人观看,则更新数据到数据库
+            columnNewsMapper.updateColumnNews(columnNews);
+            //重置计数器
+            redisCache.setCacheObject(COLUMN_NEWS_NUM + newsId, ZERO);
+        }
+        columnNews.setViewsNum(viewsNumOld);
+        return columnNews;
+    }
+
+    /**
+     * 查询新闻信息列表
+     *
+     * @param columnNews 新闻信息
+     * @return 新闻信息
+     */
+    @Override
+    public List<ColumnNews> selectColumnNewsList(ColumnNews columnNews) {
+        return columnNewsMapper.selectColumnNewsList(columnNews);
+    }
+
+    /**
+     * 新增新闻信息
+     *
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    @Override
+    public int insertColumnNews(ColumnNews columnNews) {
+        columnNews.setCreateTime(DateUtils.getNowDate());
+        return columnNewsMapper.insertColumnNews(columnNews);
+    }
+
+    /**
+     * 修改新闻信息
+     *
+     * @param columnNews 新闻信息
+     * @return 结果
+     */
+    @Override
+    public int updateColumnNews(ColumnNews columnNews) {
+        columnNews.setUpdateTime(DateUtils.getNowDate());
+        return columnNewsMapper.updateColumnNews(columnNews);
+    }
+
+    /**
+     * 批量删除新闻信息
+     *
+     * @param newsIds 需要删除的新闻信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteColumnNewsByNewsIds(Long[] newsIds) {
+        return columnNewsMapper.deleteColumnNewsByNewsIds(newsIds);
+    }
+
+    /**
+     * 删除新闻信息信息
+     *
+     * @param newsId 新闻信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteColumnNewsByNewsId(Long newsId) {
+        return columnNewsMapper.deleteColumnNewsByNewsId(newsId);
+    }
+}

+ 18 - 4
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java

@@ -1,11 +1,12 @@
 package com.ruoyi.system.domain;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.core.domain.BaseEntity;
 import com.ruoyi.common.xss.Xss;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
 
 /**
  * 通知公告表 sys_notice
@@ -30,6 +31,18 @@ public class SysNotice extends BaseEntity
 
     /** 公告状态(0正常 1关闭) */
     private String status;
+    /**
+     * 地址
+     */
+    private String address;
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
 
     public Long getNoticeId()
     {
@@ -96,6 +109,7 @@ public class SysNotice extends BaseEntity
             .append("createTime", getCreateTime())
             .append("updateBy", getUpdateBy())
             .append("updateTime", getUpdateTime())
+            .append("address", getAddress())
             .append("remark", getRemark())
             .toString();
     }

+ 157 - 0
ruoyi-system/src/main/resources/mapper/manage/ColumnNewsMapper.xml

@@ -0,0 +1,157 @@
+<?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.ruoyi.manage.mapper.ColumnNewsMapper">
+
+    <resultMap type="ColumnNews" id="ColumnNewsResult">
+        <result property="newsId" column="news_id"/>
+        <result property="newsTitle" column="news_title"/>
+        <result property="newsImage" column="news_image"/>
+        <result property="newsContent" column="news_content"/>
+        <result property="isRotation" column="is_rotation"/>
+        <result property="isTop" column="is_top"/>
+        <result property="status" column="status"/>
+        <result property="isDel" column="is_del"/>
+        <result property="viewsNum" column="views_num"/>
+        <result property="reprintUrl" column="reprint_url"/>
+        <result property="author" column="author"/>
+        <result property="newType" column="new_type"/>
+        <result property="newUrl" column="new_url"/>
+        <result property="releaseTime" column="release_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectColumnNewsVo">
+        select news_id,
+               news_title,
+               news_image,
+               news_content,
+               is_rotation,
+               is_top,
+               status,
+               is_del,
+               views_num,
+               reprint_url,
+               author,
+               new_type,
+               new_url,
+               release_time,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from column_news
+    </sql>
+
+    <select id="selectColumnNewsList" parameterType="ColumnNews" resultMap="ColumnNewsResult">
+        <include refid="selectColumnNewsVo"/>
+        <where>
+            <if test="newsTitle != null  and newsTitle != ''">and news_title = #{newsTitle}</if>
+            <if test="newsImage != null  and newsImage != ''">and news_image = #{newsImage}</if>
+            <if test="newsContent != null  and newsContent != ''">and news_content = #{newsContent}</if>
+            <if test="isRotation != null  and isRotation != ''">and is_rotation = #{isRotation}</if>
+            <if test="isTop != null  and isTop != ''">and is_top = #{isTop}</if>
+            <if test="status != null  and status != ''">and status = #{status}</if>
+            <if test="isDel != null  and isDel != ''">and is_del = #{isDel}</if>
+            <if test="viewsNum != null  and viewsNum != ''">and views_num = #{viewsNum}</if>
+            <if test="reprintUrl != null  and reprintUrl != ''">and reprint_url = #{reprintUrl}</if>
+            <if test="author != null  and author != ''">and author = #{author}</if>
+            <if test="newType != null  and newType != ''">and new_type = #{newType}</if>
+            <if test="newUrl != null  and newUrl != ''">and new_url = #{newUrl}</if>
+            <if test="releaseTime != null ">and release_time = #{releaseTime}</if>
+        </where>
+    </select>
+
+    <select id="selectColumnNewsByNewsId" parameterType="Long" resultMap="ColumnNewsResult">
+        <include refid="selectColumnNewsVo"/>
+        where news_id = #{newsId}
+    </select>
+
+    <insert id="insertColumnNews" parameterType="ColumnNews" useGeneratedKeys="true" keyProperty="newsId">
+        insert into column_news
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="newsTitle != null and newsTitle != ''">news_title,</if>
+            <if test="newsImage != null">news_image,</if>
+            <if test="newsContent != null">news_content,</if>
+            <if test="isRotation != null">is_rotation,</if>
+            <if test="isTop != null">is_top,</if>
+            <if test="status != null">status,</if>
+            <if test="isDel != null">is_del,</if>
+            <if test="viewsNum != null">views_num,</if>
+            <if test="reprintUrl != null">reprint_url,</if>
+            <if test="author != null">author,</if>
+            <if test="newType != null">new_type,</if>
+            <if test="newUrl != null">new_url,</if>
+            <if test="releaseTime != null">release_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="newsTitle != null and newsTitle != ''">#{newsTitle},</if>
+            <if test="newsImage != null">#{newsImage},</if>
+            <if test="newsContent != null">#{newsContent},</if>
+            <if test="isRotation != null">#{isRotation},</if>
+            <if test="isTop != null">#{isTop},</if>
+            <if test="status != null">#{status},</if>
+            <if test="isDel != null">#{isDel},</if>
+            <if test="viewsNum != null">#{viewsNum},</if>
+            <if test="reprintUrl != null">#{reprintUrl},</if>
+            <if test="author != null">#{author},</if>
+            <if test="newType != null">#{newType},</if>
+            <if test="newUrl != null">#{newUrl},</if>
+            <if test="releaseTime != null">#{releaseTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateColumnNews" parameterType="ColumnNews">
+        update column_news
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="newsTitle != null and newsTitle != ''">news_title = #{newsTitle},</if>
+            <if test="newsImage != null">news_image = #{newsImage},</if>
+            <if test="newsContent != null">news_content = #{newsContent},</if>
+            <if test="isRotation != null">is_rotation = #{isRotation},</if>
+            <if test="isTop != null">is_top = #{isTop},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="viewsNum != null">views_num = #{viewsNum},</if>
+            <if test="reprintUrl != null">reprint_url = #{reprintUrl},</if>
+            <if test="author != null">author = #{author},</if>
+            <if test="newType != null">new_type = #{newType},</if>
+            <if test="newUrl != null">new_url = #{newUrl},</if>
+            <if test="releaseTime != null">release_time = #{releaseTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where news_id = #{newsId}
+    </update>
+
+    <delete id="deleteColumnNewsByNewsId" parameterType="Long">
+        delete
+        from column_news
+        where news_id = #{newsId}
+    </delete>
+
+    <delete id="deleteColumnNewsByNewsIds" parameterType="String">
+        delete from column_news where news_id in
+        <foreach item="newsId" collection="array" open="(" separator="," close=")">
+            #{newsId}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 1
ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="noticeType"     column="notice_type"     />
         <result property="noticeContent"  column="notice_content"  />
         <result property="status"         column="status"          />
+        <result property="address"         column="address"          />
         <result property="createBy"       column="create_by"       />
         <result property="createTime"     column="create_time"     />
         <result property="updateBy"       column="update_by"       />
@@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     
     <sql id="selectNoticeVo">
-        select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark 
+        select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status,address, create_by, create_time, update_by, update_time, remark
 		from sys_notice
     </sql>
     
@@ -48,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
 			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
 			<if test="status != null and status != '' ">status, </if>
+			<if test="address != null and address != '' ">address, </if>
 			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			create_time
@@ -56,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
 			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
 			<if test="status != null and status != ''">#{status}, </if>
+			<if test="address != null and address != ''">#{address}, </if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			sysdate()
@@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
             <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
             <if test="status != null and status != ''">status = #{status}, </if>
+            <if test="address != null and address != ''">address = #{address}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
         </set>