ソースを参照

fix 新增新闻信息

Administrator 1 年間 前
コミット
ed784bdcd9

+ 102 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/news/BomanNewsController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.web.controller.news;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.news.service.IBomanNewsService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * boman_newsController
+ * 
+ * @author boman
+ * @date 2024-01-18
+ */
+@RestController
+@RequestMapping("/new/news")
+public class BomanNewsController extends BaseController
+{
+    @Autowired
+    private IBomanNewsService bomanNewsService;
+
+    /**
+     * 查询boman_news列表
+     */
+    //@PreAuthorize("@ss.hasPermi('new:news:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(com.ruoyi.news.domain.BomanNews bomanNews)
+    {
+        startPage();
+        List<com.ruoyi.news.domain.BomanNews> list = bomanNewsService.selectBomanNewsList(bomanNews);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出boman_news列表
+     */
+    @PreAuthorize("@ss.hasPermi('new:news:export')")
+    @Log(title = "boman_news", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, com.ruoyi.news.domain.BomanNews bomanNews)
+    {
+        List<com.ruoyi.news.domain.BomanNews> list = bomanNewsService.selectBomanNewsList(bomanNews);
+        ExcelUtil<com.ruoyi.news.domain.BomanNews> util = new ExcelUtil<com.ruoyi.news.domain.BomanNews>(com.ruoyi.news.domain.BomanNews.class);
+        util.exportExcel(response, list, "boman_news数据");
+    }
+
+    /**
+     * 获取boman_news详细信息
+     */
+    //@PreAuthorize("@ss.hasPermi('new:news:query')")
+    @GetMapping(value = "/{newsId}")
+    public AjaxResult getInfo(@PathVariable("newsId") Long newsId)
+    {
+        return success(bomanNewsService.selectBomanNewsByNewsId(newsId));
+    }
+
+    /**
+     * 新增boman_news
+     */
+    @PreAuthorize("@ss.hasPermi('new:news:add')")
+    @Log(title = "boman_news", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody com.ruoyi.news.domain.BomanNews bomanNews)
+    {
+        return toAjax(bomanNewsService.insertBomanNews(bomanNews));
+    }
+
+    /**
+     * 修改boman_news
+     */
+    @PreAuthorize("@ss.hasPermi('new:news:edit')")
+    @Log(title = "boman_news", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody com.ruoyi.news.domain.BomanNews bomanNews)
+    {
+        return toAjax(bomanNewsService.updateBomanNews(bomanNews));
+    }
+
+    /**
+     * 删除boman_news
+     */
+    @PreAuthorize("@ss.hasPermi('new:news:remove')")
+    @Log(title = "boman_news", businessType = BusinessType.DELETE)
+	@GetMapping("/delete/{newsIds}")
+    public AjaxResult remove(@PathVariable Long[] newsIds)
+    {
+        return toAjax(bomanNewsService.deleteBomanNewsByNewsIds(newsIds));
+    }
+}

+ 1 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -112,6 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                 .antMatchers("/login", "/register", "/captchaImage").permitAll()
+                .antMatchers("/new/news/**", "/register", "/captchaImage").permitAll()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 282 - 0
ruoyi-system/src/main/java/com/ruoyi/news/domain/BomanNews.java

@@ -0,0 +1,282 @@
+package com.ruoyi.news.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * boman_news对象 boman_news
+ * 
+ * @author boman
+ * @date 2024-01-18
+ */
+public class BomanNews extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 新闻编号 */
+    private Long newsId;
+
+    /** 所属专题 */
+    @Excel(name = "所属专题")
+    private Long topicId;
+
+    /** 文章标题 */
+    @Excel(name = "文章标题")
+    private String title;
+
+    /** 文章来源 */
+    @Excel(name = "文章来源")
+    private String source;
+
+    /** 文章原作者 */
+    @Excel(name = "文章原作者")
+    private String author;
+
+    /** 转载来源网址 */
+    @Excel(name = "转载来源网址")
+    private String fromUrl;
+
+    /** 封面图 */
+    @Excel(name = "封面图")
+    private String image;
+
+    /** 关键字 */
+    @Excel(name = "关键字")
+    private String keywords;
+
+    /** 简介 */
+    @Excel(name = "简介")
+    private String description;
+
+    /** 类型(1:普通,2:热门...) */
+    @Excel(name = "类型(1:普通,2:热门...)")
+    private Integer type;
+
+    /** 是否允许评论(0:不允许,1:允许) */
+    @Excel(name = "是否允许评论(0:不允许,1:允许)")
+    private String allowcomments;
+
+    /** 状态(-1:不通过,0未审核,1:通过) */
+    @Excel(name = "状态(-1:不通过,0未审核,1:通过)")
+    private String status;
+
+    /** 内容 */
+    @Excel(name = "内容")
+    private String content;
+
+    /** 发布人id */
+    @Excel(name = "发布人id")
+    private Integer userId;
+
+    /** 阅读数量 */
+    @Excel(name = "阅读数量")
+    private Integer readnumber;
+
+    /** 置顶等级 */
+    @Excel(name = "置顶等级")
+    private Long top;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long orders;
+
+    /** 发布时间 */
+    @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 setTopicId(Long topicId) 
+    {
+        this.topicId = topicId;
+    }
+
+    public Long getTopicId() 
+    {
+        return topicId;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+    public void setSource(String source) 
+    {
+        this.source = source;
+    }
+
+    public String getSource() 
+    {
+        return source;
+    }
+    public void setAuthor(String author) 
+    {
+        this.author = author;
+    }
+
+    public String getAuthor() 
+    {
+        return author;
+    }
+    public void setFromUrl(String fromUrl) 
+    {
+        this.fromUrl = fromUrl;
+    }
+
+    public String getFromUrl() 
+    {
+        return fromUrl;
+    }
+    public void setImage(String image) 
+    {
+        this.image = image;
+    }
+
+    public String getImage() 
+    {
+        return image;
+    }
+    public void setKeywords(String keywords) 
+    {
+        this.keywords = keywords;
+    }
+
+    public String getKeywords() 
+    {
+        return keywords;
+    }
+    public void setDescription(String description) 
+    {
+        this.description = description;
+    }
+
+    public String getDescription() 
+    {
+        return description;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+    public void setAllowcomments(String allowcomments) 
+    {
+        this.allowcomments = allowcomments;
+    }
+
+    public String getAllowcomments() 
+    {
+        return allowcomments;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setUserId(Integer userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Integer getUserId() 
+    {
+        return userId;
+    }
+    public void setReadnumber(Integer readnumber) 
+    {
+        this.readnumber = readnumber;
+    }
+
+    public Integer getReadnumber() 
+    {
+        return readnumber;
+    }
+    public void setTop(Long top) 
+    {
+        this.top = top;
+    }
+
+    public Long getTop() 
+    {
+        return top;
+    }
+    public void setOrders(Long orders) 
+    {
+        this.orders = orders;
+    }
+
+    public Long getOrders() 
+    {
+        return orders;
+    }
+    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("topicId", getTopicId())
+            .append("title", getTitle())
+            .append("source", getSource())
+            .append("author", getAuthor())
+            .append("fromUrl", getFromUrl())
+            .append("image", getImage())
+            .append("keywords", getKeywords())
+            .append("description", getDescription())
+            .append("type", getType())
+            .append("allowcomments", getAllowcomments())
+            .append("status", getStatus())
+            .append("content", getContent())
+            .append("userId", getUserId())
+            .append("readnumber", getReadnumber())
+            .append("top", getTop())
+            .append("orders", getOrders())
+            .append("releaseTime", getReleaseTime())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/news/mapper/BomanNewsMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.news.mapper;
+
+
+import com.ruoyi.news.domain.BomanNews;
+
+import java.util.List;
+
+/**
+ * boman_newsMapper接口
+ * 
+ * @author boman
+ * @date 2024-01-18
+ */
+public interface BomanNewsMapper 
+{
+    /**
+     * 查询boman_news
+     * 
+     * @param newsId boman_news主键
+     * @return boman_news
+     */
+    public BomanNews selectBomanNewsByNewsId(Long newsId);
+
+    /**
+     * 查询boman_news列表
+     * 
+     * @param bomanNews boman_news
+     * @return boman_news集合
+     */
+    public List<BomanNews> selectBomanNewsList(BomanNews bomanNews);
+
+    /**
+     * 新增boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    public int insertBomanNews(BomanNews bomanNews);
+
+    /**
+     * 修改boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    public int updateBomanNews(BomanNews bomanNews);
+
+    /**
+     * 删除boman_news
+     * 
+     * @param newsId boman_news主键
+     * @return 结果
+     */
+    public int deleteBomanNewsByNewsId(Long newsId);
+
+    /**
+     * 批量删除boman_news
+     * 
+     * @param newsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBomanNewsByNewsIds(Long[] newsIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/news/service/IBomanNewsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.news.service;
+
+
+import com.ruoyi.news.domain.BomanNews;
+import java.util.List;
+
+/**
+ * boman_newsService接口
+ * 
+ * @author boman
+ * @date 2024-01-18
+ */
+public interface IBomanNewsService 
+{
+    /**
+     * 查询boman_news
+     * 
+     * @param newsId boman_news主键
+     * @return boman_news
+     */
+    public BomanNews selectBomanNewsByNewsId(Long newsId);
+
+    /**
+     * 查询boman_news列表
+     * 
+     * @param bomanNews boman_news
+     * @return boman_news集合
+     */
+    public List<BomanNews> selectBomanNewsList(BomanNews bomanNews);
+
+    /**
+     * 新增boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    public int insertBomanNews(BomanNews bomanNews);
+
+    /**
+     * 修改boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    public int updateBomanNews(BomanNews bomanNews);
+
+    /**
+     * 批量删除boman_news
+     * 
+     * @param newsIds 需要删除的boman_news主键集合
+     * @return 结果
+     */
+    public int deleteBomanNewsByNewsIds(Long[] newsIds);
+
+    /**
+     * 删除boman_news信息
+     * 
+     * @param newsId boman_news主键
+     * @return 结果
+     */
+    public int deleteBomanNewsByNewsId(Long newsId);
+}

+ 98 - 0
ruoyi-system/src/main/java/com/ruoyi/news/service/impl/BomanNewsServiceImpl.java

@@ -0,0 +1,98 @@
+package com.ruoyi.news.service.impl;
+
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.news.domain.BomanNews;
+import com.ruoyi.news.mapper.BomanNewsMapper;
+import com.ruoyi.news.service.IBomanNewsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.List;
+
+
+/**
+ * boman_newsService业务层处理
+ * 
+ * @author boman
+ * @date 2024-01-18
+ */
+@Service
+public class BomanNewsServiceImpl implements IBomanNewsService
+{
+    @Autowired
+    private BomanNewsMapper bomanNewsMapper;
+
+    /**
+     * 查询boman_news
+     * 
+     * @param newsId boman_news主键
+     * @return boman_news
+     */
+    @Override
+    public BomanNews selectBomanNewsByNewsId(Long newsId)
+    {
+        return bomanNewsMapper.selectBomanNewsByNewsId(newsId);
+    }
+
+    /**
+     * 查询boman_news列表
+     * 
+     * @param bomanNews boman_news
+     * @return boman_news
+     */
+    @Override
+    public List<BomanNews> selectBomanNewsList(BomanNews bomanNews)
+    {
+        return bomanNewsMapper.selectBomanNewsList(bomanNews);
+    }
+
+    /**
+     * 新增boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    @Override
+    public int insertBomanNews(BomanNews bomanNews)
+    {
+        bomanNews.setCreateTime(DateUtils.getNowDate());
+        return bomanNewsMapper.insertBomanNews(bomanNews);
+    }
+
+    /**
+     * 修改boman_news
+     * 
+     * @param bomanNews boman_news
+     * @return 结果
+     */
+    @Override
+    public int updateBomanNews(BomanNews bomanNews)
+    {
+        bomanNews.setUpdateTime(DateUtils.getNowDate());
+        return bomanNewsMapper.updateBomanNews(bomanNews);
+    }
+
+    /**
+     * 批量删除boman_news
+     * 
+     * @param newsIds 需要删除的boman_news主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBomanNewsByNewsIds(Long[] newsIds)
+    {
+        return bomanNewsMapper.deleteBomanNewsByNewsIds(newsIds);
+    }
+
+    /**
+     * 删除boman_news信息
+     * 
+     * @param newsId boman_news主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBomanNewsByNewsId(Long newsId)
+    {
+        return bomanNewsMapper.deleteBomanNewsByNewsId(newsId);
+    }
+}

+ 153 - 0
ruoyi-system/src/main/resources/mapper.news/BomanNewsMapper.xml

@@ -0,0 +1,153 @@
+<?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.news.mapper.BomanNewsMapper">
+    
+    <resultMap type="BomanNews" id="BomanNewsResult">
+        <result property="newsId"    column="news_id"    />
+        <result property="topicId"    column="topic_id"    />
+        <result property="title"    column="title"    />
+        <result property="source"    column="source"    />
+        <result property="author"    column="author"    />
+        <result property="fromUrl"    column="from_url"    />
+        <result property="image"    column="image"    />
+        <result property="keywords"    column="keywords"    />
+        <result property="description"    column="description"    />
+        <result property="type"    column="type"    />
+        <result property="allowcomments"    column="allowcomments"    />
+        <result property="status"    column="status"    />
+        <result property="content"    column="content"    />
+        <result property="userId"    column="user_id"    />
+        <result property="readnumber"    column="readnumber"    />
+        <result property="top"    column="top"    />
+        <result property="orders"    column="orders"    />
+        <result property="releaseTime"    column="release_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectBomanNewsVo">
+        select news_id, topic_id, title, source, author, from_url, image, keywords, description, type, allowcomments, status, content, user_id, readnumber, top, orders, release_time, create_time, create_by, update_by, update_time from boman_news
+    </sql>
+
+    <select id="selectBomanNewsList" parameterType="BomanNews" resultMap="BomanNewsResult">
+        <include refid="selectBomanNewsVo"/>
+        <where>  
+            <if test="topicId != null "> and topic_id = #{topicId}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="source != null  and source != ''"> and source = #{source}</if>
+            <if test="author != null  and author != ''"> and author = #{author}</if>
+            <if test="fromUrl != null  and fromUrl != ''"> and from_url = #{fromUrl}</if>
+            <if test="image != null  and image != ''"> and image = #{image}</if>
+            <if test="keywords != null  and keywords != ''"> and keywords = #{keywords}</if>
+            <if test="description != null  and description != ''"> and description = #{description}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="allowcomments != null  and allowcomments != ''"> and allowcomments = #{allowcomments}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="readnumber != null "> and readnumber = #{readnumber}</if>
+            <if test="top != null "> and top = #{top}</if>
+            <if test="orders != null "> and orders = #{orders}</if>
+            <if test="releaseTime != null "> and release_time = #{releaseTime}</if>
+        </where>
+        order by release_time DESC
+    </select>
+    
+    <select id="selectBomanNewsByNewsId" parameterType="Long" resultMap="BomanNewsResult">
+        <include refid="selectBomanNewsVo"/>
+        where news_id = #{newsId}
+    </select>
+        
+    <insert id="insertBomanNews" parameterType="BomanNews" useGeneratedKeys="true" keyProperty="newsId">
+        insert into boman_news
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="topicId != null">topic_id,</if>
+            <if test="title != null">title,</if>
+            <if test="source != null">source,</if>
+            <if test="author != null">author,</if>
+            <if test="fromUrl != null">from_url,</if>
+            <if test="image != null">image,</if>
+            <if test="keywords != null">keywords,</if>
+            <if test="description != null">description,</if>
+            <if test="type != null">type,</if>
+            <if test="allowcomments != null">allowcomments,</if>
+            <if test="status != null">status,</if>
+            <if test="content != null">content,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="readnumber != null">readnumber,</if>
+            <if test="top != null">top,</if>
+            <if test="orders != null">orders,</if>
+            <if test="releaseTime != null">release_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="topicId != null">#{topicId},</if>
+            <if test="title != null">#{title},</if>
+            <if test="source != null">#{source},</if>
+            <if test="author != null">#{author},</if>
+            <if test="fromUrl != null">#{fromUrl},</if>
+            <if test="image != null">#{image},</if>
+            <if test="keywords != null">#{keywords},</if>
+            <if test="description != null">#{description},</if>
+            <if test="type != null">#{type},</if>
+            <if test="allowcomments != null">#{allowcomments},</if>
+            <if test="status != null">#{status},</if>
+            <if test="content != null">#{content},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="readnumber != null">#{readnumber},</if>
+            <if test="top != null">#{top},</if>
+            <if test="orders != null">#{orders},</if>
+            <if test="releaseTime != null">#{releaseTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBomanNews" parameterType="BomanNews">
+        update boman_news
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="topicId != null">topic_id = #{topicId},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="author != null">author = #{author},</if>
+            <if test="fromUrl != null">from_url = #{fromUrl},</if>
+            <if test="image != null">image = #{image},</if>
+            <if test="keywords != null">keywords = #{keywords},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="allowcomments != null">allowcomments = #{allowcomments},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="readnumber != null">readnumber = #{readnumber},</if>
+            <if test="top != null">top = #{top},</if>
+            <if test="orders != null">orders = #{orders},</if>
+            <if test="releaseTime != null">release_time = #{releaseTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where news_id = #{newsId}
+    </update>
+
+    <delete id="deleteBomanNewsByNewsId" parameterType="Long">
+        delete from boman_news where news_id = #{newsId}
+    </delete>
+
+    <delete id="deleteBomanNewsByNewsIds" parameterType="String">
+        delete from boman_news where news_id in 
+        <foreach item="newsId" collection="array" open="(" separator="," close=")">
+            #{newsId}
+        </foreach>
+    </delete>
+</mapper>