From 71c4428446f6d5692de5dd6d0b9451bbe046247b Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 08 四月 2025 22:25:42 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/IServiceExternalService.java                       |    5 
 smartor/src/main/java/com/smartor/domain/ServiceSubtask.java                                 |    7 +
 smartor/src/main/java/com/smartor/domain/HeLibraryVO.java                                    |    3 
 ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml                                    |    4 
 smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java               |  115 ++++++++++++++-
 smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml                            |   49 +++++-
 smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java                    |   16 ++
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                           |   11 +
 smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java                                  |   26 +++
 smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java                                |    2 
 smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java                 |    3 
 smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java                      |   13 +
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml                               |   23 +-
 smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml                             |    2 
 smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java                 |    2 
 ruoyi-admin/src/main/resources/application-druid.yml                                         |    8 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java      |    3 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java             |   19 +
 ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java |    1 
 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AuthRole.java                 |   28 ++++
 smartor/src/main/java/com/smartor/domain/ExternalInDeptPatientInfo.java                      |   64 +++++++++
 smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java                               |    7 +
 22 files changed, 358 insertions(+), 53 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
index 2e88bbd..567f815 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
@@ -5,6 +5,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.PageUtils;
 import com.smartor.domain.PatMedReq;
 import com.smartor.domain.PatMedRes;
 import io.swagger.annotations.Api;
