فهرست منبع

Merge branch 'dev/20220413_v2.4.0通用版_消息通知' into develop

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
songxinlu 3 سال پیش
والد
کامیت
2cfe244ec4
20فایلهای تغییر یافته به همراه917 افزوده شده و 42 حذف شده
  1. 53 0
      doc/045.20220413v2.4.0通用版_消息通知/qc_init_v2.4.0_通用版_消息通知.sql
  2. 172 0
      src/main/java/com/diagbot/aop/CheckInfoAspect.java
  3. 1 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  4. 1 0
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  5. 45 0
      src/main/java/com/diagbot/dto/GetNewsNoticeInfoByIdDTO.java
  6. 41 0
      src/main/java/com/diagbot/dto/NewsNoticePageDTO.java
  7. 109 0
      src/main/java/com/diagbot/entity/MedNewsNotice.java
  8. 48 0
      src/main/java/com/diagbot/enums/NewsNoticeStatusEnum.java
  9. 48 0
      src/main/java/com/diagbot/enums/NewsNoticeTypeEnum.java
  10. 43 42
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  11. 96 0
      src/main/java/com/diagbot/facade/MedNewsNoticeFacade.java
  12. 6 0
      src/main/java/com/diagbot/facade/QcresultInfoFacade.java
  13. 21 0
      src/main/java/com/diagbot/mapper/MedNewsNoticeMapper.java
  14. 16 0
      src/main/java/com/diagbot/service/MedNewsNoticeService.java
  15. 20 0
      src/main/java/com/diagbot/service/impl/MedNewsNoticeServiceImpl.java
  16. 22 0
      src/main/java/com/diagbot/vo/GetNewsCountVO.java
  17. 29 0
      src/main/java/com/diagbot/vo/GetNewsNoticeInfoByIdVO.java
  18. 29 0
      src/main/java/com/diagbot/vo/NewsNoticePageVO.java
  19. 66 0
      src/main/java/com/diagbot/web/MedNewsNoticeController.java
  20. 51 0
      src/main/resources/mapper/MedNewsNoticeMapper.xml

+ 53 - 0
doc/045.20220413v2.4.0通用版_消息通知/qc_init_v2.4.0_通用版_消息通知.sql

