Browse Source

fix 消息通知

Administrator 1 year ago
parent
commit
c4ecb7cbb6

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/notice/ZxNoticeController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.notice;
+
+import javax.servlet.http.HttpServletResponse;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.notice.ZxNotice;
+import com.ruoyi.system.service.IZxNoticeService;
+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.core.page.TableDataInfo;
+
+import java.util.List;
+
+/**
+ * 政协通知公告Controller
+ *
+ * @author boman
+ * @date 2024-03-05
+ */
+@RestController
+@RequestMapping("/zxNotice/notice")
+public class ZxNoticeController extends BaseController
+{
+    @Autowired
+    private IZxNoticeService zxNoticeService;
+
+/**
+ * 查询政协通知公告列表
+ */
+@PreAuthorize("@ss.hasPermi('zxNotice:notice:list')")
+@GetMapping("/list")
+    public TableDataInfo list(ZxNotice zxNotice)
+    {
+        startPage();
+        List<ZxNotice> list = zxNoticeService.selectZxNoticeList(zxNotice);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出政协通知公告列表
+     */
+    @PreAuthorize("@ss.hasPermi('zxNotice:notice:export')")
+    @Log(title = "政协通知公告", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ZxNotice zxNotice)
+    {
+        List<ZxNotice> list = zxNoticeService.selectZxNoticeList(zxNotice);
+        ExcelUtil<ZxNotice> util = new ExcelUtil<ZxNotice>(ZxNotice.class);
+        util.exportExcel(response, list, "政协通知公告数据");
+    }
+
+    /**
+     * 获取政协通知公告详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('zxNotice:notice:query')")
+    @GetMapping(value = "/{zxNoticeId}")
+    public AjaxResult getInfo(@PathVariable("zxNoticeId") Long zxNoticeId)
+    {
+        return success(zxNoticeService.selectZxNoticeByZxNoticeId(zxNoticeId));
+    }
+
+    /**
+     * 新增政协通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('zxNotice:notice:add')")
+    @Log(title = "政协通知公告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZxNotice zxNotice)
+    {
+        return toAjax(zxNoticeService.insertZxNotice(zxNotice));
+    }
+
+    /**
+     * 修改政协通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('zxNotice:notice:edit')")
+    @Log(title = "政协通知公告", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ZxNotice zxNotice)
+    {
+        return toAjax(zxNoticeService.updateZxNotice(zxNotice));
+    }
+
+    /**
+     * 删除政协通知公告
+     */
+    @PreAuthorize("@ss.hasPermi('zxNotice:notice:remove')")
+    @Log(title = "政协通知公告", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{zxNoticeIds}")
+    public AjaxResult remove(@PathVariable Long[] zxNoticeIds)
+    {
+        return toAjax(zxNoticeService.deleteZxNoticeByZxNoticeIds(zxNoticeIds));
+    }
+}

+ 2 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -70,6 +70,6 @@ xss:
   # 过滤开关
   enabled: true
   # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
+  excludes: /system/notice,/zxNotice/notice/*
   # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*
+  urlPatterns: /system/*,/monitor/*,/tool/*,/zxNotice/*

+ 1 - 1
ruoyi-generator/src/main/resources/generator.yml

@@ -1,7 +1,7 @@
 # 代码生成
 gen:
   # 作者
-  author: ruoyi
+  author: boman
   # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
   packageName: com.ruoyi.system
   # 自动去除表前缀,默认是false

+ 186 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/notice/ZxNotice.java

@@ -0,0 +1,186 @@
+package com.ruoyi.system.domain.notice;
+
+import java.util.List;
+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;
+import org.springframework.beans.factory.annotation.Value;
+
+/**
+ * 政协通知公告对象 zx_notice
+ * 
+ * @author boman
+ * @date 2024-03-05
+ */
+public class ZxNotice extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 公告ID */
+    private Long zxNoticeId;
+
+    /** 公告标题 */
+    @Excel(name = "公告标题")
+    private String noticeTitle;
+
+    /** 公告类型(字典值) */
+    @Excel(name = "公告类型", readConverterExp = "字=典值")
+    private String noticeType;
+
+    /** 公告内容 */
+    @Excel(name = "公告内容")
+    private String noticeContent;
+
+    /** 公告状态(0正常 1关闭) */
+    @Excel(name = "公告状态", readConverterExp = "0=正常,1=关闭")
+    private String status;
+
+    /** 发布人 */
+    @Excel(name = "发布人")
+    private String issuer;
+
+    /** 发布单位 */
+    @Excel(name = "发布单位")
+    private String issuerDept;
+
+    /** 发布单位id */
+    @Excel(name = "发布单位id")
+    private Long issuerDeptId;
+
+    /** 发布时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date issuerTime;
+    /**
+     * 判断已读未读
+     */
+    @Value("N")
+    private String type;
+
+    /** 用户与政协通知公告关联信息 */
+    private List<ZxUserNotice> zxUserNoticeList;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setZxNoticeId(Long zxNoticeId)
+    {
+        this.zxNoticeId = zxNoticeId;
+    }
+
+    public Long getZxNoticeId() 
+    {
+        return zxNoticeId;
+    }
+    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 setIssuer(String issuer) 
+    {
+        this.issuer = issuer;
+    }
+
+    public String getIssuer() 
+    {
+        return issuer;
+    }
+    public void setIssuerDept(String issuerDept) 
+    {
+        this.issuerDept = issuerDept;
+    }
+
+    public String getIssuerDept() 
+    {
+        return issuerDept;
+    }
+    public void setIssuerDeptId(Long issuerDeptId) 
+    {
+        this.issuerDeptId = issuerDeptId;
+    }
+
+    public Long getIssuerDeptId() 
+    {
+        return issuerDeptId;
+    }
+    public void setIssuerTime(Date issuerTime) 
+    {
+        this.issuerTime = issuerTime;
+    }
+
+    public Date getIssuerTime() 
+    {
+        return issuerTime;
+    }
+
+    public List<ZxUserNotice> getZxUserNoticeList()
+    {
+        return zxUserNoticeList;
+    }
+
+    public void setZxUserNoticeList(List<ZxUserNotice> zxUserNoticeList)
+    {
+        this.zxUserNoticeList = zxUserNoticeList;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("zxNoticeId", getZxNoticeId())
+            .append("noticeTitle", getNoticeTitle())
+            .append("noticeType", getNoticeType())
+            .append("noticeContent", getNoticeContent())
+            .append("status", getStatus())
+            .append("issuer", getIssuer())
+            .append("issuerDept", getIssuerDept())
+            .append("issuerDeptId", getIssuerDeptId())
+            .append("issuerTime", getIssuerTime())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .append("zxUserNoticeList", getZxUserNoticeList())
+            .toString();
+    }
+}

+ 77 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/notice/ZxUserNotice.java

@@ -0,0 +1,77 @@
+package com.ruoyi.system.domain.notice;
+
+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;
+
+/**
+ * 用户与政协通知公告关联对象 zx_user_notice
+ * 
+ * @author boman
+ * @date 2024-03-05
+ */
+public class ZxUserNotice extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 用户名称 */
+    @Excel(name = "用户名称")
+    private String userName;
+    /**
+     * Y:已读
+     */
+    private String zxNoticeType;
+
+    /** 公告ID */
+    private Long zxNoticeId;
+
+    public String getZxNoticeType() {
+        return zxNoticeType;
+    }
+
+    public void setZxNoticeType(String zxNoticeType) {
+        this.zxNoticeType = zxNoticeType;
+    }
+
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setUserName(String userName) 
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName() 
+    {
+        return userName;
+    }
+    public void setZxNoticeId(Long zxNoticeId) 
+    {
+        this.zxNoticeId = zxNoticeId;
+    }
+
+    public Long getZxNoticeId() 
+    {
+        return zxNoticeId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("userId", getUserId())
+            .append("userName", getUserName())
+            .append("zxNoticeId", getZxNoticeId())
+            .append("createTime", getCreateTime())
+            .toString();
+    }
+}