@@ -49,7 +50,7 @@
     @PostMapping("/selectPatMedOuthospList")
     @ApiOperation("鏌ヨ鎮h�呴棬璇婅褰曞垪琛�")
     public TableDataInfo selectPatMedOuthosplist(@RequestBody PatMedOuthosp patMedOuthosp) {
-        startPage();
+        PageUtils.startPageByPost(patMedOuthosp.getPageNum(), patMedOuthosp.getPageSize());
         List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
         return getDataTable(list);
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index fdf2888..bfe1a5b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -4,13 +4,11 @@
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.common.core.domain.entity.SysRole;
-import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.common.core.domain.entity.SysUserDept;
+import com.ruoyi.common.core.domain.entity.*;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -19,7 +17,9 @@
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import com.smartor.mapper.SysUserDeptMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -36,6 +36,7 @@
  *
  * @author ruoyi
  */
+@Slf4j
 @RestController
 @RequestMapping("/system/user")
 public class SysUserController extends BaseController {
@@ -226,8 +227,14 @@
      */
     //@PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.GRANT)
-    @PostMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
+    @PostMapping("/authRole/insertAuthRole")
+    public AjaxResult insertAuthRole(@RequestBody AuthRole authRole) {
+        log.error("-----鐢ㄦ埛鎺堟潈瑙掕壊鐨勫叆鍙備负锛歶serId={},roleIds={}", authRole.getUserId(), authRole.getRoleIds());
+        if (ObjectUtils.isEmpty(authRole.getRoleIds())) {
+            throw new BaseException("瑙掕壊涓虹┖锛岃妫�鏌ヤ箣鍚庡啀娆″皾璇�");
+        }
+        Long[] roleIds = authRole.getRoleIds().stream().toArray(Long[]::new);
+        Long userId = authRole.getUserId();
         userService.checkUserDataScope(userId);
         userService.insertUserAuth(userId, roleIds, getOrgid());
         return success();
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index fa70094..e30aa14 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -18,10 +18,10 @@
         password: Smartor.2023
         driverClassName: com.mysql.cj.jdbc.Driver
         #        # 鏂板崕
-#        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-#        username: smartor
-#        password: Smartor.2023
-#        driverClassName: com.mysql.cj.jdbc.Driver
+        #        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        #        username: smartor
+        #        password: Smartor.2023
+        #        driverClassName: com.mysql.cj.jdbc.Driver
 
         #  鍏徃浜�
 #        url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
diff --git a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
index ac47c03..40e19ca 100644
--- a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
+++ b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
@@ -12,9 +12,9 @@
         <!-- 閰嶇疆榛樿鐨勬墽琛屽櫒.SIMPLE灏辨槸鏅�氭墽琛屽櫒;REUSE鎵ц鍣ㄤ細閲嶇敤棰勫鐞嗚鍙�(prepared statements);BATCH鎵ц鍣ㄥ皢閲嶇敤璇彞骞舵墽琛屾壒閲忔洿鏂� -->
         <setting name="defaultExecutorType"      value="SIMPLE" />
 		<!-- 鎸囧畾 MyBatis 鎵�鐢ㄦ棩蹇楃殑鍏蜂綋瀹炵幇 -->
-        <setting name="logImpl"                  value="SLF4J"  />
+        <setting name="logImpl"                  value="STDOUT_LOGGING"  />
         <!-- 浣跨敤椹煎嘲鍛藉悕娉曡浆鎹㈠瓧娈� -->
 		<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
 	</settings>
-	
+
 </configuration>
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AuthRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AuthRole.java
new file mode 100644
index 0000000..af27e98
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AuthRole.java
@@ -0,0 +1,28 @@
+package com.ruoyi.common.core.domain.entity;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.annotation.Excel.ColumnType;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 瑙掕壊琛� sys_role
+ *
+ * @author ruoyi
+ */
+@Data
+public class AuthRole extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 鐢ㄦ埛ID */
+    @Excel(name = "鐢ㄦ埛ID", cellType = ColumnType.NUMERIC)
+    private Long userId;
+
+    /** 瑙掕壊ID闆嗗悎 */
+    @Excel(name = "瑙掕壊ID闆嗗悎")
+    private List<Long> roleIds;
+
+}
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
index 608c381..ac3c39f 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/HospitalFilterInterceptor.java
@@ -58,7 +58,6 @@
 
         // 灏嗕慨鏀瑰悗鐨� SQL 鍐欏洖
         metaObject.setValue("delegate.boundSql.sql", modifiedSql);
-        System.out.println("淇敼鍚庣殑 SQL:" + modifiedSql);
 
         // 鎵ц鍚庣画鎿嶄綔
         return invocation.proceed();
diff --git a/smartor/src/main/java/com/smartor/domain/ExternalInDeptPatientInfo.java b/smartor/src/main/java/com/smartor/domain/ExternalInDeptPatientInfo.java
new file mode 100644
index 0000000..f263393
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/ExternalInDeptPatientInfo.java
@@ -0,0 +1,64 @@
+package com.smartor.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author 鎺ユ敹绗笁鏂瑰叆绉戞偅鑰呬俊鎭�
+ * @date 2024-12-13
+ */
+@Data
+@ApiModel(value = "ExternalInHospPatientInfo", description = "鎺ユ敹绗笁鏂瑰叆绉戞偅鑰呬俊鎭�")
+public class ExternalInDeptPatientInfo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "鎿嶄綔浜篒D")
+    private String CaoZuoRID;
+
+    @ApiModelProperty(value = "鎿嶄綔浜哄鍚�")
+    private String CaoZuoRXM;
+
+    @ApiModelProperty(value = "鍏ョ鏃堕棿")
+    private String RuKeSJ;
+
+    @ApiModelProperty(value = "鍏ラ櫌鏃堕棿")
+    private Date RuYuanSJ;
+
+    @ApiModelProperty(value = "鍖荤枟缁処D")
+    private String YiLiaoZID;
+
+    @ApiModelProperty(value = "鍖荤枟缁勫悕绉�")
+    private String YiLiaoZMC;
+
+    @ApiModelProperty(value = "涓绘不鍖荤敓ID")
+    private String ZhuZhiYSID;
+
+    @ApiModelProperty(value = "涓绘不鍖荤敓濮撳悕")
+    private String ZhuZhiYSXM;
+
+    @ApiModelProperty(value = "璐d换鎶ゅ+ID")
+    private String ZeRenHSID;
+
+    @ApiModelProperty(value = "璐d换鎶ゅ+濮撳悕")
+    private String ZeRenHSXM;
+
+    @ApiModelProperty(value = "鎶ゅ+涓籌D")
+    private String HuShiZID;
+
+    @ApiModelProperty(value = "鎶ゅ+涓诲鍚�")
+    private String HuShiZXM;
+
+    @ApiModelProperty(value = "缁忕鍖荤敓ID")
+    private String JingGuanYSID;
+
+    @ApiModelProperty(value = "缁忕鍖荤敓濮撳悕")
+    private String JingGuanYSXM;
+
+
+}
diff --git a/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java b/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
index cf55f69..bc2160c 100644
--- a/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
@@ -166,6 +166,19 @@
     @ApiModelProperty(value = "鐜颁綇鍧�淇℃伅")
     private String XianZhuZXX;
 
+
+    @ApiModelProperty(value = "璐d换鎶ゅ+ID")
+    private String ZeRenHSID;
+
+    @ApiModelProperty(value = "璐d换鎶ゅ+濮撳悕")
+    private String ZeRenHSXM;
+
+    @ApiModelProperty(value = "涓绘不鍖荤敓ID")
+    private String ZhuZhiYSID;
+
+    @ApiModelProperty(value = "涓绘不鍖荤敓濮撳悕")
+    private String ZhuZhiYSXM;
+
     @ApiModelProperty(value = "鑱旂郴浜轰俊鎭�")
     List<ExternalInHospPatientLiaisonInfo> externalInHospPatientLiaisonInfos;
 
