浏览代码

新增校园新闻

Administrator 2 年之前
父节点
当前提交
61f363294f

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XiaoyuanNoticeController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+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.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+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.system.domain.XiaoyuanNotice;
+import com.ruoyi.system.service.IXiaoyuanNoticeService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 校园新闻Controller
+ * 
+ * @author boman
+ * @date 2023-06-05
+ */
+@RestController
+@RequestMapping("/xiaoYuan/notice")
+public class XiaoyuanNoticeController extends BaseController
+{
+    @Autowired
+    private IXiaoyuanNoticeService xiaoyuanNoticeService;
+
+    /**
+     * 查询校园新闻列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(XiaoyuanNotice xiaoyuanNotice)
+    {
+        startPage();
+        List<XiaoyuanNotice> list = xiaoyuanNoticeService.selectXiaoyuanNoticeList(xiaoyuanNotice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出校园新闻列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:export')")
+    @Log(title = "校园新闻", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, XiaoyuanNotice xiaoyuanNotice)
+    {
+        List<XiaoyuanNotice> list = xiaoyuanNoticeService.selectXiaoyuanNoticeList(xiaoyuanNotice);
+        ExcelUtil<XiaoyuanNotice> util = new ExcelUtil<XiaoyuanNotice>(XiaoyuanNotice.class);
+        util.exportExcel(response, list, "校园新闻数据");
+    }
+
+    /**
+     * 获取校园新闻详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:query')")
+    @GetMapping(value = "/{noticeId}")
+    public AjaxResult getInfo(@PathVariable("noticeId") Integer noticeId)
+    {
+        return success(xiaoyuanNoticeService.selectXiaoyuanNoticeByNoticeId(noticeId));
+    }
+
+    /**
+     * 新增校园新闻
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:add')")
+    @Log(title = "校园新闻", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody XiaoyuanNotice xiaoyuanNotice)
+    {
+        return toAjax(xiaoyuanNoticeService.insertXiaoyuanNotice(xiaoyuanNotice));
+    }
+
+    /**
+     * 修改校园新闻
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
+    @Log(title = "校园新闻", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody XiaoyuanNotice xiaoyuanNotice)
+    {
+        return toAjax(xiaoyuanNoticeService.updateXiaoyuanNotice(xiaoyuanNotice));
+    }
+
+    /**
+     * 删除校园新闻
+     */
+    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
+    @Log(title = "校园新闻", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{noticeIds}")
+    public AjaxResult remove(@PathVariable Integer[] noticeIds)
+    {
+        return toAjax(xiaoyuanNoticeService.deleteXiaoyuanNoticeByNoticeIds(noticeIds));
+    }
+}

+ 168 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/XiaoyuanNotice.java

@@ -0,0 +1,168 @@
+package com.ruoyi.system.domain;
+
+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;
+
+/**
+ * 校园新闻对象 xiaoyuan_notice
+ * 
+ * @author boman
+ * @date 2023-06-05
+ */
+public class XiaoyuanNotice extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 新闻ID */
+    private Integer noticeId;
+
+    /** 新闻缩略图 */
+    @Excel(name = "新闻缩略图")
+    private String image;
+
+    /** 新闻标题 */
+    @Excel(name = "新闻标题")
+    private String noticeTitle;
+
+    /** 新闻类型(1系统通知 2代办通知) */
+    @Excel(name = "新闻类型", readConverterExp = "1=系统通知,2=代办通知")
+    private String noticeType;
+
+    /** 新闻内容 */
+    @Excel(name = "新闻内容")
+    private String noticeContent;
+
+    /** 新闻状态(0未读 1已读) */
+    @Excel(name = "新闻状态", readConverterExp = "0=未读,1=已读")
+    private String status;
+
+    /** 隐私种类 0:全部 1:本班 2:仅自己 */
+    @Excel(name = "隐私种类 0:全部 1:本班 2:仅自己")
+    private String type;
+
+    /** 发件人id */
+    @Excel(name = "发件人id")
+    private String senderId;
+
+    /** 发件人姓名 */
+    @Excel(name = "发件人姓名")
+    private String senderName;
+
+    /** 发件人班级id */
+    @Excel(name = "发件人班级id")
+    private String senderDept;
+
+    public void setNoticeId(Integer noticeId) 
+    {
+        this.noticeId = noticeId;
+    }
+
+    public Integer getNoticeId() 
+    {
+        return noticeId;
+    }
+    public void setImage(String image) 
+    {
+        this.image = image;
+    }
+
+    public String getImage() 
+    {
+        return image;
+    }
+    public void setNoticeTitle(String noticeTitle) 
+    {
+        this.noticeTitle = noticeTitle;
+    }
+
+    public String getNoticeTitle() 
+    {
+        return noticeTitle;
+    }
+    public void setNoticeType(String noticeType) 
+    {
+        this.noticeType = noticeType;
+    }
+
+    public String getNoticeType() 
+    {
+        return noticeType;
+    }
+    public void setNoticeContent(String noticeContent) 
+    {
+        this.noticeContent = noticeContent;
+    }
+
+    public String getNoticeContent() 
+    {
+        return noticeContent;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setSenderId(String senderId) 
+    {
+        this.senderId = senderId;
+    }
+
+    public String getSenderId() 
+    {
+        return senderId;
+    }
+    public void setSenderName(String senderName) 
+    {
+        this.senderName = senderName;
+    }
+
+    public String getSenderName() 
+    {
+        return senderName;
+    }
+    public void setSenderDept(String senderDept) 
+    {
+        this.senderDept = senderDept;
+    }
+
+    public String getSenderDept() 
+    {
+        return senderDept;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("noticeId", getNoticeId())
+            .append("image", getImage())
+            .append("noticeTitle", getNoticeTitle())
+            .append("noticeType", getNoticeType())
+            .append("noticeContent", getNoticeContent())
+            .append("status", getStatus())
+            .append("type", getType())
+            .append("senderId", getSenderId())
+            .append("senderName", getSenderName())
+            .append("senderDept", getSenderDept())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/XiaoyuanNoticeMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.XiaoyuanNotice;
+
+/**
+ * 校园新闻Mapper接口
+ * 
+ * @author boman
+ * @date 2023-06-05
+ */
+public interface XiaoyuanNoticeMapper 
+{
+    /**
+     * 查询校园新闻
+     * 
+     * @param noticeId 校园新闻主键
+     * @return 校园新闻
+     */
+    public XiaoyuanNotice selectXiaoyuanNoticeByNoticeId(Integer noticeId);
+
+    /**
+     * 查询校园新闻列表
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 校园新闻集合
+     */
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeList(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 新增校园新闻
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    public int insertXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 修改校园新闻
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    public int updateXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 删除校园新闻
+     * 
+     * @param noticeId 校园新闻主键
+     * @return 结果
+     */
+    public int deleteXiaoyuanNoticeByNoticeId(Integer noticeId);
+
+    /**
+     * 批量删除校园新闻
+     * 
+     * @param noticeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteXiaoyuanNoticeByNoticeIds(Integer[] noticeIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IXiaoyuanNoticeService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.XiaoyuanNotice;
+
+/**
+ * 校园新闻Service接口
+ * 
+ * @author boman
+ * @date 2023-06-05
+ */
+public interface IXiaoyuanNoticeService 
+{
+    /**
+     * 查询校园新闻
+     * 
+     * @param noticeId 校园新闻主键
+     * @return 校园新闻
+     */
+    public XiaoyuanNotice selectXiaoyuanNoticeByNoticeId(Integer noticeId);
+
+    /**
+     * 查询校园新闻列表
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 校园新闻集合
+     */
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeList(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 新增校园新闻
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    public int insertXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 修改校园新闻
+     * 
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    public int updateXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice);
+
+    /**
+     * 批量删除校园新闻
+     * 
+     * @param noticeIds 需要删除的校园新闻主键集合
+     * @return 结果
+     */
+    public int deleteXiaoyuanNoticeByNoticeIds(Integer[] noticeIds);
+
+    /**
+     * 删除校园新闻信息
+     * 
+     * @param noticeId 校园新闻主键
+     * @return 结果
+     */
+    public int deleteXiaoyuanNoticeByNoticeId(Integer noticeId);
+}

+ 144 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/XiaoyuanNoticeServiceImpl.java

@@ -0,0 +1,144 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import java.util.Set;
+
+import com.ruoyi.common.core.domain.entity.FormalParentsStudent;
+import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.mapper.FormalParentsStudentMapper;
+import com.ruoyi.system.mapper.FormalTeacherClassMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.XiaoyuanNoticeMapper;
+import com.ruoyi.system.domain.XiaoyuanNotice;
+import com.ruoyi.system.service.IXiaoyuanNoticeService;
+
+import javax.annotation.Resource;
+
+/**
+ * 校园新闻Service业务层处理
+ *
+ * @author boman
+ * @date 2023-06-05
+ */
+@Service
+public class XiaoyuanNoticeServiceImpl implements IXiaoyuanNoticeService {
+    @Autowired
+    private XiaoyuanNoticeMapper xiaoyuanNoticeMapper;
+    @Autowired
+    private FormalTeacherClassMapper formalTeacherClassMapper;
+    @Autowired
+    private FormalParentsStudentMapper formalParentsStudentMapper;
+
+    /**
+     * 查询校园新闻
+     *
+     * @param noticeId 校园新闻主键
+     * @return 校园新闻
+     */
+    @Override
+    public XiaoyuanNotice selectXiaoyuanNoticeByNoticeId(Integer noticeId) {
+        return xiaoyuanNoticeMapper.selectXiaoyuanNoticeByNoticeId(noticeId);
+    }
+
+    /**
+     * 查询校园新闻列表
+     *
+     * @param xiaoyuanNotice 校园新闻
+     * @return 校园新闻
+     */
+    @Override
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeList(XiaoyuanNotice xiaoyuanNotice) {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        xiaoyuanNotice.setSenderId(user.getUserId().toString());
+        Set<String> permissions = SecurityUtils.getLoginUser().getPermissions();
+        String classId = "";
+        for (String permission : permissions) {
+            if ("teacher".equals(permission)) {
+                FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
+                formalTeacherClass.setTeacherId(user.getUserId());
+                List<FormalTeacherClass> formalTeacherClasses = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
+                if (formalTeacherClasses != null && formalTeacherClasses.size() > 0) {
+                    for (FormalTeacherClass teacherClass : formalTeacherClasses) {
+                        classId = teacherClass.getClassId() + ",";
+                    }
+                }
+            }
+            if ("parents".equals(permission)){
+                FormalParentsStudent formalParentsStudent = new FormalParentsStudent();
+                formalParentsStudent.setParentsId(user.getUserId());
+                List<FormalParentsStudent> formalParentsStudents = formalParentsStudentMapper.selectFormalParentsStudentList(formalParentsStudent);
+                for (FormalParentsStudent parentsStudent : formalParentsStudents) {
+                    classId = parentsStudent.getClassId() + ",";
+                }
+            }
+        }
+        //查询出所有班级id
+        classId = classId.substring(0, classId.length() - 1);
+        xiaoyuanNotice.setSenderDept(classId);
+        return xiaoyuanNoticeMapper.selectXiaoyuanNoticeList(xiaoyuanNotice);
+    }
+
+    /**
+     * 新增校园新闻
+     *
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    @Override
+    public int insertXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice) {
+        xiaoyuanNotice.setCreateTime(DateUtils.getNowDate());
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        xiaoyuanNotice.setSenderId(String.valueOf(user.getUserId()));
+        xiaoyuanNotice.setSenderName(user.getUserName());
+        String senderDept = xiaoyuanNotice.getSenderDept();
+        int result = 0;
+        if (StringUtils.isNotBlank(senderDept)){
+            String[] split = senderDept.split(",");
+            for (String deptId : split) {
+                xiaoyuanNotice.setSenderDept(deptId);
+                result = result + xiaoyuanNoticeMapper.insertXiaoyuanNotice(xiaoyuanNotice)
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 修改校园新闻
+     *
+     * @param xiaoyuanNotice 校园新闻
+     * @return 结果
+     */
+    @Override
+    public int updateXiaoyuanNotice(XiaoyuanNotice xiaoyuanNotice) {
+        xiaoyuanNotice.setUpdateTime(DateUtils.getNowDate());
+        return xiaoyuanNoticeMapper.updateXiaoyuanNotice(xiaoyuanNotice);
+    }
+
+    /**
+     * 批量删除校园新闻
+     *
+     * @param noticeIds 需要删除的校园新闻主键
+     * @return 结果
+     */
+    @Override
+    public int deleteXiaoyuanNoticeByNoticeIds(Integer[] noticeIds) {
+        return xiaoyuanNoticeMapper.deleteXiaoyuanNoticeByNoticeIds(noticeIds);
+    }
+
+    /**
+     * 删除校园新闻信息
+     *
+     * @param noticeId 校园新闻主键
+     * @return 结果
+     */
+    @Override
+    public int deleteXiaoyuanNoticeByNoticeId(Integer noticeId) {
+        return xiaoyuanNoticeMapper.deleteXiaoyuanNoticeByNoticeId(noticeId);
+    }
+}

+ 167 - 0
ruoyi-system/src/main/resources/mapper/system/XiaoyuanNoticeMapper.xml

@@ -0,0 +1,167 @@
+<?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.system.mapper.XiaoyuanNoticeMapper">
+    
+    <resultMap type="XiaoyuanNotice" id="XiaoyuanNoticeResult">
+        <result property="noticeId"    column="notice_id"    />
+        <result property="image"    column="image"    />
+        <result property="noticeTitle"    column="notice_title"    />
+        <result property="noticeType"    column="notice_type"    />
+        <result property="noticeContent"    column="notice_content"    />
+        <result property="status"    column="status"    />
+        <result property="type"    column="type"    />
+        <result property="senderId"    column="sender_id"    />
+        <result property="senderName"    column="sender_name"    />
+        <result property="senderDept"    column="sender_dept"    />
+        <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="selectXiaoyuanNoticeVo">
+        select notice_id, image, notice_title, notice_type, notice_content, status, type, sender_id, sender_name, sender_dept, create_by, create_time, update_by, update_time, remark from xiaoyuan_notice
+    </sql>
+
+    <select id="selectXiaoyuanNoticeList" parameterType="XiaoyuanNotice" resultMap="XiaoyuanNoticeResult">
+SELECT
+	notice_id,
+	image,
+	notice_title,
+	notice_type,
+	notice_content,
+	STATUS,
+	type,
+	sender_id,
+	sender_name,
+	sender_dept,
+	create_by,
+	create_time,
+	update_by,
+	update_time,
+	remark
+FROM
+	xiaoyuan_notice
+WHERE
+	type = '0'
+	UNION
+SELECT
+	notice_id,
+	image,
+	notice_title,
+	notice_type,
+	notice_content,
+	STATUS,
+	type,
+	sender_id,
+	sender_name,
+	sender_dept,
+	create_by,
+	create_time,
+	update_by,
+	update_time,
+	remark
+FROM
+	xiaoyuan_notice
+WHERE
+	find_in_set( sender_dept, ${senderDept} )
+	AND type = '1' UNION
+SELECT
+	notice_id,
+	image,
+	notice_title,
+	notice_type,
+	notice_content,
+	STATUS,
+	type,
+	sender_id,
+	sender_name,
+	sender_dept,
+	create_by,
+	create_time,
+	update_by,
+	update_time,
+	remark
+FROM
+	xiaoyuan_notice
+WHERE
+	sender_id = ${senderId}
+	AND type = '2'
+    </select>
+    
+    <select id="selectXiaoyuanNoticeByNoticeId" parameterType="Integer" resultMap="XiaoyuanNoticeResult">
+        <include refid="selectXiaoyuanNoticeVo"/>
+        where notice_id = #{noticeId}
+    </select>
+        
+    <insert id="insertXiaoyuanNotice" parameterType="XiaoyuanNotice" useGeneratedKeys="true" keyProperty="noticeId">
+        insert into xiaoyuan_notice
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="image != null">image,</if>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
+            <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="type != null and type != ''">type,</if>
+            <if test="senderId != null">sender_id,</if>
+            <if test="senderName != null">sender_name,</if>
+            <if test="senderDept != null">sender_dept,</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="image != null">#{image},</if>
+            <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
+            <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="type != null and type != ''">#{type},</if>
+            <if test="senderId != null">#{senderId},</if>
+            <if test="senderName != null">#{senderName},</if>
+            <if test="senderDept != null">#{senderDept},</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="updateXiaoyuanNotice" parameterType="XiaoyuanNotice">
+        update xiaoyuan_notice
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="image != null">image = #{image},</if>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
+            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
+            <if test="noticeContent != null and noticeContent != ''">notice_content = #{noticeContent},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="senderId != null">sender_id = #{senderId},</if>
+            <if test="senderName != null">sender_name = #{senderName},</if>
+            <if test="senderDept != null">sender_dept = #{senderDept},</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 notice_id = #{noticeId}
+    </update>
+
+    <delete id="deleteXiaoyuanNoticeByNoticeId" parameterType="Integer">
+        delete from xiaoyuan_notice where notice_id = #{noticeId}
+    </delete>
+
+    <delete id="deleteXiaoyuanNoticeByNoticeIds" parameterType="String">
+        delete from xiaoyuan_notice where notice_id in 
+        <foreach item="noticeId" collection="array" open="(" separator="," close=")">
+            #{noticeId}
+        </foreach>
+    </delete>
+</mapper>