+ 88 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ZxNoticeMapper.java

@@ -0,0 +1,88 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.notice.ZxNotice;
+import com.ruoyi.system.domain.notice.ZxUserNotice;
+
+import java.util.List;
+
+/**
+ * 政协通知公告Mapper接口
+ * 
+ * @author boman
+ * @date 2024-03-05
+ */
+public interface ZxNoticeMapper 
+{
+    /**
+     * 查询政协通知公告
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 政协通知公告
+     */
+    public ZxNotice selectZxNoticeByZxNoticeId(Long zxNoticeId);
+
+    /**
+     * 查询政协通知公告列表
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 政协通知公告集合
+     */
+    public List<ZxNotice> selectZxNoticeList(ZxNotice zxNotice);
+
+    /**
+     * 新增政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    public int insertZxNotice(ZxNotice zxNotice);
+
+    /**
+     * 修改政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    public int updateZxNotice(ZxNotice zxNotice);
+
+    /**
+     * 删除政协通知公告
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 结果
+     */
+    public int deleteZxNoticeByZxNoticeId(Long zxNoticeId);
+
+    /**
+     * 批量删除政协通知公告
+     * 
+     * @param zxNoticeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteZxNoticeByZxNoticeIds(Long[] zxNoticeIds);
+
+    /**
+     * 批量删除用户与政协通知公告关联
+     * 
+     * @param zxNoticeIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteZxUserNoticeByZxNoticeIds(Long[] zxNoticeIds);
+    
+    /**
+     * 批量新增用户与政协通知公告关联
+     * 
+     * @param zxUserNoticeList 用户与政协通知公告关联列表
+     * @return 结果
+     */
+    public int batchZxUserNotice(List<ZxUserNotice> zxUserNoticeList);
+    
+
+    /**
+     * 通过政协通知公告主键删除用户与政协通知公告关联信息
+     * 
+     * @param zxNoticeId 政协通知公告ID
+     * @return 结果
+     */
+    public int deleteZxUserNoticeByZxNoticeId(Long zxNoticeId);
+}

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

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.notice.ZxNotice;
+
+import java.util.List;
+
+/**
+ * 政协通知公告Service接口
+ * 
+ * @author boman
+ * @date 2024-03-05
+ */
+public interface IZxNoticeService 
+{
+    /**
+     * 查询政协通知公告
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 政协通知公告
+     */
+    public ZxNotice selectZxNoticeByZxNoticeId(Long zxNoticeId);
+
+    /**
+     * 查询政协通知公告列表
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 政协通知公告集合
+     */
+    public List<ZxNotice> selectZxNoticeList(ZxNotice zxNotice);
+
+    /**
+     * 新增政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    public int insertZxNotice(ZxNotice zxNotice);
+
+    /**
+     * 修改政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    public int updateZxNotice(ZxNotice zxNotice);
+
+    /**
+     * 批量删除政协通知公告
+     * 
+     * @param zxNoticeIds 需要删除的政协通知公告主键集合
+     * @return 结果
+     */
+    public int deleteZxNoticeByZxNoticeIds(Long[] zxNoticeIds);
+
+    /**
+     * 删除政协通知公告信息
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 结果
+     */
+    public int deleteZxNoticeByZxNoticeId(Long zxNoticeId);
+}