diff --git a/smartor/src/main/java/com/smartor/domain/HeLibraryVO.java b/smartor/src/main/java/com/smartor/domain/HeLibraryVO.java
index 156652a..f07132c 100644
--- a/smartor/src/main/java/com/smartor/domain/HeLibraryVO.java
+++ b/smartor/src/main/java/com/smartor/domain/HeLibraryVO.java
@@ -248,4 +248,7 @@
      */
     @ApiModelProperty("html瀵屾枃鏈�")
     private String htmlRichText;
+
+    @ApiModelProperty("瑙傜湅娆℃暟")
+    private Long watchCount;
 }
diff --git a/smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java b/smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java
index 6d72ea3..62dfc70 100644
--- a/smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java
+++ b/smartor/src/main/java/com/smartor/domain/PatMedOuthosp.java
@@ -165,4 +165,30 @@
     @ApiModelProperty(value = "涓昏堪")
     private String mainsuit;
 
+
+    /**
+     * pageNum
+     */
+    @ApiModelProperty("pageNum")
+    private Integer pageNum;
+
+    /**
+     * pageSize
+     */
+    @ApiModelProperty("pageSize")
+    private Integer pageSize;
+
+    /**
+     * 骞撮緞
+     */
+    @ApiModelProperty(value = "骞撮緞")
+    private String age;
+
+
+    /**
+     * 鎵嬫満鍙�
+     */
+    @ApiModelProperty(value = "鎵嬫満鍙�")
+    private String telcode;
+
 }
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
index 9b6df31..dd43a3c 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -458,6 +458,13 @@
     private Long patid;
 
     /**
+     * 鎮h�匢D
+     */
+    @Excel(name = "  鎮h�匢D")
+    @ApiModelProperty(value = "鎮h�匢D")
+    private String patguid;
+
+    /**
      * 绉戝鍚嶇О
      */
     @Excel(name = "绉戝鍚嶇О")
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
index 0d4cd66..6f2e74b 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -36,6 +36,13 @@
     private String taskGuid;
 
     /**
+     * 鎮h�匢D
+     */
+    @Excel(name = "  鎮h�匢D")
+    @ApiModelProperty(value = "鎮h�匢D")
+    private String patguid;
+
+    /**
      * 鍙戦�佷汉
      */
     @Excel(name = " 鍙戦�佷汉 ")
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java b/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
index 1c55451..e7d1e34 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceTaskInfo.java
@@ -75,7 +75,7 @@
     private String orgguid;
 
     @ApiModelProperty(value = "鎮h�匢D")
-    private long patguid;
+    private String patguid;
 
     @ApiModelProperty(value = "濮撳悕")
     private String patname;
diff --git a/smartor/src/main/java/com/smartor/service/IServiceExternalService.java b/smartor/src/main/java/com/smartor/service/IServiceExternalService.java
index e75cdb6..570b90c 100644
--- a/smartor/src/main/java/com/smartor/service/IServiceExternalService.java
+++ b/smartor/src/main/java/com/smartor/service/IServiceExternalService.java
@@ -58,6 +58,11 @@
     public Boolean addInHospInfo(@RequestBody Map dataMap);
 
     /**
+     * 鏂板鍏ョ淇℃伅
+     */
+    public Boolean addInDeptInfo(Map dataMap);
+
+    /**
      * 鍙栨秷鍏ラ櫌鐧昏淇℃伅
      */
     public Boolean cancelInHospInfo(@RequestBody Map dataMap);
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
index 27b10b8..90cb542 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -602,14 +602,26 @@
             patArchive1.setTagList(stringList.stream().collect(Collectors.toList()));
             patArchives.add(patArchive1);
         }
+        //灏唒atArchives閲岀殑tagList鏀惧埌patArchiveList鐨勫璞¢噷
+        for (PatArchiveOthreInfo poi : patArchiveList) {
+            for (PatArchive pa : patArchives) {
+                if (poi.getId() == pa.getId()) {
+                    poi.setTagList(pa.getTagList());
+
+                }
+            }
+        }
+
+        List<PatArchive> patArchiveList1 = DtoConversionUtils.sourceToTarget(patArchiveList, PatArchive.class);
         //缁欐偅鑰呰仈绯讳汉璧嬪��
