攻心小虫 %!s(int64=2) %!d(string=hai) anos
pai
achega
1918e165da

+ 3 - 0
src/main/java/com/diagbot/MrqcSysApplication.java

@@ -30,4 +30,7 @@ public class MrqcSysApplication {
     public static void main(String[] args) {
         SpringApplication.run(MrqcSysApplication.class, args);
     }
+    
 }
+
+

+ 2 - 7
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -350,8 +350,7 @@ public class ConsoleFacade {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             invokeParams.put("filterVO", filterVO);
-            leaveHosMap
-                    = dataBeanAggregateQueryFacade.get("setAllLeaveHos", invokeParams, Map.class);
+            leaveHosMap = dataBeanAggregateQueryFacade.get("setAllLeaveHos", invokeParams, Map.class);
         } catch (Exception e) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
         }
@@ -2002,13 +2001,9 @@ public class ConsoleFacade {
         if (ListUtil.isNotEmpty(records)) {
             NumDTO globleRecord = new NumDTO();
             globleRecord.setName("全院");
-            Integer num = records.stream()
-                    .map(NumDTO::getNum)
-                    .reduce(0, Integer::sum);
-            globleRecord.setNum(num);
+            globleRecord.setNum(records.stream().map(NumDTO::getNum).reduce(0, Integer::sum));
             records.add(0, globleRecord);
         }
-
         if (ListUtil.isNotEmpty(records) && records.size() > filterVO.getLimitCount()) {
             records = records.subList(0, 10);
         }

+ 12 - 18
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -1,14 +1,23 @@
 package com.diagbot.facade.data;
 
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.diagbot.MrqcSysApplication;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.ABehospitalInfoDTO;
-import com.diagbot.entity.*;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.QcType;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.facade.QcAbnormalFacade;
 import com.diagbot.facade.QcTypeFacade;
 import com.diagbot.facade.StrOperativeNoteFacade;
 import com.diagbot.service.impl.BehospitalInfoServiceImpl;
@@ -20,17 +29,6 @@ import com.diagbot.vo.data.ABehospitalInfoVO;
 import com.diagbot.vo.data.ADeleteFlagVO;
 import com.diagbot.vo.data.APlaceFileVO;
 import com.google.common.collect.Lists;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.SpringApplication;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 @Component
 public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
@@ -40,13 +38,9 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
     @Autowired
     private QcTypeFacade qcTypeFacade;
     @Autowired
-    private AMedicalRecordFacade aMedicalRecordFacade;
-    @Autowired
     StrOperativeNoteFacade strOperativeNoteFacade;
     @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
-    @Autowired
-    private QcAbnormalFacade qcAbnormalFacade;
 
     private TZDBConn tzDBConn = new TZDBConn();
 

+ 3 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -454,4 +454,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    
+	public void preHomeOperation();
 }

+ 7 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -439,4 +439,11 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    
+    /**
+     * 预处理业务数据
+     * 
+     */
+	public void preHomeOperation();
 }

+ 5 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -717,4 +717,9 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcCheckMRPageExport(qcResultShortPageVO);
     }
+
+	@Override
+	public void preHomeOperation() {
+		baseMapper.preHomeOperation();
+	}
 }

+ 25 - 0
src/main/java/com/diagbot/task/SystemTask.java

@@ -0,0 +1,25 @@
+package com.diagbot.task;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+import com.diagbot.service.impl.BehospitalInfoServiceImpl;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Service
+public class SystemTask{
+
+	@Autowired
+    @Qualifier("behospitalInfoServiceImpl")
+    private BehospitalInfoServiceImpl behospitalInfoService;
+	
+	@Scheduled(cron = "0 * * * * ?")
+    public void preHomeOperation() {
+        log.error("预处理手术数据...");
+        behospitalInfoService.preHomeOperation();
+    }
+}

+ 39 - 13
src/main/java/com/diagbot/web/ConsoleController.java

@@ -1,24 +1,50 @@
 package com.diagbot.web;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.*;
-import com.diagbot.facade.ConsoleFacade;
-import com.diagbot.vo.*;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import java.util.List;
+import java.util.Map;
+
+import javax.validation.Valid;
+
 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 springfox.documentation.annotations.ApiIgnore;
 