+ 134 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZxNoticeServiceImpl.java

@@ -0,0 +1,134 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.notice.ZxNotice;
+import com.ruoyi.system.domain.notice.ZxUserNotice;
+import com.ruoyi.system.service.IZxNoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.transaction.annotation.Transactional;
+import com.ruoyi.system.mapper.ZxNoticeMapper;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 政协通知公告Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-03-05
+ */
+@Service
+public class ZxNoticeServiceImpl implements IZxNoticeService
+{
+    @Autowired
+    private ZxNoticeMapper zxNoticeMapper;
+
+    /**
+     * 查询政协通知公告
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 政协通知公告
+     */
+    @Override
+    public ZxNotice selectZxNoticeByZxNoticeId(Long zxNoticeId)
+    {
+        return zxNoticeMapper.selectZxNoticeByZxNoticeId(zxNoticeId);
+    }
+
+    /**
+     * 查询政协通知公告列表
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 政协通知公告
+     */
+    @Override
+    public List<ZxNotice> selectZxNoticeList(ZxNotice zxNotice)
+    {
+        return zxNoticeMapper.selectZxNoticeList(zxNotice);
+    }
+
+    /**
+     * 新增政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int insertZxNotice(ZxNotice zxNotice)
+    {
+        zxNotice.setCreateTime(DateUtils.getNowDate());
+        int rows = zxNoticeMapper.insertZxNotice(zxNotice);
+        insertZxUserNotice(zxNotice);
+        return rows;
+    }
+
+    /**
+     * 修改政协通知公告
+     * 
+     * @param zxNotice 政协通知公告
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int updateZxNotice(ZxNotice zxNotice)
+    {
+        zxNotice.setUpdateTime(DateUtils.getNowDate());
+        zxNoticeMapper.deleteZxUserNoticeByZxNoticeId(zxNotice.getZxNoticeId());
+        insertZxUserNotice(zxNotice);
+        return zxNoticeMapper.updateZxNotice(zxNotice);
+    }
+
+    /**
+     * 批量删除政协通知公告
+     * 
+     * @param zxNoticeIds 需要删除的政协通知公告主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteZxNoticeByZxNoticeIds(Long[] zxNoticeIds)
+    {
+        zxNoticeMapper.deleteZxUserNoticeByZxNoticeIds(zxNoticeIds);
+        return zxNoticeMapper.deleteZxNoticeByZxNoticeIds(zxNoticeIds);
+    }
+
+    /**
+     * 删除政协通知公告信息
+     * 
+     * @param zxNoticeId 政协通知公告主键
+     * @return 结果
+     */
+    @Transactional
+    @Override
+    public int deleteZxNoticeByZxNoticeId(Long zxNoticeId)
+    {
+        zxNoticeMapper.deleteZxUserNoticeByZxNoticeId(zxNoticeId);
+        return zxNoticeMapper.deleteZxNoticeByZxNoticeId(zxNoticeId);
+    }
+
+    /**
+     * 新增用户与政协通知公告关联信息
+     * 
+     * @param zxNotice 政协通知公告对象
+     */
+    public void insertZxUserNotice(ZxNotice zxNotice)
+    {
+        List<ZxUserNotice> zxUserNoticeList = zxNotice.getZxUserNoticeList();
+        Long zxNoticeId = zxNotice.getZxNoticeId();
+        if (StringUtils.isNotNull(zxUserNoticeList))
+        {
+            List<ZxUserNotice> list = new ArrayList<ZxUserNotice>();
+            for (ZxUserNotice zxUserNotice : zxUserNoticeList)
+            {
+                zxUserNotice.setZxNoticeId(zxNoticeId);
+                list.add(zxUserNotice);
+            }
+            if (list.size() > 0)
+            {
+                zxNoticeMapper.batchZxUserNotice(list);
+            }
+        }
+    }
+}