-        for (PatArchive pa : patArchives) {
+//        for (PatArchive pa : patArchives) {
+        for (PatArchive pa : patArchiveList1) {
             PatArchivecontact patArchivecontact = new PatArchivecontact();
             patArchivecontact.setPatid(pa.getId());
             pa.setPatArchivecontactList(patArchivecontactMapper.selectPatArchivecontactList(patArchivecontact));
         }
 
-        return patArchives;
+        return patArchiveList1;
     }
 
     @Override
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
index 537374f..50cd264 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -53,7 +53,8 @@
      */
     @Override
     public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) {
-        return patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp);
+        List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp);
+        return patMedOuthosps;
     }
 
     /**
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
index 037a99a..2eedd31 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -254,6 +254,73 @@
     }
 
     @Override
+    public Boolean addInDeptInfo(Map dataMap) {
+        log.error("ServiceExternalServiceImpl---addInDeptInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
+        Map yeWuXX = (Map) dataMap.get("YeWuXX");
+        List<HashMap<String, Object>> epai = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("DiZhiXXList") : null;
+        List<HashMap<String, Object>> epli = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList") : null;
+        List<HashMap<String, Object>> hospPatientDiagnoseInfos = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
+        Map<String, Object> RuKeXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("RuKeXX") : null;
+
+        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
+        ExternalInDeptPatientInfo externalInDeptPatientInfo = BeanUtil.mapToBean(RuKeXX, ExternalInDeptPatientInfo.class, true);
+        externalInHospPatientInfo.setZeRenHSID(externalInDeptPatientInfo.getZeRenHSID());
+        externalInHospPatientInfo.setZeRenHSXM(externalInDeptPatientInfo.getZeRenHSXM());
+        externalInHospPatientInfo.setZhuZhiYSID(externalInDeptPatientInfo.getZhuZhiYSID());
+        externalInHospPatientInfo.setZhuZhiYSXM(externalInDeptPatientInfo.getZhuZhiYSXM());
+        externalInHospPatientInfo.setRuYuanSJ(externalInDeptPatientInfo.getRuYuanSJ());
+
+        ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo = null;
+        ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo = null;
+        ExternalInHospPatientDiagnoseInfo externalInHospPatientDiagnoseInfo = null;
+        List<ExternalInHospPatientAddrInfo> epai2 = epai.stream().map(map -> {
+            ExternalInHospPatientAddrInfo info = new ExternalInHospPatientAddrInfo();
+            info.setDiZhiLX((String) map.get("DiZhiLX")); // 鍋囪瀛楁绫诲瀷鏄� Integer
+            info.setDiZhiXX((String) map.get("DiZhiXX"));
+            info.setShengFenDM((String) map.get("ShengFenDM"));
+            info.setShengFenMC((String) map.get("ShengFenMC"));
+            info.setShiDiQDM((String) map.get("ShiDiQDM"));
+            info.setShiDiQMC((String) map.get("ShiDiQMC"));
+            info.setXianQuDM((String) map.get("XianQuDM"));
+            info.setXianQuMC((String) map.get("XianQuMC"));
+            info.setXiangZhenDM((String) map.get("XiangZhenDM"));
+            info.setXiangZhenMC((String) map.get("XiangZhenMC"));
+            info.setCunJiDM((String) map.get("CunJiDM"));
+            info.setQiTaXX((String) map.get("QiTaXX"));
+            info.setYouBian((String) map.get("YouBian"));
+            return info;
+        }).collect(Collectors.toList());
+
+        List<ExternalInHospPatientLiaisonInfo> epli2 = epli.stream().map(map -> {
+            ExternalInHospPatientLiaisonInfo info = new ExternalInHospPatientLiaisonInfo();
+            info.setLianXiRXM((String) map.get("LianXiRXM"));
+            info.setLianXiRDH((String) map.get("LianXiRDH"));
+            info.setGuanXiDM((String) map.get("GuanXiDM"));
+            info.setGuanXiMC((String) map.get("GuanXiMC"));
+            return info;
+        }).collect(Collectors.toList());
+        externalInHospPatientInfo.setExternalInHospPatientLiaisonInfos(epli2);
+
+        List<ExternalInHospPatientDiagnoseInfo> hospPatientDiagnoseInfos2 = hospPatientDiagnoseInfos.stream().map(map -> {
+            ExternalInHospPatientDiagnoseInfo info = new ExternalInHospPatientDiagnoseInfo();
+            info.setZhenDuanID((String) map.get("ZhenDuanID"));
+            info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
+            return info;
+        }).collect(Collectors.toList());
+
+        if (CollectionUtils.isNotEmpty(epai)) externalInHospPatientAddrInfo = epai2.get(0);
+        if (CollectionUtils.isNotEmpty(epli)) externalInHospPatientLiaisonInfo = epli2.get(0);
+        if (CollectionUtils.isNotEmpty(hospPatientDiagnoseInfos))
+            externalInHospPatientDiagnoseInfo = hospPatientDiagnoseInfos2.get(0);
+        //鏂板鎮h�呭熀鏈俊鎭�
+        PatArchive patArchive = addPatArchive(externalInHospPatientInfo, externalInHospPatientAddrInfo, externalInHospPatientLiaisonInfo);
+        //鏂板鎮h�呭叆闄俊鎭�
+        Boolean aBoolean = addPadInhospInfo(externalInHospPatientInfo, patArchive, externalInHospPatientDiagnoseInfo);
+        return aBoolean;
+    }
+
+    @Override
     public Boolean cancelInHospInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---cancelInHospInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
@@ -261,6 +328,7 @@
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
+        patMedInhosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
         List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
         for (PatMedInhosp patMedInhosp1 : patMedInhospList) {
             String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
@@ -333,6 +401,7 @@
 
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
+        patMedInhosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
         List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
         for (PatMedInhosp patMedInhosp1 : patMedInhospList) {
             String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
@@ -410,7 +479,7 @@
                 patMedInhosp1.setOrgid(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null);
                 patMedInhosp1.setPatno(ObjectUtils.isNotEmpty(BingRenXX.get("BingRenID")) ? BingRenXX.get("BingRenID").toString() : null);
                 patMedInhosp1.setInhospno(ObjectUtils.isNotEmpty(BingRenXX.get("BingAnHao")) ? BingRenXX.get("BingAnHao").toString() : null);
-                patMedInhosp1.setSerialnum(ObjectUtils.isNotEmpty(BingRenXX.get("BingAnHao")) ? BingRenXX.get("BingAnHao").toString() : null);
+                patMedInhosp1.setSerialnum(ObjectUtils.isNotEmpty(BingRenXX.get("JiuZhenYWID")) ? BingRenXX.get("JiuZhenYWID").toString() : null);
             }
             patMedInhosp1.setPatid(patArchive.getId());
             patMedInhosp1.setPatname(patArchive.getName());
@@ -430,6 +499,7 @@
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
+        patMedInhosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
         List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
         for (PatMedInhosp patMedInhosp1 : patMedInhospList) {
             String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
@@ -490,7 +560,7 @@
 
         PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
         patMedOuthosp.setOuthospno(externalInHospPatientInfo.getBingAnHao());
-        patMedOuthosp.setSerialnum(externalInHospPatientInfo.getBingAnHao());
+        patMedOuthosp.setSerialnum(ObjectUtils.isNotEmpty(yeWuXX.get("JiuZhenYWID")) ? yeWuXX.get("JiuZhenYWID").toString() : null);
         patMedOuthosp.setPatid(patArchive.getId());
         patMedOuthosp.setPatname(externalInHospPatientInfo.getXingMing());
         patMedOuthosp.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC());
@@ -705,7 +775,7 @@
                 ExternalOperationDetail info = new ExternalOperationDetail();
                 info.setShouShuMCID((String) map.get("ShouShuMCID"));
                 info.setShouShuMC((String) map.get("ShouShuMC"));
-                info.setZhuShouSBZ((String) map.get("ZhuShouSBZ"));
+                info.setZhuShouSBZ(ObjectUtils.isNotEmpty(map.get("ZhuShouSBZ")) ? map.get("ZhuShouSBZ").toString() : null);
                 info.setQieKouLBDM((String) map.get("QieKouLBDM"));
                 info.setQieKouLBMC((String) map.get("QieKouLBMC"));
                 info.setShouShuJBDM((String) map.get("ShouShuJBDM"));
@@ -760,9 +830,12 @@
             }
         }
         PatArchive patArchive = new PatArchive();
+        //濡傛灉鏄垰鍑虹敓鐨勫皬瀛╁瓙锛屾槸娌℃湁韬唤璇佺殑锛屾�庝箞澶勭悊锛燂紵锛燂紵锛燂紵锛燂紵
         patArchive.setIdcardno(externalInHospPatientInfo.getZhengJianHM());
         patArchive.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
-        List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(patArchive);
+        List<PatArchive> patArchives = null;
+        if (ObjectUtils.isNotEmpty(patArchive.getIdcardno()))
+            patArchives = patArchiveMapper.selectPatArchiveList(patArchive);
         patArchive.setPatientno(externalInHospPatientInfo.getJiuZhenKH());
         patArchive.setBirthdate(parse);
         patArchive.setPatidHis(externalInHospPatientInfo.getBingRenID());
@@ -803,14 +876,13 @@
         if (ObjectUtils.isNotEmpty(externalInHospPatientLiaisonInfo))
             patArchive.setRelativetelcode(externalInHospPatientLiaisonInfo.getLianXiRDH());
         patArchive.setInhospno(externalInHospPatientInfo.getBingAnHao());
-
         patArchive.setIdcardtype(externalInHospPatientInfo.getZhengJianLXMC());
+        patArchive.setUpdateTime(new Date());
         if (CollectionUtils.isNotEmpty(patArchives)) {
             //濡傛灉涓嶄负绌猴紝鐩存帴灏嗘煡璇㈠嚭鏉ョ殑瀵硅薄杩斿洖
             PatArchive patArchive1 = patArchives.get(0);
             String orgid = patArchive1.getOrgid();
             if (StringUtils.isNotEmpty(orgid)) {
-                patArchive.setUpdateTime(new Date());
                 patArchive.setId(patArchive1.getId());
                 patArchiveMapper.updatePatArchive(patArchive);
             }
@@ -844,10 +916,12 @@
     //鏂板鎮h�呭叆闄俊鎭�
     private Boolean addPadInhospInfo(ExternalInHospPatientInfo externalInHospPatientInfo, PatArchive patArchive, ExternalInHospPatientDiagnoseInfo externalInHospPatientDiagnoseInfo) {
         PatMedInhosp patMedInhosp = new PatMedInhosp();
+        List<PatMedInhosp> patMedInhospList = null;
         if (ObjectUtils.isNotEmpty(externalInHospPatientInfo)) {
             //鍖婚櫌閭h竟璇磋鐢ㄧ梾妗堝彿锛屼笉瑕佺敤浣忛櫌鍙�
             patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
-            patMedInhosp.setSerialnum(externalInHospPatientInfo.getZhuYuanHao());
+            patMedInhosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
+            patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
             patMedInhosp.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC());
             patMedInhosp.setHospitalcode(externalInHospPatientInfo.getZuZhiJGID());
             patMedInhosp.setStarttime(externalInHospPatientInfo.getRuYuanSJ());
@@ -867,11 +941,18 @@
             patMedInhosp.setHospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
             patMedInhosp.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
             patMedInhosp.setTelcode(patArchive.getTelcode());
-            patMedInhosp.setDrname("");
+            patMedInhosp.setDrname(externalInHospPatientInfo.getZhuZhiYSXM());
+            patMedInhosp.setDrcode(externalInHospPatientInfo.getZhuZhiYSID());
+            patMedInhosp.setNurseId(externalInHospPatientInfo.getZeRenHSID());
+            patMedInhosp.setNurseName(externalInHospPatientInfo.getZeRenHSXM());
         }
         if (ObjectUtils.isNotEmpty(externalInHospPatientDiagnoseInfo)) {
-            patMedInhosp.setIcd10code(StringUtils.isNotEmpty(patMedInhosp.getIcd10code()) ? patMedInhosp.getIcd10code() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanID() : externalInHospPatientDiagnoseInfo.getZhenDuanID());
-            patMedInhosp.setDiagname(StringUtils.isNotEmpty(patMedInhosp.getDiagname()) ? patMedInhosp.getDiagname() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanMC() : externalInHospPatientDiagnoseInfo.getZhenDuanMC());
+//            patMedInhosp.setIcd10code(StringUtils.isNotEmpty(patMedInhosp.getIcd10code()) ? patMedInhosp.getIcd10code() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanID() : externalInHospPatientDiagnoseInfo.getZhenDuanID());
+//            patMedInhosp.setDiagname(StringUtils.isNotEmpty(patMedInhosp.getDiagname()) ? patMedInhosp.getDiagname() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanMC() : externalInHospPatientDiagnoseInfo.getZhenDuanMC());
+
+            patMedInhosp.setIcd10code(externalInHospPatientDiagnoseInfo.getZhenDuanID());
+            patMedInhosp.setDiagname(externalInHospPatientDiagnoseInfo.getZhenDuanMC());
+
         }
 
         if (ObjectUtils.isNotEmpty(patArchive)) {
@@ -880,9 +961,16 @@
             patMedInhosp.setPatname(patArchive.getName());
 
             patMedInhosp.setSchemestatus(1L);
-            patMedInhosp.setCreateTime(new Date());
+
         }
-        int i = patMedInhospMapper.insertPatMedInhosp(patMedInhosp);
+        int i = 1;
+        if (CollectionUtils.isNotEmpty(patMedInhospList)) {
+            patMedInhosp.setUpdateTime(new Date());
+            i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp);
+        } else {
+            patMedInhosp.setCreateTime(new Date());
+            i = patMedInhospMapper.insertPatMedInhosp(patMedInhosp);
+        }
         if (i == 1) return true;
         return false;
     }
@@ -1011,6 +1099,9 @@
             case "JG_ZZ_YiLiaoZYS":
                 log.error("鍖荤枟缁勫尰鐢熶负锛歿}", type);
                 return addMedicalTeam(dataMap);
+            case "JZ_ZY_RuKe":
+                log.error("鍏ョ鐨勬暟鎹负锛歿}", type);
+                return addMedicalTeam(dataMap);
         }
         return true;
     }
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
index 13d562d..4b7c681 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
@@ -266,7 +266,7 @@
         serviceSubtask.setSuggest(serviceTaskVO.getSuggest());
         serviceSubtask.setDelFlag(serviceTaskVO.getDelflag());
         serviceSubtask.setOrgid(serviceTaskVO.getOrgguid());
-        serviceSubtask.setPatid(serviceTaskVO.getPatguid());
+        serviceSubtask.setPatguid(serviceTaskVO.getPatguid());
         serviceSubtask.setSendname(serviceTaskVO.getPatname());
         if (StringUtils.isNotEmpty(serviceTaskVO.getPatsex()) && serviceTaskVO.getPatsex().equals("鐢�"))
             serviceSubtask.setSex(1L);
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index 036a68a..6d19dff 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -432,7 +432,7 @@
             resultMap="PatArchiveOthreInfoResult">
 
         SELECT
-        DISTINCT a.id,
+        a.id,
         a.age_unit,
         a.age_unit2,
         a.patid_his,
@@ -485,7 +485,6 @@
                     #{tagId}
                 </foreach>
             </if>
-
         </where>
         order by a.update_time desc
     </select>
@@ -493,9 +492,8 @@
 
     <select id="selectPatArchiveInfoByInhosp" parameterType="com.smartor.domain.PatArchiveReq"
             resultMap="PatArchiveOthreInfoResult">
-
         select
-        DISTINCT a.id,
+        a.id,
         a.age_unit,
         a.age_unit2,
         a.inhospno,
@@ -629,9 +627,8 @@
 
     <select id="selectPatArchiveInfoByOuthosp" parameterType="com.smartor.domain.PatArchiveReq"
             resultMap="PatArchiveOthreInfoResult">
-
         select
-        DISTINCT a.id,
+        a.id,
         a.age_unit,
         a.age_unit2,
         a.patid_his,
@@ -669,6 +666,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        t.tagname,
         a.pattype
         from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
@@ -755,6 +753,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        t.tagname,
         a.pattype
         from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
@@ -804,7 +803,7 @@
             resultMap="PatArchiveOthreInfoResult">
 
         select
-        distinct a.idcardno,
+        a.idcardno,
         a.id,
         a.age_unit,
         a.age_unit2,
@@ -891,9 +890,6 @@
             <if test="diagname != null and diagname != ''">
                 AND d.diagname LIKE concat('%',#{diagname}, '%')
             </if>
-            <if test="deptname != null and deptname != ''">
-                AND d.deptname LIKE concat('%',#{deptname}, '%')
-            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                 AND d.leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -918,14 +914,13 @@
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
         </where>
-        order by a.update_time desc
     </select>
 
     <select id="selectPatArchiveInfoByOuthospQC" parameterType="com.smartor.domain.PatArchiveReq"
             resultMap="PatArchiveOthreInfoResult">
 
         select
-        distinct a.idcardno,
+        a.idcardno,
         a.id,
         a.age_unit,
         a.age_unit2,
@@ -963,6 +958,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        t.tagname,
         a.pattype
         from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
@@ -1011,7 +1007,7 @@
             resultMap="PatArchiveOthreInfoResult">
 
         select
-        distinct a.idcardno,
+        a.idcardno,
         a.id,
         a.age_unit,
         a.age_unit2,
@@ -1049,6 +1045,7 @@
         a.create_time,
         a.isupload,
         a.upload_time,
+        t.tagname,
         a.pattype
         from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag GROUP BY patid ) t ON t.patid =
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index f199f79..fe8050e 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -230,7 +230,7 @@
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
             <if test="patno != null ">and b.patno = #{patno}</if>
             <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if>
-            <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if>
+            <if test="nurseName != null and nurseName != ''">and b.nurse_name = #{nurseName}</if>
             <if test="checkFlag != null ">and b.check_flag = #{checkFlag}</if>
             <if test="cry != null and cry == 0 ">and b.endtime is null</if>
             <if test="cry != null and cry == 1 ">and b.endtime is not null</if>
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
index 33f177a..8d02294 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -69,18 +69,51 @@
 
     <select id="selectPatMedOuthospList" parameterType="com.smartor.domain.PatMedOuthosp"
             resultMap="PatMedOuthospResult">
-        <include refid="selectPatMedOuthospVo"/>
+        select
+        pmo.id,
+        pmo.outhospno,
+        pmo.serialnum,
+        pmo.patid,
+        pmo.hospitalname,
+        pmo.hospitalcode,
+        pmo.icd10code,
+        pmo.diagname,
+        pmo.deptcode,
+        pmo.deptname,
+        pmo.drcode,
+        pmo.drname,
+        pmo.admitdate,
+        pmo.orgid,
+        pmo.del_flag,
+        pmo.guid,
+        pmo.update_by,
+        pmo.update_time,
+        pmo.create_by,
+        pmo.create_time,
+        pmo.isupload,
+        pmo.upload_time,
+        pmo.schemestatus,
+        pmo.deptid,
+        pmo.schemetime,
+        pmo.hpi,
+        pmo.patname,
+        CONCAT(pa.age,pa.age_unit,pa.age2,pa.age_unit2) AS age,
+        pa.telcode,
+        pmo.mainsuit
+        from pat_med_outhosp pmo left join pat_archive pa on pmo.patid = pa.id
         <where>
-            <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
+            pmo.del_flag=0
+            <if test="hospitalname != null  and hospitalname != ''">and pmo.hospitalname like concat('%',
+                #{hospitalname},
                 '%')
             </if>
-            <if test="deptname != null  and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
-            <if test="drname != null  and drname != ''">and drname like concat('%', #{drname}, '%')</if>
-            <if test="admitdate != null ">and admitdate = #{admitdate}</if>
-            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-            <if test="outhospno != null  and outhospno != ''">and outhospno = #{outhospno}</if>
+            <if test="deptname != null  and deptname != ''">and pmo.deptname like concat('%', #{deptname}, '%')</if>
+            <if test="drname != null  and drname != ''">and pmo.drname like concat('%', #{drname}, '%')</if>
+            <if test="admitdate != null ">and pmo.admitdate = #{admitdate}</if>
+            <if test="orgid != null  and orgid != ''">and pmo.orgid = #{orgid}</if>
+            <if test="outhospno != null  and outhospno != ''">and pmo.outhospno = #{outhospno}</if>
         </where>
-        order by update_time desc
+        order by pmo.update_time desc
     </select>
 
     <select id="selectPatMedOuthospById" parameterType="Long" resultMap="PatMedOuthospResult">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index d3c890c..31ad4c5 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -75,6 +75,7 @@
         <result property="sendstate" column="sendstate"/>
         <result property="inhospid" column="inhospid"/>
         <result property="patfrom" column="patfrom"/>
+        <result property="patguid" column="patguid"/>
     </resultMap>
 
     <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -90,6 +91,7 @@
                task_guid,
                patfrom,
                inhospid,
+               patguid,
                suggest,
                sendstate,
                endtime,
@@ -174,6 +176,7 @@
             </if>
             <if test="sex != null  and sex != ''">and sex = #{sex}</if>
             <if test="age != null ">and age = #{age}</if>
+            <if test="patguid != null ">and patguid = #{patguid}</if>
             <if test="subId != null ">and id = #{subId}</if>
             <if test="inhospid != null ">and inhospid = #{inhospid}</if>
             <if test="submit != null ">and submit = #{submit}</if>
@@ -303,6 +306,7 @@
             <if test="createBy != null ">and create_by = #{createBy}</if>
             <if test="sendname != null ">and sendname = #{sendname}</if>
             <if test="sfzh != null ">and sfzh = #{sfzh}</if>
+            <if test="patguid != null ">and patguid = #{patguid}</if>
         </where>
 
     </select>
@@ -396,6 +400,7 @@
             <if test="inhospid != null ">inhospid,</if>
             <if test="patfrom != null ">patfrom,</if>
             <if test="taskGuid != null ">task_guid,</if>
+            <if test="patguid != null ">patguid,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sendname != null">#{sendname},</if>
@@ -470,6 +475,7 @@
             <if test="inhospid != null ">#{inhospid},</if>
             <if test="patfrom != null ">#{patfrom},</if>
             <if test="taskGuid != null ">#{taskGuid},</if>
+            <if test="patguid != null ">#{patguid},</if>
         </trim>
     </insert>
 
@@ -549,6 +555,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
             <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
+            <if test="patguid != null ">patguid=#{patguid},</if>
         </trim>
         where id = #{id}
     </update>
@@ -629,6 +636,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
             <if test="taskGuid != null ">taskGuid=#{taskGuid},</if>
+            <if test="patguid != null ">patguid=#{patguid},</if>
         </trim>
         <where>
             <if test="patid != null ">and patid = #{patid}</if>
@@ -711,6 +719,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
             <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
+            <if test="patguid != null ">patguid=#{patguid},</if>
         </trim>
         where patid = #{patid} and taskid = #{taskid}
     </update>
@@ -790,6 +799,7 @@
             <if test="inhospid != null ">inhospid=#{inhospid},</if>
             <if test="patfrom != null ">patfrom=#{patfrom},</if>
             <if test="taskGuid != null ">task_guid=#{taskGuid},</if>
+            <if test="patguid != null ">patguid=#{patguid},</if>
         </trim>
         where task_guid = #{taskGuid} and task_name = #{taskName}
     </update>
@@ -904,6 +914,7 @@
                patfrom,
                task_guid,
                leavediagname,
+               patguid,
                leaveicd10code
         FROM service_subtask,
              JSON_TABLE(send_time_slot, '$[*]' COLUMNS (

--
Gitblit v1.9.3