-import javax.validation.Valid;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.AverageStatisticsDTO;
+import com.diagbot.dto.AverageStatisticsFeeDTO;
+import com.diagbot.dto.ColumnDTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.EntryNumGroupDTO;
+import com.diagbot.dto.EntryStatisticsDTO;
+import com.diagbot.dto.HomePageImproveDTO;
+import com.diagbot.dto.HomePageNumDTO;
+import com.diagbot.dto.LevelStatisticsDTO;
+import com.diagbot.dto.LevelStatisticsTZDTO;
+import com.diagbot.dto.MedicalCheckDTO;
+import com.diagbot.dto.NumDTO;
+import com.diagbot.dto.QcResultShortDTO;
+import com.diagbot.dto.ReBeHosDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.UnModifyMRDTO;
+import com.diagbot.facade.ConsoleFacade;
+import com.diagbot.vo.EntryStatisticsVO;
+import com.diagbot.vo.FilterMedicalCheckVO;
+import com.diagbot.vo.FilterOrderVO;
+import com.diagbot.vo.FilterPageByAverageVO;
+import com.diagbot.vo.FilterPageVO;
+import com.diagbot.vo.FilterUnModifyMRVO;
+import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.QcResultPageVO;
+import com.diagbot.vo.QcResultShortPageVO;
+import com.diagbot.vo.ReBeHosPageVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
 
 /**
  * @Description:

+ 0 - 178
src/main/resources/application-pre.yml

@@ -1,178 +0,0 @@
-server:
-  port: 5858
-  max-http-header-size: 10MB
-
-hystrix:
-  threadpool:
-    default:
-      coreSize: 200 #并发执行的最大线程数,默认10
-      maxQueueSize: 200 #BlockingQueue的最大队列数
-      queueSizeRejectionThreshold: 50 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝
-  command:
-    QcServiceClient#extract(QueryVo).execution.isolation.thread.timeoutInMilliseconds: 3600000
-    default:
-      execution:
-        timeout:
-          enabled: true
-        isolation:
-          strategy: SEMAPHORE
-          semaphore:
-            maxConcurrentRequests: 2000
-          thread:
-            timeoutInMilliseconds: 20000
-
-ribbon:
-  ReadTimeout: 20000
-  ConnectTimeout: 20000
-  MaxAutoRetries: 0
-  MaxAutoRetriesNextServer: 1
-
-feign:
-  hystrix:
-    enabled: true
-  #开启Feign请求压缩
-  compression:
-    response:
-      enabled: true
-  httpclient:
-    enabled: false
-  okhttp:
-    enabled: true
-    max-connections: 1000 # 默认值
-    max-connections-per-route: 250 # 默认值
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: bus-refresh,health,info,hystrix.stream
-      cors:
-        allowed-origins: "*"
-        allowed-methods: "*"
-  endpoint:
-    health:
-      show-details: always
-
-# 驱动配置信息
-spring:
-  datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.121:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-      username: teamback
-      password: goTulmLeon
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-
-  #redis
-  redis:
-    database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
-    host: 192.168.2.121  #Redis服务器地址
-    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: lantone # Redis服务器连接密码(默认为空)
-    lettuce:
-      pool:
-        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
-        max-idle: 5 # 连接池中的最大空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-        min-idle: 0 # 连接池中的最小空闲连接
-    timeout: 20000 # 连接超时时间(毫秒)
-
-  servlet:
-    multipart:
-      max-request-size: 2048MB
-
-#mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-
-io.github.lvyahui8.spring:
-  base-packages: com.diagbot.aggregate
-  thread-number: 12
-
-myhost: localhost
-oath.self.address: http://${myhost}:${server.port}
-
-# 加解密开关
-encrypt:
-  enable: false
-
-swagger:
-  enable: true
-
-#xml解析成结构化开关
-xml_analyse:
-  enable: false
-
-#函数初始化modeId开关
-initmodeid:
-  enable: false

+ 0 - 178
src/main/resources/application-pro.yml

@@ -1,178 +0,0 @@
-server:
-  port: 5858
-  max-http-header-size: 10MB
-
-hystrix:
-  threadpool:
-    default:
-      coreSize: 200 #并发执行的最大线程数,默认10
-      maxQueueSize: 200 #BlockingQueue的最大队列数
-      queueSizeRejectionThreshold: 50 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝
-  command:
-    QcServiceClient#extract(QueryVo).execution.isolation.thread.timeoutInMilliseconds: 3600000
-    default:
-      execution:
-        timeout:
-          enabled: true
-        isolation:
-          strategy: SEMAPHORE
-          semaphore:
-            maxConcurrentRequests: 2000
-          thread:
-            timeoutInMilliseconds: 20000
-
-ribbon:
-  ReadTimeout: 20000
-  ConnectTimeout: 20000
-  MaxAutoRetries: 0
-  MaxAutoRetriesNextServer: 1
-
-feign:
-  hystrix:
-    enabled: true
-  #开启Feign请求压缩
-  compression:
-    response:
-      enabled: true
-  httpclient:
-    enabled: false
-  okhttp:
-    enabled: true
-    max-connections: 1000 # 默认值
-    max-connections-per-route: 250 # 默认值
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: bus-refresh,health,info,hystrix.stream
-      cors:
-        allowed-origins: "*"
-        allowed-methods: "*"
-  endpoint:
-    health:
-      show-details: always
-
-# 驱动配置信息
-spring:
-  datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.122:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-      username: root
-      password: lantone
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-
-  #redis
-  redis:
-    database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
-    host: 192.168.2.122  #Redis服务器地址
-    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: lantone # Redis服务器连接密码(默认为空)
-    lettuce:
-      pool:
-        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
-        max-idle: 5 # 连接池中的最大空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-        min-idle: 0 # 连接池中的最小空闲连接
-    timeout: 20000 # 连接超时时间(毫秒)
-
-  servlet:
-    multipart:
-      max-request-size: 2048MB
-
-#mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-
-io.github.lvyahui8.spring:
-  base-packages: com.diagbot.aggregate
-  thread-number: 12
-
-myhost: localhost
-oath.self.address: http://${myhost}:${server.port}
-
-# 加解密开关
-encrypt:
-  enable: false
-
-swagger:
-  enable: true
-
-#xml解析成结构化开关
-xml_analyse:
-  enable: false
-
-#函数初始化modeId开关
-initmodeid:
-  enable: false

+ 0 - 178
src/main/resources/application-test.yml

@@ -1,178 +0,0 @@
-server:
-  port: 5859
-  max-http-header-size: 10MB
-
-hystrix:
-  threadpool:
-    default:
-      coreSize: 200 #并发执行的最大线程数,默认10
-      maxQueueSize: 200 #BlockingQueue的最大队列数
-      queueSizeRejectionThreshold: 50 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝
-  command:
-    QcServiceClient#extract(QueryVo).execution.isolation.thread.timeoutInMilliseconds: 3600000
-    default:
-      execution:
-        timeout:
-          enabled: true
-        isolation:
-          strategy: SEMAPHORE
-          semaphore:
-            maxConcurrentRequests: 2000
-          thread:
-            timeoutInMilliseconds: 20000
-
-ribbon:
-  ReadTimeout: 20000
-  ConnectTimeout: 20000
-  MaxAutoRetries: 0
-  MaxAutoRetriesNextServer: 1
-
-feign:
-  hystrix:
-    enabled: true
-  #开启Feign请求压缩
-  compression:
-    response:
-      enabled: true
-  httpclient:
-    enabled: false
-  okhttp:
-    enabled: true
-    max-connections: 1000 # 默认值
-    max-connections-per-route: 250 # 默认值
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: bus-refresh,health,info,hystrix.stream
-      cors:
-        allowed-origins: "*"
-        allowed-methods: "*"
-  endpoint:
-    health:
-      show-details: always
-
-# 驱动配置信息
-spring:
-  datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.12.181/qc-test1?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-      username: root
-      password: lt@great
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-
-  #redis
-  redis:
-    database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
-    host: 192.168.12.182  #Redis服务器地址
-    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
-    password: lantone # Redis服务器连接密码(默认为空)
-    lettuce:
-      pool:
-        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
-        max-idle: 5 # 连接池中的最大空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-        min-idle: 0 # 连接池中的最小空闲连接
-    timeout: 20000 # 连接超时时间(毫秒)
-
-  servlet:
-    multipart:
-      max-request-size: 2048MB
-
-#mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-
-io.github.lvyahui8.spring:
-  base-packages: com.diagbot.aggregate
-  thread-number: 12
-
-myhost: localhost
-oath.self.address: http://${myhost}:${server.port}
-
-# 加解密开关
-encrypt:
-  enable: false
-
-swagger:
-  enable: true
-
-#xml解析成结构化开关
-xml_analyse:
-  enable: false
-
-#函数初始化modeId开关
-initmodeid:
-  enable: false

+ 235 - 298
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -804,55 +804,55 @@
     <!-- 手术人数统计-全院-首页 -->
     <select id="operationMap" parameterType="com.diagbot.vo.FilterVO" resultType="map">
 	 	select count(1) ss,sum(a) four,sum(if(a>1,0,b)) three,sum(if(a+b>1,0,c)) two,sum(if(a+b+c>1,0,d)) one  from (
-			SELECT a.behospital_code,if(g.ssdj ='四级手术',1,0) a,if(g.ssdj ='三级手术',1,0) b,if(g.ssdj ='二级手术',1,0) c,if(g.ssdj ='一级手术',1,0) d
+			SELECT a.behospital_code,if(LOCATE('四级手术',f.ssdj) >0,1,0) a,if(LOCATE('三级手术',f.ssdj) >0,1,0) b,if(LOCATE('二级手术',f.ssdj) >0 ,1,0) c,if(LOCATE('一级手术',f.ssdj) >0,1,0) d
 			FROM
 			med_behospital_info a,
-			med_medical_record c,
-			qc_mode d,
 			med_home_page e,
-			med_home_operation_info f,
-			kl_operative_9 g
+			med_home_operation_info f
 			WHERE a.is_deleted = 'N'
-			AND c.is_deleted = 'N'
-			AND d.is_deleted = 'N'
 			AND e.is_deleted = 'N'
 			AND f.is_deleted = 'N'
-			AND a.hospital_id = c.hospital_id
-			AND a.behospital_code = c.behospital_code
-			AND c.mode_id = d.id
 			AND a.hospital_id = e.hospital_id
 			AND a.hospital_id = f.hospital_id
 			AND a.behospital_code = e.behospital_code
 			AND e.home_page_id = f.home_page_id
-			AND f.operation_name=g.ssmc AND g.lbbm='04'
-		        <if test="isPlacefile != null and isPlacefile != ''">
-		            and a.is_placefile = #{isPlacefile}
-		        </if>
-		        AND d.`name` = '手术记录'
-		        <![CDATA[AND a.qc_type_id <>0 ]]>
-		        <if test="hospitalId != null and hospitalId != ''">
-		            AND a.hospital_id = #{hospitalId}
-		        </if>
-		        <if test="isPlacefile != null and isPlacefile == 0">
-		            <if test="startDate != null and startDate != ''">
-		                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-		            </if>
-		            <if test="endDate != null and endDate != ''">
-		                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-		            </if>
-		        </if>
-		        <if test="isPlacefile != null and isPlacefile == 1">
-		            <if test="startDate != null and startDate != ''">
-		                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-		            </if>
-		            <if test="endDate != null and endDate != ''">
-		                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-		            </if>
-		        </if>
+	        and f.operation_code is not null and f.operation_code !='[]'
+	        <if test="isPlacefile != null and isPlacefile != ''">
+	            and a.is_placefile = #{isPlacefile}
+	        </if>
+	        <![CDATA[AND a.qc_type_id <>0 ]]>
+	        <if test="hospitalId != null and hospitalId != ''">
+	            AND a.hospital_id = #{hospitalId}
+	        </if>
+	        <if test="isPlacefile != null and isPlacefile == 0">
+	            <if test="startDate != null and startDate != ''">
+	                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+	            </if>
+	            <if test="endDate != null and endDate != ''">
+	                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+	            </if>
+	        </if>
+	        <if test="isPlacefile != null and isPlacefile == 1">
+	            <if test="startDate != null and startDate != ''">
+	                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+	            </if>
+	            <if test="endDate != null and endDate != ''">
+	                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+	            </if>
+	        </if>
 		    group by a.behospital_code
 		) a where a+b+c+d >0
     </select>
-
+    
+    <!-- 预处理病案首页手术数据  -->
+    <update id="preHomeOperation" >
+		update med_home_operation_info a,(select home_page_id,GROUP_CONCAT(g.ssdj) ssdj
+			from med_home_operation_info f 
+			left join  kl_operative_9 g on LOCATE(g.ssbm,f.operation_code) >0 and (lbbm='04' or lbbm='03')
+			where f.operation_code is not null and f.operation_code !='[]' and (f.flag =0 or f.flag is null)
+			group by home_page_id
+ 		) b set a.ssdj=b.ssdj,a.flag=1 where a.home_page_id=b.home_page_id
+    </update>
 
     <!-- 入院人数统计-首页 -->
     <select id="beHosCount" parameterType="com.diagbot.vo.FilterVO"
@@ -5242,245 +5242,179 @@
     </select>
     <!-- 离院病人评分详情页-->
     <select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
-        SELECT DISTINCT
-        t.*
+        SELECT DISTINCT t.*
         <if test='qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == "1" and qcResultShortPageVO.hospitalId == "7"'>
             ,
             GROUP_CONCAT(case when t4.operation_doctor_id is not null then t4.operation_doctor_id else '' end separator ',') AS operationDoctorName,
-            GROUP_CONCAT(if(tx.ssdj is null,'',tx.ssdj) separator ',') AS operationLevel
+            t4.ssdj AS operationLevel
         </if>
         FROM
         (SELECT
-        t1.hospital_id AS hospitalId,
-        t1.behospital_code AS behospitalCode,
-        t1.bed_code AS bedCode,
-        t1.LEVEL AS LEVEL,
-        t1.grade_type AS gradeType,
-        t1.score_res AS scoreRes,
-        t1.scoreBn,
-        t1.NAME AS NAME,
-        t1.sex AS sex,
-        t1.beh_dept_id AS behDeptId,
-        t1.beh_dept_name AS behDeptName,
-        t1.doctor_id AS doctorId,
-        t1.doctor_name AS doctorName,
-        t1.beh_doctor_id AS behDoctorId,
-        t1.beh_doctor_name AS behDoctorName,
-        t1.director_doctor_id AS directorDoctorId,
-        t1.director_doctor_name AS directorDoctorName,
-        t1.birthday AS birthday,
-        t1.behospital_date AS behospitalDate,
-        t1.leave_hospital_date AS leaveHospitalDate,
-        t1.placefile_date AS placefileDate,
-        t1.gmt_create AS gradeTime,
-        t1.diagnose,
-        t1.ward_name AS wardName,
-        t1.checkStatus,
-        t1.mrStatus,
-        t1.chName,
-        t1.mrName,
-        t1.chTime,
-        t1.mrTime,
-          <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==2">
-	        CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
-        </if>
-        t1.file_code AS fileCode,
-        t1.is_daytime  as isDaytime
-        FROM
-        (
-        SELECT be.*,
-        ifnull(mci.status,0) AS checkStatus,
-        ifnull(hm_mci.status,0) AS mrStatus,
-        mci.check_name as chName,
-        e.score_res as scoreBn,
-        hm_mci.check_name as mrName,
-        mci.gmt_create as chTime,
-        hm_mci.gmt_create as mrTime
-        FROM
-        (
-        SELECT DISTINCT
-        tt1.*
-        FROM
-        (
-        SELECT
-        b.*,
-        ifnull(c.LEVEL,'未评分') as LEVEL ,
-        c.grade_type,
-        c.score_res,
-        c.gmt_create
-        FROM
-        (
-        SELECT DISTINCT
-        a.hospital_id,
-        a.behospital_code,
-        a.bed_code,
-        a.NAME,
-        a.sex,
-        a.beh_dept_id,
-        a.beh_dept_name,
-        a.birthday,
-        a.behospital_date,
-        a.leave_hospital_date,
-        a.doctor_id,
-        a.doctor_name,
-        a.beh_doctor_id,
-        a.beh_doctor_name,
-        a.director_doctor_id,
-        a.director_doctor_name,
-        a.diagnose,
-        a.placefile_date,
-        a.ward_name,
-        a.file_code,
-        a.is_daytime
-        FROM
-        med_behospital_info a
-        WHERE
-        a.is_deleted = 'N'
-        AND a.qc_type_id != 0
-        <if test="qcResultShortPageVO.isDaytime != null and qcResultShortPageVO.isDaytime != ''">
-            and a.is_daytime = #{qcResultShortPageVO.isDaytime}
-        </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
-            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
-        </if>
-        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
-            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
-        </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
-            <if test="qcResultShortPageVO.startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
-            </if>
-            <if test="qcResultShortPageVO.endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
-            </if>
-        </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
-            <if test="qcResultShortPageVO.startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
-            </if>
-            <if test="qcResultShortPageVO.endDate != null">
-                <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
-            </if>
-        </if>
-        <if test="qcResultShortPageVO.diagnose != null and qcResultShortPageVO.diagnose != ''">
-            AND a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
-        </if>
-        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
-            AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
-        </if>
-        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
-            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
-        </if>
-        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
-            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
-        </if>
-        <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
-        </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
-            OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
-            OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
-        </if>
-        ) b
-        LEFT JOIN med_qcresult_info c ON c.is_deleted = 'N'
-        AND b.hospital_id = c.hospital_id
-        AND b.behospital_code = c.behospital_code
-        ) tt1
-        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==3">
-            ,med_medical_record tt2,
-            qc_mode tt3
-            WHERE
-            tt2.is_deleted = 'N'
-            AND tt3.is_deleted = 'N'
-            AND tt1.hospital_id = tt2.hospital_id
-            AND tt1.behospital_code = tt2.behospital_code
-            AND tt2.mode_id = tt3.id
-            AND tt3.`name` = '手术记录'
-        </if>
-        ) be
-        left join med_check_info mci
-        on mci.is_deleted = 'N'
-        and mci.check_type in(0,2)
-        and be.hospital_id = mci.hospital_id
-        and be.behospital_code = mci.behospital_code
-        left join med_check_info hm_mci
-        on hm_mci.is_deleted = 'N'
-        and hm_mci.check_type = 1
-        and be.hospital_id = hm_mci.hospital_id
-        and be.behospital_code = hm_mci.behospital_code
-        LEFT JOIN med_qcresult_cases e
-        on  be.behospital_code = e.behospital_code
-        and be.hospital_id = e.hospital_id
-        AND e.is_deleted = 'N'
-        and e.cases_id = 243
-        )t1
-        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==2">
-            ,med_home_page t2
-            WHERE
-            t2.is_deleted = 'N'
-            AND t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = t2.behospital_code
-            AND (
-            ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-'AND t2.newborn_day != '—' )
-            OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-'AND t2.newborn_month != '—' )
-            )
-        </if>
-        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
-            , med_medical_record b,
-            med_medical_record_content c,
-            med_home_page t2
-            WHERE
-            b.is_deleted = 'N'
-            and c.is_deleted = 'N'
-            and t2.is_deleted = 'N'
-            and t1.hospital_id = b.hospital_id
-            and t1.hospital_id = c.hospital_id
-            and t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = b.behospital_code
-            AND t1.behospital_code = t2.behospital_code
-            AND b.rec_id = c.rec_id
-            and b.mode_id = '24'
-        </if>
-        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==4">
-            ,med_home_page t2
-            WHERE
-            t2.is_deleted = 'N'
-            AND t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = t2.behospital_code
-            AND t2.leave_hospital_type = '非医嘱离院'
-        </if>
-        <if test="qcResultShortPageVO.leaveHosType == null or qcResultShortPageVO.leaveHosType == 0 or qcResultShortPageVO.leaveHosType == 3">
-            LEFT JOIN med_home_page t2 ON t2.is_deleted = 'N'
-            AND t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = t2.behospital_code
-        </if>
-        <if test='qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 6 and qcResultShortPageVO.hospitalId == "7"'>
-            ,med_home_page t2
-            WHERE
-            t2.is_deleted = 'N'
-            AND t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = t2.behospital_code
-            AND
-            ( t2.blood_fee != 0
-            or t2.blood_fee != 0.00
-            or t2.blood_fee != null
-            )
-        </if>
-        <if test='qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 7 and qcResultShortPageVO.hospitalId == "7"'>
-            ,med_home_page t2
-            WHERE
-            t2.is_deleted = 'N'
-            AND t1.hospital_id = t2.hospital_id
-            AND t1.behospital_code = t2.behospital_code
-            and t1.diagnose_icd like 'C%'
-        </if>
-        )t
+	        t1.hospital_id AS hospitalId,
+	        t1.behospital_code AS behospitalCode,
+	        t1.bed_code AS bedCode,
+	        t1.LEVEL AS LEVEL,
+	        t1.grade_type AS gradeType,
+	        t1.score_res AS scoreRes,
+	        t1.scoreBn,
+	        t1.NAME AS NAME,
+	        t1.sex AS sex,
+	        t1.beh_dept_id AS behDeptId,
+	        t1.beh_dept_name AS behDeptName,
+	        t1.doctor_id AS doctorId,
+	        t1.doctor_name AS doctorName,
+	        t1.beh_doctor_id AS behDoctorId,
+	        t1.beh_doctor_name AS behDoctorName,
+	        t1.director_doctor_id AS directorDoctorId,
+	        t1.director_doctor_name AS directorDoctorName,
+	        t1.birthday AS birthday,
+	        t1.behospital_date AS behospitalDate,
+	        t1.leave_hospital_date AS leaveHospitalDate,
+	        t1.placefile_date AS placefileDate,
+	        t1.gmt_create AS gradeTime,
+	        t1.diagnose,
+	        t1.ward_name AS wardName,
+	        t1.checkStatus,
+	        t1.mrStatus,
+	        t1.chName,
+	        t1.mrName,
+	        t1.chTime,
+	        t1.mrTime,
+	      	<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==2">
+		        CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
+	        </if>
+	        t1.file_code AS fileCode,
+	        t1.is_daytime  as isDaytime
+        FROM(
+        	SELECT 
+        		be.*,
+		        ifnull(mci.status,0) AS checkStatus,
+		        ifnull(hm_mci.status,0) AS mrStatus,
+		        mci.check_name as chName,
+		        e.score_res as scoreBn,
+		        hm_mci.check_name as mrName,
+		        mci.gmt_create as chTime,
+		        hm_mci.gmt_create as mrTime
+        	FROM(
+        		SELECT DISTINCT tt1.*
+        		FROM(
+        			SELECT
+        				b.*,
+				        ifnull(c.LEVEL,'未评分') as LEVEL ,
+				        c.grade_type,
+				        c.score_res,
+				        c.gmt_create
+        			FROM(
+        				SELECT 
+        					DISTINCT a.hospital_id,
+					        a.behospital_code,
+					        a.bed_code,
+					        a.NAME,
+					        a.sex,
+					        a.beh_dept_id,
+					        a.beh_dept_name,
+					        a.birthday,
+					        a.behospital_date,
+					        a.leave_hospital_date,
+					        a.doctor_id,
+					        a.doctor_name,
+					        a.beh_doctor_id,
+					        a.beh_doctor_name,
+					        a.director_doctor_id,
+					        a.director_doctor_name,
+					        a.diagnose,
+					        a.placefile_date,
+					        a.ward_name,
+					        a.file_code,
+					        a.is_daytime
+        				FROM med_behospital_info a
+        				WHERE a.is_deleted = 'N' AND a.qc_type_id != 0
+				        <if test="qcResultShortPageVO.isDaytime != null and qcResultShortPageVO.isDaytime != ''">
+				            and a.is_daytime = #{qcResultShortPageVO.isDaytime}
+				        </if>
+				        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+				            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+				        </if>
+				        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+				            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
+				        </if>
+				        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+				            <if test="qcResultShortPageVO.startDate != null ">
+				                <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+				            </if>
+				            <if test="qcResultShortPageVO.endDate != null ">
+				                <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+				            </if>
+				        </if>
+				        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+				            <if test="qcResultShortPageVO.startDate != null ">
+				                <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+				            </if>
+				            <if test="qcResultShortPageVO.endDate != null">
+				                <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+				            </if>
+				        </if>
+				        <if test="qcResultShortPageVO.diagnose != null and qcResultShortPageVO.diagnose != ''">
+				            AND a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
+				        </if>
+				        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+				            AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
+				        </if>
+				        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
+				            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
+				        </if>
+				        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
+				            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
+				        </if>
+				        <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
+				            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+				            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+				            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+				        </if>
+				        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
+				            AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+				            OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+				            OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
+				        </if>
+        				) b
+        				LEFT JOIN med_qcresult_info c ON c.is_deleted = 'N' AND b.hospital_id = c.hospital_id AND b.behospital_code = c.behospital_code
+        			) tt1
+			        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==3">
+			            ,med_medical_record tt2,qc_mode tt3
+			            WHERE tt2.is_deleted = 'N' AND tt3.is_deleted = 'N' AND tt1.hospital_id = tt2.hospital_id AND tt1.behospital_code = tt2.behospital_code AND tt2.mode_id = tt3.id AND tt3.`name` = '手术记录'
+			        </if>
+        		) be
+        		left join med_check_info mci on mci.is_deleted = 'N' and mci.check_type in(0,2) and be.hospital_id = mci.hospital_id and be.behospital_code = mci.behospital_code
+        		left join med_check_info hm_mci on hm_mci.is_deleted = 'N' and hm_mci.check_type = 1 and be.hospital_id = hm_mci.hospital_id and be.behospital_code = hm_mci.behospital_code
+        		LEFT JOIN med_qcresult_cases e on  be.behospital_code = e.behospital_code and be.hospital_id = e.hospital_id AND e.is_deleted = 'N' and e.cases_id = 243
+        	)t1
+	        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==2">
+	            ,med_home_page t2
+	            WHERE t2.is_deleted = 'N' AND t1.hospital_id = t2.hospital_id AND t1.behospital_code = t2.behospital_code AND ( ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-'AND t2.newborn_day != '—' ) OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-'AND t2.newborn_month != '—' ) )
+	        </if>
+	        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
+	            , med_medical_record b,med_medical_record_content c, med_home_page t2
+	            WHERE b.is_deleted = 'N' and c.is_deleted = 'N' and t2.is_deleted = 'N' and t1.hospital_id = b.hospital_id and t1.hospital_id = c.hospital_id and t1.hospital_id = t2.hospital_id AND t1.behospital_code = b.behospital_code AND t1.behospital_code = t2.behospital_code AND b.rec_id = c.rec_id and b.mode_id = '24'
+	        </if>
+	        <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==4">
+	            ,med_home_page t2
+	            WHERE t2.is_deleted = 'N' AND t1.hospital_id = t2.hospital_id AND t1.behospital_code = t2.behospital_code AND t2.leave_hospital_type = '非医嘱离院'
+	        </if>
+	        <if test="qcResultShortPageVO.leaveHosType == null or qcResultShortPageVO.leaveHosType == 0 or qcResultShortPageVO.leaveHosType == 3">
+	            LEFT JOIN med_home_page t2 ON t2.is_deleted = 'N' AND t1.hospital_id = t2.hospital_id AND t1.behospital_code = t2.behospital_code
+	        </if>
+	        <if test='qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 6 and qcResultShortPageVO.hospitalId == "7"'>
+	            ,med_home_page t2 
+	            WHERE t2.is_deleted = 'N' AND t1.hospital_id = t2.hospital_id AND t1.behospital_code = t2.behospital_code AND ( t2.blood_fee != 0 or t2.blood_fee != 0.00 or t2.blood_fee != null )
+	        </if>
+	        <if test='qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 7 and qcResultShortPageVO.hospitalId == "7"'>
+	            ,med_home_page t2
+	            WHERE t2.is_deleted = 'N' AND t1.hospital_id = t2.hospital_id AND t1.behospital_code = t2.behospital_code 
+	            and (t2.outpatient_emr_diagnose_code like 'C%')
+	        </if>
+    	)t
         <if test='qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != "" and qcResultShortPageVO.isPlacefile == "1" and qcResultShortPageVO.hospitalId == "7"'>
-            ,med_home_page t3
-            ,med_home_operation_info t4,kl_operative_9 tx
+            ,med_home_page t3,med_home_operation_info t4
         </if>
         where 1=1
         <if test='qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != "" and qcResultShortPageVO.isPlacefile == "1" and qcResultShortPageVO.hospitalId == "7"'>
@@ -5488,7 +5422,7 @@
             AND t.hospitalId = t4.hospital_id
             AND t.behospitalCode = t3.behospital_code
             AND t3.home_page_id = t4.home_page_id
-            AND t4.operation_name=tx.ssmc AND tx.lbbm='04'
+            and t4.operation_code is not null and t4.operation_code !='[]'
         </if>
         <if test="qcResultShortPageVO.checkStatus != null">
             and t.checkStatus = #{qcResultShortPageVO.checkStatus}
@@ -5522,10 +5456,9 @@
                 AND t4.`operation_doctor_id` like concat('%', #{qcResultShortPageVO.operationDoctor}, '%')
             </if>
             <if test="qcResultShortPageVO.operationLevel != null and qcResultShortPageVO.operationLevel != ''">
-                AND t4.`operation_level` like concat('%', #{qcResultShortPageVO.operationLevel}, '%')
+                AND t4.ssdj = if(#{qcResultShortPageVO.operationLevel}='1','一级手术',if(#{qcResultShortPageVO.operationLevel}='2','二级手术',if(#{qcResultShortPageVO.operationLevel}='3','三级手术','四级手术')))
             </if>
-            GROUP BY
-            t.behospitalCode
+            GROUP BY t.behospitalCode
         </if>
     </select>
 
@@ -10520,32 +10453,36 @@
 
     <!--癌痛患者人数-->
     <select id="cancerCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
-        SELECT count(1)
-        FROM med_behospital_info a
-        WHERE a.is_deleted = 'N' and a.diagnose_icd like 'C%'
-        <if test="isPlacefile != null and isPlacefile != ''">
-            and a.is_placefile = #{isPlacefile}
-        </if>
-        AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null and startDate != ''">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null and endDate != ''">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
-        </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null and startDate != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null and endDate != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
-        </if>
+        SELECT count(1) from (
+	        select a.behospital_code 
+	        FROM med_behospital_info a,med_home_page b
+	        WHERE a.hospital_id=b.hospital_id and a.behospital_code=b.behospital_code
+	        AND a.qc_type_id != 0 and a.is_deleted = 'N' and b.is_deleted = 'N' 
+	        and (b.outpatient_emr_diagnose_code like 'C%')
+	        <if test="isPlacefile != null and isPlacefile != ''">
+	            and a.is_placefile = #{isPlacefile}
+	        </if>
+	        <if test="hospitalId != null and hospitalId != ''">
+	            AND a.hospital_id = #{hospitalId}
+	        </if>
+	        <if test="isPlacefile != null and isPlacefile == 0">
+	            <if test="startDate != null and startDate != ''">
+	                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+	            </if>
+	            <if test="endDate != null and endDate != ''">
+	                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+	            </if>
+	        </if>
+	        <if test="isPlacefile != null and isPlacefile == 1">
+	            <if test="startDate != null and startDate != ''">
+	                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+	            </if>
+	            <if test="endDate != null and endDate != ''">
+	                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+	            </if>
+	        </if>
+	        group by a.behospital_code
+        )a
     </select>
 
     <select id="operationBehospitalCode"  resultType="String">

+ 2 - 3
src/main/resources/mapper/HomeOperationInfoMapper.xml

@@ -27,8 +27,7 @@
 
     <update id="updateBatchByKey">
         <foreach collection="list" item="item"  separator=";">
-            update med_home_operation_info
-            <set>
+            update med_home_operation_info set
                 <if test="item.operationDate != null">
                     operation_date = #{item.operationDate},
                 </if>
@@ -71,7 +70,7 @@
                 <if test="item.modifier != null">
                     modifier = #{item.modifier},
                 </if>
-            </set>
+                flag=0
             where home_page_id = #{item.homePageId} and hospital_id = #{item.hospitalId} and operation_order_no = #{item.operationOrderNo}
         </foreach>
     </update>