+ 151 - 0
ruoyi-system/src/main/resources/mapper/system/ZxNoticeMapper.xml

@@ -0,0 +1,151 @@
+<?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.ZxNoticeMapper">
+    
+    <resultMap type="ZxNotice" id="ZxNoticeResult">
+        <result property="zxNoticeId"    column="zx_notice_id"    />
+        <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="issuer"    column="issuer"    />
+        <result property="issuerDept"    column="issuer_dept"    />
+        <result property="issuerDeptId"    column="issuer_dept_id"    />
+        <result property="issuerTime"    column="issuer_time"    />
+        <result property="type"    column="type"    />
+        <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="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <resultMap id="ZxNoticeZxUserNoticeResult" type="ZxNotice" extends="ZxNoticeResult">
+        <collection property="zxUserNoticeList" notNullColumn="sub_user_id" javaType="java.util.List" resultMap="ZxUserNoticeResult" />
+    </resultMap>
+
+    <resultMap type="ZxUserNotice" id="ZxUserNoticeResult">
+        <result property="userId"    column="sub_user_id"    />
+        <result property="userName"    column="sub_user_name"    />
+        <result property="zxNoticeId"    column="sub_zx_notice_id"    />
+        <result property="zxNoticeType"    column="sub_zx_notice_type"    />
+        <result property="createTime"    column="sub_create_time"    />
+    </resultMap>
+
+    <sql id="selectZxNoticeVo">
+        select zx_notice_id, notice_title, notice_type, notice_content, status, issuer, issuer_dept, issuer_dept_id, issuer_time, create_by, create_time, update_by, update_time, remark from zx_notice
+    </sql>
+
+    <select id="selectZxNoticeList" parameterType="ZxNotice" resultMap="ZxNoticeResult">
+        select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer, a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
+        IFNULL( b.zx_notice_type, 'N' ) as type
+        from zx_notice a
+        left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
+        where a.zx_notice_id = #{zxNoticeId}
+        <where>  
+            <if test="noticeTitle != null  and noticeTitle != ''"> and a.notice_title = #{noticeTitle}</if>
+            <if test="noticeType != null  and noticeType != ''"> and a.notice_type = #{noticeType}</if>
+            <if test="noticeContent != null  and noticeContent != ''"> and a.notice_content = #{noticeContent}</if>
+            <if test="status != null  and status != ''"> and a.status = #{status}</if>
+            <if test="issuer != null  and issuer != ''"> and a.issuer = #{issuer}</if>
+            <if test="issuerDept != null  and issuerDept != ''"> and a.issuer_dept = #{issuerDept}</if>
+            <if test="issuerDeptId != null "> and a.issuer_dept_id = #{issuerDeptId}</if>
+            <if test="issuerTime != null "> and a.issuer_time = #{issuerTime}</if>
+        </where>
+        order by issuer_time DESC
+    </select>
+    
+    <select id="selectZxNoticeByZxNoticeId" parameterType="Long" resultMap="ZxNoticeZxUserNoticeResult">
+        select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer, a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
+        b.user_id as sub_user_id, b.user_name as sub_user_name,b.zx_notice_type as sub_zx_notice_type, b.zx_notice_id as sub_zx_notice_id, b.create_time as sub_create_time
+        from zx_notice a
+        left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
+        where a.zx_notice_id = #{zxNoticeId}
+    </select>
+        
+    <insert id="insertZxNotice" parameterType="ZxNotice" useGeneratedKeys="true" keyProperty="zxNoticeId">
+        insert into zx_notice
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
+            <if test="noticeType != null and noticeType != ''">notice_type,</if>
+            <if test="noticeContent != null">notice_content,</if>
+            <if test="status != null">status,</if>
+            <if test="issuer != null">issuer,</if>
+            <if test="issuerDept != null">issuer_dept,</if>
+            <if test="issuerDeptId != null">issuer_dept_id,</if>
+            <if test="issuerTime != null">issuer_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="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
+            <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
+            <if test="noticeContent != null">#{noticeContent},</if>
+            <if test="status != null">#{status},</if>
+            <if test="issuer != null">#{issuer},</if>
+            <if test="issuerDept != null">#{issuerDept},</if>
+            <if test="issuerDeptId != null">#{issuerDeptId},</if>
+            <if test="issuerTime != null">#{issuerTime},</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="updateZxNotice" parameterType="ZxNotice">
+        update zx_notice
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
+            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
+            <if test="noticeContent != null">notice_content = #{noticeContent},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="issuer != null">issuer = #{issuer},</if>
+            <if test="issuerDept != null">issuer_dept = #{issuerDept},</if>
+            <if test="issuerDeptId != null">issuer_dept_id = #{issuerDeptId},</if>
+            <if test="issuerTime != null">issuer_time = #{issuerTime},</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 zx_notice_id = #{zxNoticeId}
+    </update>
+
+    <delete id="deleteZxNoticeByZxNoticeId" parameterType="Long">
+        delete from zx_notice where zx_notice_id = #{zxNoticeId}
+    </delete>
+
+    <delete id="deleteZxNoticeByZxNoticeIds" parameterType="String">
+        delete from zx_notice where zx_notice_id in 
+        <foreach item="zxNoticeId" collection="array" open="(" separator="," close=")">
+            #{zxNoticeId}
+        </foreach>
+    </delete>
+    
+    <delete id="deleteZxUserNoticeByZxNoticeIds" parameterType="String">
+        delete from zx_user_notice where zx_notice_id in 
+        <foreach item="zxNoticeId" collection="array" open="(" separator="," close=")">
+            #{zxNoticeId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteZxUserNoticeByZxNoticeId" parameterType="Long">
+        delete from zx_user_notice where zx_notice_id = #{zxNoticeId}
+    </delete>
+
+    <insert id="batchZxUserNotice">
+        insert into zx_user_notice( user_id, user_name, zx_notice_id, create_time) values
+		<foreach item="item" index="index" collection="list" separator=",">
+            ( #{item.userId}, #{item.userName}, #{item.zxNoticeId}, #{item.createTime})
+        </foreach>
+    </insert>
+</mapper>