@@ -0,0 +1,53 @@
+use `qc`;
+
+
+/**
+sys_dictionary_info 字段表配置消息通知下拉框搜索内容
+ */
+INSERT INTO `sys_dictionary_info` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '46', '全部', '', '2', '0', '通知类型');
+INSERT INTO `sys_dictionary_info` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '46', '质控任务', '1', '2', '1', '通知类型');
+INSERT INTO `sys_dictionary_info` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '47', '全部', '', '2', '0', '阅读状态');
+INSERT INTO `sys_dictionary_info` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '47', '未读', '0', '2', '1', '阅读状态');
+INSERT INTO `sys_dictionary_info` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '47', '已读', '1', '2', '2', '阅读状态');
+
+
+/**
+sys_menu 新增消息通知菜单
+ */
+INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('120', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '消息通知', '-1', 'YH-XXTZ', '1', '1', '16', '用户-消息通知');
+INSERT INTO `sys_permission` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ('210', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '查看', 'FUNC000210', '/medNewsNotice/getNewsNoticeInfoById', 'ALL', '查看', '用户-消息通知-查看');
+INSERT INTO `sys_menu_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `order_nu`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '120', '210', NULL, '用户-消息通知-查看');
+
+/**
+sys_role_menu 全院、科室、个人、核查人员(院级、科室、质控科)六个角色添加消息通知菜单
+ */
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '1', '120', NULL);
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '2', '120', NULL);
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '3', '120', NULL);
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '7', '120', NULL);
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '8', '120', NULL);
+INSERT INTO `sys_role_menu` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '2022-05-05 10:36:44', '2022-05-05 10:36:44', '0', '0', '9', '120', NULL);
+
+
+/**
+med_news_notice 消息通知表
+ */
+DROP TABLE IF EXISTS `med_news_notice`;
+CREATE TABLE `med_news_notice` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `hospital_id` bigint(11) DEFAULT NULL COMMENT '医院ID',
+  `title` varchar(512) NOT NULL COMMENT '标题',
+  `type` char(3) DEFAULT '0' COMMENT '通知类型,1:质控任务 0:其他',
+  `news` longtext COMMENT '消息',
+  `status` char(3) DEFAULT '0' COMMENT '阅读状态,0:未读 1:已读',
+  `sender` varchar(20) DEFAULT '0' COMMENT '发送者',
+  `receiver` varchar(20) DEFAULT '0' COMMENT '接收者',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息通知表';
+
+

+ 172 - 0
src/main/java/com/diagbot/aop/CheckInfoAspect.java

@@ -0,0 +1,172 @@
+package com.diagbot.aop;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.MedNewsNotice;
+import com.diagbot.entity.SysUser;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.NewsNoticeTypeEnum;
+import com.diagbot.facade.MedNewsNoticeFacade;
+import com.diagbot.facade.SysUserFacade;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:核查处理
+ * @Author: songxl
+ * @time: 2022/4/12 14:18
+ */
+
+@Aspect
+@Component
+public class CheckInfoAspect {
+    @Autowired
+    private MedNewsNoticeFacade medNewsNoticeFacade;
+    @Autowired
+    private SysUserFacade sysUserFacade;
+
+    // 操作配置织入点
+    @Pointcut("execution(public * com.diagbot.web.MedCheckInfoController.distributionJobs(..))")
+    public void checkPointCut() {
+    }
+
+    /**
+     * 操作后执行
+     *
+     * @param joinPoint
+     * @param jsonResult
+     * @Return void
+     */
+    @AfterReturning(pointcut = "checkPointCut()", returning = "jsonResult")
+    public void operAfterReturning(JoinPoint joinPoint, Object jsonResult) {
+        try {
+            //获取请求入参
+            String params = getRequestParams(joinPoint);
+            if (StringUtils.isNotBlank(params)) {
+                //存储消息通知
+                saveNewsNotice(params);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 存储消息通知
+     *
+     * @param params
+     * @Return void
+     */
+    private void saveNewsNotice(String params) {
+        //参数处理
+        MedNewsNotice newsNotice = paramHandler(params);
+        if (newsNotice != null) {
+            medNewsNoticeFacade.save(newsNotice);
+        }
+    }
+
+    /**
+     * 参数处理
+     *
+     * @param params
+     * @Return java.lang.String
+     */
+    private MedNewsNotice paramHandler(String params) {
+        if (StringUtil.isNotEmpty(params) && "{".equals(params.substring(0, 1))) {
+            JSONObject paramJSON = JSONObject.parseObject(params);
+            if (paramJSON.getJSONArray("behospitalCodes") == null
+                    || StringUtil.isBlank(paramJSON.getString("checkId"))
+                    || StringUtil.isBlank(paramJSON.getString("distributionType"))
+                    || StringUtil.isBlank(paramJSON.getString("checkName"))) {
+                return null;
+            }
+            //获取分配者用户名
+            SysUser user = sysUserFacade.getOne(new QueryWrapper<SysUser>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("id", SysUserUtils.getCurrentPrincipleID())
+                    .eq("status", 1));
+            if (user != null) {
+                StringBuffer out = new StringBuffer();
+                out.append(paramJSON.getString("checkName"))
+                        .append("您好:\r\n")
+                        .append("您有")
+                        .append(paramJSON.getJSONArray("behospitalCodes").size());
+                MedNewsNotice newsNotice = new MedNewsNotice();
+                newsNotice.setReceiver(paramJSON.getString("checkId"));
+                newsNotice.setType(NewsNoticeTypeEnum.CHECK_NEWS_WORK.getKey());
+                newsNotice.setGmtCreate(DateUtil.now());
+                newsNotice.setCreator(SysUserUtils.getCurrentPrincipleID() == null ? "0" : SysUserUtils.getCurrentPrincipleID());
+                newsNotice.setHospitalId(SysUserUtils.getCurrentHospitalID() == null ? 0l : Long.parseLong(SysUserUtils.getCurrentHospitalID()));
+                if ("0".equals(paramJSON.getString("distributionType"))) {
+                    newsNotice.setTitle("待核查质控任务提醒");
+                    out.append("条来自")
+                            .append(user.getLinkman())
+                            .append("分配的待核查质控任务,请及时完成病历核查!");
+                } else {
+                    newsNotice.setTitle("待核查质控任务被移除提醒");
+                    out.append("条待核查的质控任务已被")
+                            .append(user.getLinkman())
+                            .append("移除,请知悉!");
+                }
+                newsNotice.setNews(out.toString());
+                return newsNotice;
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * /**
+     * 获取请求的参数
+     *
+     * @param joinPoint
+     * @Return java.lang.String
+     */
+    private String getRequestParams(JoinPoint joinPoint) throws Exception {
+        Map<String, String[]> map = HttpUtils.getHttpServletRequest().getParameterMap();
+        if (MapUtils.isNotEmpty(map)) {
+            String params = JSONObject.toJSONString(map);
+            return params;
+        } else {
+            Object args = joinPoint.getArgs();
+            if (null != args) {
+                return argsArrayToString(joinPoint.getArgs());
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 参数拼装
+     *
+     * @param paramsArray
+     * @Return java.lang.String
+     */
+    private String argsArrayToString(Object[] paramsArray) {
+        String params = "";
+        if (paramsArray != null && paramsArray.length > 0) {
+            for (int i = 0; i < paramsArray.length; i++) {
+                if (null != (paramsArray[i])) {
+                    Object jsonObj = JSONObject.toJSONString(paramsArray[i]);
+                    params += jsonObj.toString() + " ";
+                }
+            }
+        }
+        return params.trim();
+    }
+}
+
+

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -271,6 +271,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/getDoctorDetail/**").permitAll()
                 .antMatchers("/qcView/data/*").permitAll()
                 .antMatchers("/medDefectFeedback/*").permitAll()
+                .antMatchers("/medNewsNotice/**").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -373,6 +373,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/getDoctorDetail/**", request)
                 || matchers("/qcView/data/*", request)
                 || matchers("/medDefectFeedback/*", request)
+                || matchers("/medNewsNotice/**", request)
                 || matchers("/", request)) {
             return true;
         }

+ 45 - 0
src/main/java/com/diagbot/dto/GetNewsNoticeInfoByIdDTO.java

@@ -0,0 +1,45 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 消息通知--查看消息通知详情-接口出参
+ * @Author songxl
+ * @Date 2022/4/12 9:20
+ */
+@ApiModel(value = "消息通知--查看消息通知详情-接口出参")
+@Getter
+@Setter
+public class GetNewsNoticeInfoByIdDTO implements Serializable {
+    private static final long serialVersionUID = -5355822861966823187L;
+
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "消息")
+    private String news;
+
+    @ApiModelProperty(value = "类型 0:其他,1:质控任务 ")
+    private String type;
+
+    @ApiModelProperty(value = "发送者编号")
+    private String sender;
+
+    @ApiModelProperty(value = "发送者姓名")
+    private String senderName;
+
+    @ApiModelProperty(value = "发送时间")
+    private Date gmtCreate;
+
+    @ApiModelProperty(value = "阅读状态")
+    private String status;
+}

+ 41 - 0
src/main/java/com/diagbot/dto/NewsNoticePageDTO.java

@@ -0,0 +1,41 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 消息通知--列表页查询-接口出参
+ * @Author songxl
+ * @Date 2022/4/12 9:20
+ */
+@ApiModel(value = "消息通知--列表页查询-接口出参")
+@Getter
+@Setter
+public class NewsNoticePageDTO implements Serializable {
+    private static final long serialVersionUID = -5355822861966823187L;
+
+    @ApiModelProperty(value = "主键")
+    private String id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "类型 0:其他,1:质控任务 ")
+    private String type;
+
+    @ApiModelProperty(value = "发送者编号")
+    private String sender;
+
+    @ApiModelProperty(value = "发送者姓名")
+    private String senderName;
+
+    @ApiModelProperty(value = "发送时间")
+    private String gmtCreate;
+
+    @ApiModelProperty(value = "阅读状态")
+    private String status;
+}

+ 109 - 0
src/main/java/com/diagbot/entity/MedNewsNotice.java

@@ -0,0 +1,109 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 消息通知表
+ * </p>
+ *
+ * @author songxl
+ * @since 2022-04-12
+ */
+@Getter
+@Setter
+public class MedNewsNotice implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 通知类型,1:质控任务 0:其他
+     */
+    private String type;
+
+    /**
+     * 消息
+     */
+    private String news;
+
+    /**
+     * 阅读状态,0:未读 1:已读
+     */
+    private String status;
+
+    /**
+     * 发送者
+     */
+    private String sender;
+
+    /**
+     * 接收者
+     */
+    private String receiver;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+
+    @Override
+    public String toString() {
+        return "MedNewsNotice{" +
+            "id=" + id +
+            ", hospitalId=" + hospitalId +
+            ", type=" + type +
+            ", news=" + news +
+            ", status=" + status +
+            ", sender=" + sender +
+            ", receiver=" + receiver +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 48 - 0
src/main/java/com/diagbot/enums/NewsNoticeStatusEnum.java

@@ -0,0 +1,48 @@
+package com.diagbot.enums;
+
+import lombok.Setter;
+
+/**
+ * @Description:消息通知已读未读状态注解
+ * @Author: songxl
+ * @time: 2022/4/12
+ */
+
+public enum NewsNoticeStatusEnum {
+    NEWS_READ("1", "已读"),
+    NEWS_NOT_READ("0", "未读");
+
+    @Setter
+    private String key;
+
+    @Setter
+    private String name;
+
+    NewsNoticeStatusEnum(String key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static NewsNoticeStatusEnum getEnum(String key) {
+        for (NewsNoticeStatusEnum item : NewsNoticeStatusEnum.values()) {
+            if (item.key.equals(key)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String key) {
+        NewsNoticeStatusEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
+

+ 48 - 0
src/main/java/com/diagbot/enums/NewsNoticeTypeEnum.java

@@ -0,0 +1,48 @@
+package com.diagbot.enums;
+
+import lombok.Setter;
+
+/**
+ * @Description:消息通知类型注解
+ * @Author: songxl
+ * @time: 2022/4/12
+ */
+
+public enum NewsNoticeTypeEnum {
+    CHECK_NEWS_WORK("1", "质控任务"),
+    OTHER_NEWS_WORK("0", "其他任务");
+
+    @Setter
+    private String key;
+
+    @Setter
+    private String name;
+
+    NewsNoticeTypeEnum(String key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static NewsNoticeTypeEnum getEnum(String key) {
+        for (NewsNoticeTypeEnum item : NewsNoticeTypeEnum.values()) {
+            if (item.key.equals(key)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String key) {
+        NewsNoticeTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
+

+ 43 - 42
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -314,18 +314,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
     private void showButtonByPageType(Long hospitalId, GetDetailVO getDetailVO, Map<String, Object> res) {
-//        switch (getDetailVO.getPageType()){
-//            case "1":
-//                break;
-//            case "2":
-//                checkButtonShow(hospitalId,getDetailVO,res);
-//                break;
-//            case "3":
-//                appealButtonShow(hospitalId,getDetailVO,res);
-//                break;
-//            default:
-//                break;
-//        }
+        //        switch (getDetailVO.getPageType()){
+        //            case "1":
+        //                break;
+        //            case "2":
+        //                checkButtonShow(hospitalId,getDetailVO,res);
+        //                break;
+        //            case "3":
+        //                appealButtonShow(hospitalId,getDetailVO,res);
+        //                break;
+        //            default:
+        //                break;
+        //        }
         checkButtonShow(hospitalId, getDetailVO, res);
         appealButtonShow(hospitalId, getDetailVO, res);
     }
@@ -367,8 +367,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("hospital_id", hospitalId)
-                .eq("behospital_code", getDetailVO.getBehospitalCode()));
-        if (medCheckInfos.size() == 1 && medCheckInfos.get(0).getCheckId() != null
+                .eq("behospital_code", getDetailVO.getBehospitalCode())
+                .orderByDesc("gmt_create"));
+        if (medCheckInfos.size() >= 1 && medCheckInfos.get(0).getCheckId() != null
                 && medCheckInfos.get(0).getCheckId().equals(Long.parseLong(SysUserUtils.getCurrentPrincipleID()))) {
             //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
             int jobType = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
@@ -458,7 +459,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         Map<String, List<RecordContentDTO>> recMap = EntityUtil.makeEntityListMap(recordContentDTOList, "standModelName");
-//        -------------------------------------文书数据改造开始----------------------------------
+        //        -------------------------------------文书数据改造开始----------------------------------
         // 获取会诊申请单
         List<StrConsultationApply> strConsultationApplyList = strConsultationApplyFacade.list(new QueryWrapper<StrConsultationApply>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -685,7 +686,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .select("whole_data", "rec_id", "hospital_id")
                 .orderByAsc("rec_date")
         );
-//        -------------------------------------文书数据改造结束----------------------------------
+        //        -------------------------------------文书数据改造结束----------------------------------
         // 获取护理
         List<MedNurse> medNurseList = medNurseFacade.list(new QueryWrapper<MedNurse>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -1013,7 +1014,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 null, null);
 
 
-//=========================================
+        //=========================================
     /*    // 会诊记录
         addDataWithKey("会诊", recMap, medrecVoList,
                 Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
@@ -1027,7 +1028,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         addDataWithKey("转科", recMap, medrecVoList,
                 Arrays.asList("转入记录", "转出记录"));
 */
-//        ==================================
+        //        ==================================
 
         addData("有创操作", recMap, medrecVoList);
 
@@ -1071,14 +1072,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
         // 病案首页
         //义乌数据回来还要处理
-//        if(analyzeVO.getHospitalId()==5 && ListUtil.isNotEmpty(recMap.get("病案首页"))){
-//            addDataWithInnerKey("病案首页", recMap, medrecVoList);
-//        }else {
+        //        if(analyzeVO.getHospitalId()==5 && ListUtil.isNotEmpty(recMap.get("病案首页"))){
+        //            addDataWithInnerKey("病案首页", recMap, medrecVoList);
+        //        }else {
         if (homePage != null) {
             addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
                     homePageList, homeOperationInfoList);
         }
-//        }
+        //        }
 
         queryVo.setMedrec(medrecVoList);
         return queryVo;
@@ -1102,14 +1103,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
         queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //已核查抛出以评分
-//        List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
-//                .eq("is_deleted", IsDeleteEnum.N.getKey())
-//                .eq("hospital_id", analyzeVO.getHospitalId())
-//                .eq("behospital_code", analyzeVO.getBehospitalCode()));
-//        Set<Integer> status = medCheckInfos.stream().map(MedCheckInfo::getStatus).collect(Collectors.toSet());
-//        if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
-//            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病例已经核查无需评分!");
-//        }
+        //        List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
+        //                .eq("is_deleted", IsDeleteEnum.N.getKey())
+        //                .eq("hospital_id", analyzeVO.getHospitalId())
+        //                .eq("behospital_code", analyzeVO.getBehospitalCode()));
+        //        Set<Integer> status = medCheckInfos.stream().map(MedCheckInfo::getStatus).collect(Collectors.toSet());
+        //        if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
+        //            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病例已经核查无需评分!");
+        //        }
         //  调用质控接口
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
         if (response == null || response.getData() == null) {
@@ -1221,7 +1222,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         for (MedrecVo medrec : medrecVoList) {
-//            存在标题
+            //            存在标题
             if (key.equals(medrec.getTitle())) {
                 Map<String, Object> keyContent = medrec.getContent();
                 specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, List<RecordContentDTO>>>() {
@@ -2029,15 +2030,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             }
         }
         behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
-//        behospitalPageVO.setIsPlacefile("1");
-//        if (null != behospitalPageVO.getStatisticsType()
-//                && null == behospitalPageVO.getLeaveHosDateStart()
-//                && null == behospitalPageVO.getLeaveHosDateEnd()) {
-//            String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
-//            String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
-//            behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
-//            behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
-//        }
+        //        behospitalPageVO.setIsPlacefile("1");
+        //        if (null != behospitalPageVO.getStatisticsType()
+        //                && null == behospitalPageVO.getLeaveHosDateStart()
+        //                && null == behospitalPageVO.getLeaveHosDateEnd()) {
+        //            String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
+        //            String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
+        //            behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
+        //            behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
+        //        }
     }
 
     public void exportExcelFac(HttpServletResponse response) {
@@ -2396,7 +2397,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                             }
                         }
                 );
-                if(ListUtil.isNotEmpty(strInformedConsents)){
+                if (ListUtil.isNotEmpty(strInformedConsents)) {
                     //删除手术知情同意书历史ric_id
                     strInformedConsentServiceImpl.remove(new QueryWrapper<StrInformedConsent>()
                             .eq("hospital_id", analyzeVO.getHospitalId())
@@ -2404,7 +2405,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                             .eq("behospital_code", analyzeVO.getBehospitalCode())
                             .in("rec_id", recIds));
                 }
-                if(ListUtil.isNotEmpty(strInformedConsents)){
+                if (ListUtil.isNotEmpty(strInformedConsents)) {
                     //新增
                     strInformedConsentServiceImpl.saveBatch(strInformedConsents);
                 }

+ 96 - 0
src/main/java/com/diagbot/facade/MedNewsNoticeFacade.java

@@ -0,0 +1,96 @@
+package com.diagbot.facade;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.GetNewsNoticeInfoByIdDTO;
+import com.diagbot.dto.NewsNoticePageDTO;
+import com.diagbot.dto.SysDictionaryInfoDTO;
+import com.diagbot.entity.MedNewsNotice;
+import com.diagbot.entity.SysUser;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.NewsNoticeStatusEnum;
+import com.diagbot.service.impl.MedNewsNoticeServiceImpl;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.GetNewsNoticeInfoByIdVO;
+import com.diagbot.vo.NewsNoticePageVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:消息通知处理
+ * @Author: songxl
+ * @time: 2022/4/12
+ */
+@Component
+public class MedNewsNoticeFacade extends MedNewsNoticeServiceImpl {
+    @Autowired
+    private SysUserFacade sysUserFacade;
+    @Autowired
+    private SysDictionaryFacade sysDictionaryFacade;
+
+    /**
+     * 消息通知--获取未读消息数量
+     *
+     * @param
+     * @Return java.util.Map<java.lang.String, java.lang.Integer>
+     */
+    public Map<String, Integer> getNewsCount() {
+        Map<String, Integer> out = new HashMap<>();
+        out.put("count", this.count(new QueryWrapper<MedNewsNotice>()
+                .eq("status", "0")
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("receiver", SysUserUtils.getCurrentPrincipleID())));
+        return out;
+    }
+
+    /**
+     *  消息通知--获取未读消息数量
+     * @param newsNoticePageVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.NewsNoticePageDTO>
+     */
+    public IPage<NewsNoticePageDTO> newsNoticePage(NewsNoticePageVO newsNoticePageVO) {
+        newsNoticePageVO.setPrinciple(SysUserUtils.getCurrentPrincipleID());
+        return this.getBaseMapper().newsNoticePage(newsNoticePageVO);
+    }
+
+    /**
+     * 消息通知--查看消息通知详情
+     *
+     * @param getNewsNoticeInfoByIdVO
+     * @Return com.diagbot.dto.GetNewsNoticeInfoByIdDTO
+     */
+    public GetNewsNoticeInfoByIdDTO getNewsNoticeInfoById(GetNewsNoticeInfoByIdVO getNewsNoticeInfoByIdVO) {
+        //更新未读消息状态
+        if (NewsNoticeStatusEnum.NEWS_NOT_READ.getKey().equals(getNewsNoticeInfoByIdVO.getStatus())) {
+            MedNewsNotice medNewsNotice = new MedNewsNotice();
+            BeanUtils.copyProperties(getNewsNoticeInfoByIdVO, medNewsNotice);
+            medNewsNotice.setStatus(NewsNoticeStatusEnum.NEWS_READ.getKey());
+            this.updateById(medNewsNotice);
+        }
+        MedNewsNotice medNewsNotice = this.getById(getNewsNoticeInfoByIdVO.getId());
+        GetNewsNoticeInfoByIdDTO out = new GetNewsNoticeInfoByIdDTO();
+        BeanUtils.copyProperties(medNewsNotice, out);
+        //默认发送者为系统 0
+        if ("0".equals(medNewsNotice.getSender())) {
+            out.setSenderName("系统");
+        } else {
+            SysUser user = sysUserFacade.getById(medNewsNotice.getSender());
+            out.setSenderName(user == null ? "未知用户" : user.getLinkman());
+        }
+        return out;
+    }
+
+    public Map<String,List<SysDictionaryInfoDTO>> getNewsDropDownBox() {
+        Map<Long, List<SysDictionaryInfoDTO>> dicMap = sysDictionaryFacade.getDictionary(); // 获取字典信息
+        Map<String,List<SysDictionaryInfoDTO>> outBox = new HashMap<>();
+        outBox.put("newsType",dicMap.get(46l));
+        outBox.put("newsStatus",dicMap.get(47l));
+        return outBox;
+    }
+}

+ 6 - 0
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -168,6 +168,12 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
                 .set("is_deleted", IsDeleteEnum.Y.getKey())
                 .set("modifier", useId)
                 .set("gmt_modified", now));
+        //清空本病历所有历史记录的page_data和menu_data
+        this.update(new UpdateWrapper<QcresultInfo>()
+                .eq("hospital_id", analyzeVO.getHospitalId())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .set("page_data",null)
+                .set("menu_data",null));
         //新增记录
         QcresultInfo qcresultInfo = new QcresultInfo();
         if (qcresultInfoOld != null) {

+ 21 - 0
src/main/java/com/diagbot/mapper/MedNewsNoticeMapper.java

@@ -0,0 +1,21 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.NewsNoticePageDTO;
+import com.diagbot.entity.MedNewsNotice;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.NewsNoticePageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 消息通知表 Mapper 接口
+ * </p>
+ *
+ * @author songxl
+ * @since 2022-04-12
+ */
+public interface MedNewsNoticeMapper extends BaseMapper<MedNewsNotice> {
+
+    IPage<NewsNoticePageDTO> newsNoticePage(@Param("newsNoticePageVO") NewsNoticePageVO newsNoticePageVO);
+}

+ 16 - 0
src/main/java/com/diagbot/service/MedNewsNoticeService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.MedNewsNotice;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 消息通知表 服务类
+ * </p>
+ *
+ * @author songxl
+ * @since 2022-04-12
+ */
+public interface MedNewsNoticeService extends IService<MedNewsNotice> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/MedNewsNoticeServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.MedNewsNotice;
+import com.diagbot.mapper.MedNewsNoticeMapper;
+import com.diagbot.service.MedNewsNoticeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 消息通知表 服务实现类
+ * </p>
+ *
+ * @author songxl
+ * @since 2022-04-12
+ */
+@Service
+public class MedNewsNoticeServiceImpl extends ServiceImpl<MedNewsNoticeMapper, MedNewsNotice> implements MedNewsNoticeService {
+
+}

+ 22 - 0
src/main/java/com/diagbot/vo/GetNewsCountVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 消息通知--获取未读消息数量-接口入参
+ * @Author songxl
+ * @Date 2022/4/11 9:20
+ */
+@ApiModel(value = "消息通知--获取未读消息数量-接口入参")
+@Getter
+@Setter
+public class GetNewsCountVO  implements Serializable {
+    private static final long serialVersionUID = -1592540382642464417L;
+    @ApiModelProperty(value = "已读未读状态")
+    private String status;
+}

+ 29 - 0
src/main/java/com/diagbot/vo/GetNewsNoticeInfoByIdVO.java

@@ -0,0 +1,29 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 消息通知--查看消息通知详情-接口入参
+ * @Author songxl
+ * @Date 2022/4/13 9:20
+ */
+@ApiModel(value = "消息通知--查看消息通知详情-接口入参")
+@Getter
+@Setter
+public class GetNewsNoticeInfoByIdVO implements Serializable {
+    private static final long serialVersionUID = -5417451681904770048L;
+
+    @ApiModelProperty(value = "消息通知编号",required = true)
+    @NotNull(message = "消息通知编号为空")
+    private Long id;
+
+    @ApiModelProperty(value = "阅读状态 0:未读 1:已读",required = true)
+    @NotNull(message = "阅读状态为空")
+    private String status;
+}

+ 29 - 0
src/main/java/com/diagbot/vo/NewsNoticePageVO.java

@@ -0,0 +1,29 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 消息通知--列表页查询-接口入参
+ * @Author songxl
+ * @Date 2022/4/11 9:20
+ */
+@ApiModel(value = "消息通知--列表页查询-接口入参")
+@Getter
+@Setter
+public class NewsNoticePageVO extends Page implements Serializable {
+    private static final long serialVersionUID = 1011244968588779436L;
+
+    @ApiModelProperty(value = "用户id" ,hidden = true)
+    private String principle;
+
+    @ApiModelProperty(value = "通知类型 1:质控任务")
+    private String type;
+    @ApiModelProperty(value = "阅读状态 0:未读 1:已读")
+    private String status;
+}

+ 66 - 0
src/main/java/com/diagbot/web/MedNewsNoticeController.java

@@ -0,0 +1,66 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.GetNewsNoticeInfoByIdDTO;
+import com.diagbot.dto.NewsNoticePageDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysDictionaryInfoDTO;
+import com.diagbot.facade.MedNewsNoticeFacade;
+import com.diagbot.vo.GetNewsNoticeInfoByIdVO;
+import com.diagbot.vo.NewsNoticePageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息通知表 前端控制器
+ * </p>
+ *
+ * @author songxl
+ * @since 2022-04-12
+ */
+@RestController
+@RequestMapping("/medNewsNotice")
+@Api(value = "消息通知相关接口API", tags = { "消息通知相关接口API" })
+public class MedNewsNoticeController {
+    @Autowired
+    private MedNewsNoticeFacade medNewsNoticeFacade;
+
+    @ApiOperation(value = "消息通知-获取未读消息数量[by:songxl]",
+            notes = "消息通知-获取未读消息数量")
+    @PostMapping("/getNewsCount")
+    public RespDTO<Map<String,Integer>> getNewsCount() {
+        return RespDTO.onSuc(medNewsNoticeFacade.getNewsCount());
+    }
+
+
+    @ApiOperation(value = "消息通知--列表页查询[by:songxl]",
+            notes = "消息通知--列表页查询")
+    @PostMapping("/newsNoticePage")
+    public RespDTO<IPage<NewsNoticePageDTO>> newsNoticePage(@RequestBody NewsNoticePageVO newsNoticePageVO) {
+        return RespDTO.onSuc(medNewsNoticeFacade.newsNoticePage(newsNoticePageVO));
+    }
+
+    @ApiOperation(value = "消息通知--查看消息通知详情[by:songxl]",
+            notes = "消息通知--查看消息通知详情")
+    @PostMapping("/getNewsNoticeInfoById")
+    public RespDTO<GetNewsNoticeInfoByIdDTO> getNewsNoticeInfoById(@RequestBody GetNewsNoticeInfoByIdVO getNewsNoticeInfoByIdVO) {
+        return RespDTO.onSuc(medNewsNoticeFacade.getNewsNoticeInfoById(getNewsNoticeInfoByIdVO));
+    }
+
+    @ApiOperation(value = "消息通知-获取通知类型、阅读状态下拉框内容[by:songxl]",
+            notes = "消息通知-获取通知类型、阅读状态下拉框内容")
+    @PostMapping("/getNewsDropDownBox")
+    public RespDTO<Map<String, List<SysDictionaryInfoDTO>>> getNewsDropDownBox() {
+        return RespDTO.onSuc(medNewsNoticeFacade.getNewsDropDownBox());
+    }
+}

+ 51 - 0
src/main/resources/mapper/MedNewsNoticeMapper.xml

@@ -0,0 +1,51 @@
+<?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.diagbot.mapper.MedNewsNoticeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.MedNewsNotice">
+        <id column="id" property="id" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="title" property="title" />
+        <result column="type" property="type" />
+        <result column="news" property="news" />
+        <result column="status" property="status" />
+        <result column="sender" property="sender" />
+        <result column="receiver" property="receiver" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+    <select id="newsNoticePage" resultType="com.diagbot.dto.NewsNoticePageDTO">
+        SELECT
+            *
+        FROM
+        (SELECT
+            n.id,
+            n.title,
+            n.type,
+            n.news,
+            n.`status`,
+            n.sender,
+            CASE WHEN n.sender = '0' THEN '系统'
+            ELSE u.linkman END senderName,
+            n.gmt_create gmtCreate
+        FROM
+            `med_news_notice` n
+        LEFT JOIN sys_user u ON u.id = n.sender
+        AND u.is_deleted = "N"
+        WHERE
+            n.is_deleted = "N"
+        AND n.receiver = #{newsNoticePageVO.principle}
+        <if test="newsNoticePageVO.type != null and newsNoticePageVO.type != ''">
+            AND n.type = #{newsNoticePageVO.type}
+        </if>
+        <if test="newsNoticePageVO.status != null and newsNoticePageVO.status != ''">
+            AND n.`status` = #{newsNoticePageVO.status}
+        </if>
+         )p
+    </select>
+
+</mapper>