liusheng
12 小时以前 1be48553ad7b1994ed6f7d0d868f0ef7ba8a67af
修复患者首页严重BUG,HIS视图同步
已添加4个文件
已修改13个文件
1108 ■■■■■ 文件已修改
.idea/jarRepositories.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/modules.xml 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/ruoyi-common.iml 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/ruoyi-framework.iml 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-generator/ruoyi-generator.iml 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/ruoyi-quartz.iml 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/CollectHISMapper.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISMapperService.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISMapperServiceImpl.java 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml 635 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/jarRepositories.xml
@@ -3,6 +3,11 @@
  <component name="RemoteRepositoriesConfiguration">
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Central Repositories" />
      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Central Repository" />
      <option name="url" value="https://repo.maven.apache.org/maven2" />
    </remote-repository>
@@ -12,11 +17,26 @@
      <option name="url" value="http://122.49.30.5:8981/nexus/content/repositories/releases/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="nexus" />
      <option name="name" value="Public Repositories" />
      <option name="url" value="http://211.90.241.109:7008/repository/maven-public/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="release" />
      <option name="name" value="Release Repositories" />
      <option name="url" value="http://211.90.241.109:7008/repository/maven-releases/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="central" />
      <option name="name" value="Maven Central repository" />
      <option name="url" value="https://repo1.maven.org/maven2" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="snapshots" />
      <option name="name" value="Snapshot Repositories" />
      <option name="url" value="http://211.90.241.109:7008/repository/maven-snapshots/" />
    </remote-repository>
    <remote-repository>
      <option name="id" value="aliyun" />
      <option name="name" value="aliyun" />
      <option name="url" value="https://maven.aliyun.com/repository/public" />
.idea/modules.xml
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java
@@ -189,6 +189,8 @@
        long count = PageUtils.count(new ISelect() {
            @Override
            public void doSelect() {
                patArchive.setPageNum(null);
                patArchive.setPageSize(null);
                patArchiveService.patInfoByContion(patArchive);
            }
        });
ruoyi-admin/src/main/resources/application-druid.yml
@@ -47,6 +47,15 @@
      # ä»Žåº“数据源
      slave:
#        url: jdbc:oracle:thin:@//192.168.88.46:1521/orcl
#        username: qebemr
#        password: qebsoft
#        driver-class-name: oracle.jdbc.OracleDriver
       enabled: true
       url: jdbc:mysql://192.168.100.10:3306/emr?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
       username: smartor
       password: Smartor.2023
       driverClassName: com.mysql.cj.jdbc.Driver
      # ä»Žæ•°æ®æºå¼€å…³/默认关闭(公司)
      # enabled: true
      # url: jdbc:sqlserver://116.62.18.175:6001;DatabaseName=iv-ywey;encrypt=false;SelectMethod=cursor
@@ -104,12 +113,12 @@
  # redis é…ç½®
  redis:
    host: 127.0.0.1
    port: 6020
    port: 6379
    # æ•°æ®åº“索引
    database: 0
    # å¯†ç 
    password: Smartor
    password:
    # è¿žæŽ¥è¶…æ—¶æ—¶é—´
    timeout: 10s
    lettuce:
ruoyi-common/ruoyi-common.iml
ruoyi-framework/ruoyi-framework.iml
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java
@@ -52,7 +52,7 @@
        {
            log.info("登录用户:{} å·²è¢«åœç”¨.", username);
            throw new ServiceException("对不起,您的账号:" + split[0] + " å·²åœç”¨");
        }else if(!user.getOrgid().equals(split[1])){
        }else if(!user.getOrgid().trim().equals(split[1].trim())){
            log.info("登录用户:{} ä¸æ˜¯æœ¬é™¢å¸å·ï¼š{}", username,split[1]);
            throw new ServiceException("对不起,您的账号:" + split[0] + " ä¸æ˜¯æœ¬é™¢çš„");
        }
ruoyi-generator/ruoyi-generator.iml
ruoyi-quartz/ruoyi-quartz.iml
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java
@@ -2,6 +2,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.quartz.service.ICollectHISMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -31,6 +33,7 @@
    @Autowired
    private ISysJobLogService jobLogService;
    /**
     * æŸ¥è¯¢å®šæ—¶ä»»åŠ¡è°ƒåº¦æ—¥å¿—åˆ—è¡¨
     */
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/CollectHISMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
package com.ruoyi.quartz.mapper;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.domain.entity.SysUserRole;
import com.ruoyi.common.enums.DataSourceType;
import com.smartor.domain.Icd10;
import com.smartor.domain.PatArchive;
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedOuthosp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@DataSource(value = DataSourceType.SLAVE)
@Mapper
public interface CollectHISMapper {
    /**
     * æŸ¥è¯¢æ‚£è€…档案列表
     *
     * @param patArchive æ‚£è€…档案
     * @return æ‚£è€…档案集合
     */
    public List<PatArchive> selectPatArchiveList(PatArchive patArchive);
    /**
     * ç”¨æˆ·ä¸Žè§’色信息
     *
     * @param sysUser
     * @return
     */
    public SysUserRole yhyjsxx(SysUser sysUser);
    /**
     * ç”¨æˆ·ä¸Žç§‘室信息
     *
     * @param sysUser
     * @return
     */
    public SysUserDept yhyksxx(SysUser sysUser);
    /**
     * å‡ºå…¥é™¢ä¿¡æ¯
     *
     * @param patMedInhosp
     * @return
     */
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp);
    public Long selectPatMedInhospListCount(PatMedInhosp patMedInhosp);
    List<PatArchive> selectPatArchiveListByLastId(@Param("lastRowNumber") long lastRowNumber, @Param("ps") int ps);
    List<PatMedInhosp> selectPatMedInhospListByLastId(@Param("lastRowNumber") long lastRowNumber, @Param("ps") int ps);
    public Long selectPatArchiveCount(PatMedInhosp patMedInhosp);
    /**
     * é—¨æ€¥è¯Šä¿¡æ¯
     *
     * @param patMedOuthosp
     * @return
     */
    public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp);
    /**
     * /**
     * æŸ¥è¯¢ç–¾ç—…列表
     *
     * @param icd10 ç–¾ç—…
     * @return ç–¾ç—…集合
     */
    public List<Icd10> selectIcd10List(Icd10 icd10);
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢ç”¨æˆ·åˆ—表
     *
     * @param sysUser ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
    public List<SysUser> selectUserList(SysUser sysUser);
    /**
     * æŸ¥è¯¢éƒ¨é—¨ç®¡ç†æ•°æ®
     *
     * @param dept éƒ¨é—¨ä¿¡æ¯
     * @return éƒ¨é—¨ä¿¡æ¯é›†åˆ
     */
    public List<SysDept> selectDeptList(SysDept dept);
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ICollectHISMapperService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
package com.ruoyi.quartz.service;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.smartor.domain.*;
import java.util.List;
public interface ICollectHISMapperService {
    /**
     * æŸ¥è¯¢æ‚£è€…档案列表
     *
     * @param patArchive æ‚£è€…档案
     * @return æ‚£è€…档案集合
     */
    public List<PatArchive> selectPatArchiveList(PatArchive patArchive);
    /**
     * å‡ºå…¥é™¢ä¿¡æ¯
     *
     * @param patMedInhosp
     * @return
     */
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp);
    /**
     * æ²³å—数据采集
     *
     * @param patMedInhosp
     * @return
     */
    public Boolean hnDataGather(HnDataGatherVO patMedInhosp);
    /**
     * é—¨æ€¥è¯Šä¿¡æ¯
     *
     * @param id
     * @return
     */
    public Integer selectPatMedOuthospList(PatMedOuthosp patMedOuthosp);
    /**
     * æŸ¥è¯¢ç–¾ç—…列表
     *
     * @param icd10 ç–¾ç—…
     * @return ç–¾ç—…集合
     */
    public Integer selectIcd10List(Icd10 icd10);
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢ç”¨æˆ·åˆ—表
     *
     * @param sysUser ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
    public Integer selectUserList(SysUser sysUser);
    /**
     * æŸ¥è¯¢éƒ¨é—¨ç®¡ç†æ•°æ®
     *
     * @param dept éƒ¨é—¨ä¿¡æ¯
     * @return éƒ¨é—¨ä¿¡æ¯é›†åˆ
     */
    public Integer selectDeptList(SysDept dept);
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISMapperServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,247 @@
package com.ruoyi.quartz.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.domain.entity.SysUserRole;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quartz.mapper.CollectHISMapper;
import com.ruoyi.quartz.service.ICollectHISMapperService;
import com.smartor.domain.*;
import com.smartor.mapper.*;
import com.smartor.service.impl.PatArchiveServiceImpl;
import com.smartor.service.impl.PatMedInhospServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
@Slf4j
@Service
public class CollectHISMapperServiceImpl implements ICollectHISMapperService {
    @Autowired
    private HNGatherPatArchiveMapper hnGatherPatArchiveMapper;
    @Autowired
    private SysUser2Mapper sysUser2Mapper;
    @Autowired
    private SysUserRole2Mapper sysUserRoleMapper;
    @Autowired
    private SysDept2Mapper sysDept2Mapper;
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    @Autowired
    private Icd10Mapper icd10Mapper;
    @Autowired
    private PatMedOuthospMapper patMedOuthospMapper;
    @Autowired
    private PatMedInhospMapper patMedInhospMapper;
    @Autowired
    private PatArchiveMapper patArchiveMapper;
    @Autowired
    private ThreadPoolTaskExecutor taskExecutor;
    @Autowired
    private ShardingMapper shardingMapper;
    private static final long SHARDING_THRESHOLD = 5_000_000L;
    private static final String PAT_ARCHIVE_TABLE = "pat_archive";
    private static final String PAT_MED_INHOSP_TABLE = "pat_med_inhosp";
    @Override
    public List<PatArchive> selectPatArchiveList(PatArchive patArchive) {
        return hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
    }
//    @Override
//    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
//        // å¼‚步执行整个数据同步任务
//        taskExecutor.execute(() -> {
//            log.info("开始执行数据同步任务...");
//            syncPatArchivesInOrder(); // å…ˆåŒæ­¥æ‚£è€…
//            syncPatMedInhosp();       // å†åŒæ­¥å‡ºå…¥é™¢
//            log.info("数据同步任务提交完毕。");
//        });
//        return 0; // è¿”回0表示任务已提交到后台执行
//    }
    @Override
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
        List<PatMedInhosp> patMedInhospList = hnGatherPatArchiveMapper.selectPatMedInhospList(patMedInhosp);
        for (PatMedInhosp pm : patMedInhospList) {
            PatArchive patArchive = new PatArchive();
            patArchive.setPatientno(pm.getPatno());
            List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
            if (CollectionUtils.isEmpty(patArchives)) {
                //空了直接丢掉
                continue;
            }
            PatArchive pa = new PatArchive();
            pa.setPatientno(patArchives.get(0).getPatientno());
            List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                pm.setPatid(patArchives1.get(0).getId());
            } else {
                patArchiveMapper.insertPatArchiveSingle(patArchives.get(0));
                pm.setPatid(patArchives.get(0).getId());
            }
            patMedInhospMapper.insertPatMedInhosp(pm);
        }
        return 0;
    }
    @Override
    public Boolean hnDataGather(HnDataGatherVO hnDataGatherVO) {
        LocalDate startDate = hnDataGatherVO.getStartOutHospTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
        LocalDate endDate = hnDataGatherVO.getEndOutHospTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
        Integer po = null;
        // å¾ªçŽ¯å¤„ç†æ¯ä¸€å¤©
        for (LocalDate currentDate = startDate; !currentDate.isAfter(endDate); currentDate = currentDate.plusDays(1)) {
            PatMedInhosp dailyCondition = new PatMedInhosp();
            LocalDateTime dayStart = currentDate.atStartOfDay();
            LocalDateTime dayEnd = currentDate.atTime(23, 59, 59);
            dailyCondition.setStartOutHospTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant()));
            dailyCondition.setEndOutHospTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant()));
            Integer pi = selectPatMedInhospList(dailyCondition);
            PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
            patMedOuthosp.setBeginTime(Date.from(dayStart.atZone(ZoneId.systemDefault()).toInstant()));
            patMedOuthosp.setEndTime(Date.from(dayEnd.atZone(ZoneId.systemDefault()).toInstant()));
            po = selectPatMedOuthospList(patMedOuthosp);
        }
        return true;
    }
    @Override
    public Integer selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) {
        List<PatMedOuthosp> patMedOuthosps = hnGatherPatArchiveMapper.selectPatMedOuthospList(patMedOuthosp);
        log.info("selectPatMedOuthospList的采集到的数量为:{}", patMedOuthosps.size());
        Integer i = null;
        for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) {
            //获取患者基本信息
            PatArchive patArchive = new PatArchive();
            patArchive.setPatientno(patMedOuthosp1.getPatno());
            List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
            //根据patno判断本地患者基本信息是否存在
            PatArchive pa = new PatArchive();
            pa.setPatientno(patMedOuthosp1.getPatno());
            List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveList(pa);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                patMedOuthosp1.setPatid(patArchives1.get(0).getId());
            } else {
                if (CollectionUtils.isEmpty(patArchives)) {
                    continue;
                }
                patArchiveMapper.insertPatArchiveSingle(patArchives.get(0));
                patMedOuthosp1.setPatid(patArchives.get(0).getId());
            }
            i = patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp1);
        }
        return i;
    }
    @Override
    public Integer selectIcd10List(Icd10 icd10) {
        List<Icd10> icd10s = hnGatherPatArchiveMapper.selectIcd10List(icd10);
        log.info("selectIcd10List的采集到的数量为:{}", icd10s.size());
        int i = icd10Mapper.batchIcd10(icd10s);
        return i;
    }
    @Override
    public Integer selectUserList(SysUser sysUser) {
        List<SysUser> sysUserList = hnGatherPatArchiveMapper.selectUserList(sysUser);
        log.info("sysUserList的采集到的数量为:{}", sysUserList.size());
        int i = sysUser2Mapper.batchUser(sysUserList);
        for (SysUser sysUser1 : sysUserList) {
            log.info("sysUser1的ID为:{}", sysUser1.getUserId());
            log.info("sysUser1的HISUSERID为:{}", sysUser1.getHisUserId());
            //新增用户与角色
            SysUserRole yhyjsxx = hnGatherPatArchiveMapper.yhyjsxx(sysUser1);
            if (yhyjsxx == null) continue;
            yhyjsxx.setUserId(sysUser1.getUserId());
            List<SysUserRole> userRoleList = new ArrayList<>();
            userRoleList.add(yhyjsxx);
            sysUserRoleMapper.batchUserRole(userRoleList);
            //新增用户与部门
            if (StringUtils.isEmpty(sysUser1.getHisUserId())) continue;
            SysUserDept sysUserDept = hnGatherPatArchiveMapper.yhyksxx(sysUser1);
            if (Objects.isNull(sysUserDept) || sysUserDept.getDeptId() == null) continue;
            SysDept dept = new SysDept();
            dept.setHisDeptId(sysUserDept.getDeptId().toString());
            List<SysDept> sysDepts = sysDept2Mapper.selectDeptList(dept);
            if (CollectionUtils.isNotEmpty(sysDepts)) {
                sysUserDept.setDeptId(sysDepts.get(0).getDeptId());
                sysUserDept.setDeptCode(sysDepts.get(0).getDeptCode());
            }
            sysUserDept.setUserId(sysUser1.getUserId());
            sysUserDeptMapper.insertSysUserDept(sysUserDept);
        }
        return i;
    }
    @Override
    public Integer selectDeptList(SysDept dept) {
        List<SysDept> sysDepts = hnGatherPatArchiveMapper.selectDeptList(dept);
        log.info("selectDeptList的采集到的数量为:{}", sysDepts.size());
        int i = sysDept2Mapper.batchDept(sysDepts);
        return i;
    }
    /**
     * æ£€æŸ¥å¹¶æ‰§è¡Œåˆ†è¡¨çš„æ ¸å¿ƒæ–¹æ³•
     *
     * @param tableName è¦æ£€æŸ¥çš„表名
     */
    private synchronized void checkAndShard(String tableName) {
        long currentCount = shardingMapper.getTableCount(tableName);
        if (currentCount >= SHARDING_THRESHOLD) {
            log.warn("表 '{}' å·²è¾¾åˆ°åˆ†è¡¨é˜ˆå€¼ {},准备执行分表操作...", tableName, SHARDING_THRESHOLD);
            String newTableName = tableName + "_" + java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyy_MM"));
            Long maxId = shardingMapper.getMaxId(tableName);
            if (maxId == null) maxId = 0L;
            shardingMapper.renameTable(tableName, newTableName);
            log.info("已将表 '{}' é‡å‘½åä¸º '{}'", tableName, newTableName);
            shardingMapper.createLikeTable(tableName, newTableName);
            log.info("已创建新表 '{}'", tableName);
            shardingMapper.setAutoIncrement(tableName, maxId + 1);
            log.info("已设置新表 '{}' çš„自增ID起始值为 {}", tableName, maxId + 1);
            log.info("表 '{}' çš„分表操作完成!", tableName);
        }
    }
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -14,6 +14,8 @@
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.quartz.service.ICollectHISMapperService;
import com.ruoyi.quartz.service.impl.CollectHISMapperServiceImpl;
import com.smartor.common.LSHospTokenUtil;
import com.smartor.domain.*;
import com.smartor.mapper.HeLibraryMapper;
@@ -130,6 +132,9 @@
    @Autowired
    IXHGatherPatArchiveService ixhGatherPatArchiveService;
    @Autowired
    ICollectHISMapperService icollectHis;
    @Value("${appid}")
@@ -759,4 +764,16 @@
        }
        return toHex(md5.digest());
    }
    public void collectHIS() {
        try {
            // HIS数据采集
            HnDataGatherVO hnDataGatherVO = new HnDataGatherVO();
            log.info("【dealHisData】HIS开始采集数据");
            ihnGatherPatArchiveService.hnDataGather(hnDataGatherVO);
            log.info("【dealHisData】HIS结束采集数据");
        } catch (Exception e) {
            log.error("【dealHisData】HIS数据采集异常", e);
        }
    }
}
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,635 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quartz.mapper.CollectHISMapper">
    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserDept" id="SysUserDeptResult">
        <result property="id" column="id"/>
        <result property="orgid" column="orgid"/>
        <result property="userId" column="user_id"/>
        <result property="deptId" column="dept_id"/>
        <result property="delFlag" column="del_flag"/>
        <result property="deptCode" column="dept_code"/>
        <result property="deptName" column="dept_name"/>
        <result property="deptType" column="dept_type"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserRole" id="SysUserRoleResult">
        <result property="userId" column="user_id"/>
        <result property="roleId" column="role_id"/>
        <result property="orgid" column="orgid"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult">
        <result property="id" column="id"/>
        <result property="patientno" column="patientno"/>
        <result property="sourcefrom" column="sourcefrom"/>
        <result property="notrequiredFlag" column="notrequired_flag"/>
        <result property="notrequiredreason" column="notrequiredreason"/>
        <result property="patidHis" column="patid_his"/>
        <result property="sdFlag" column="sd_flag"/>
        <result property="pattype" column="pattype"/>
        <result property="viptype" column="viptype"/>
        <result property="name" column="name"/>
        <result property="sex" column="sex"/>
        <result property="nation" column="nation"/>
        <result property="nativePlace" column="native_place"/>
        <result property="placeOfResidence" column="place_of_residence"/>
        <result property="birthplace" column="birthplace"/>
        <result property="idcardno" column="idcardno"/>
        <result property="birthdate" column="birthdate"/>
        <result property="age" column="age"/>
        <result property="age2" column="age2"/>
        <result property="sourcefrom" column="sourcefrom"/>
        <result property="archivetime" column="archivetime"/>
        <result property="archiveby" column="archiveby"/>
        <result property="telcode" column="telcode"/>
        <result property="relativetelcode" column="relativetelcode"/>
        <result property="idcardtype" column="idcardtype"/>
        <result property="orgid" column="orgid"/>
        <result property="openid" column="openid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="dept" column="deptname"/>
        <result property="deptcode" column="deptcode"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="tag" column="tag"/>
        <result property="pattype" column="pattype"/>
        <result property="bedNo" column="bedno"/>
        <result property="inhosptime" column="inhosptime"/>
        <result property="ageUnit" column="age_unit"/>
        <result property="ageUnit2" column="age_unit2"/>
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="careFacilities" column="care_facilities"/>
        <result property="casePath" column="case_path"/>
        <result property="degreeOfEducation" column="degree_of_education"/>
        <result property="maritalStatus" column="marital_status"/>
        <result property="income" column="income"/>
        <result property="medicareType" column="medicare_type"/>
        <result property="carePerson" column="care_person"/>
        <result property="casePersonAge" column="case_person_age"/>
        <result property="guid" column="guid"/>
        <result property="filterDrname" column="filter_drname"/>
        <result property="filterDrcode" column="filter_drcode"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatArchiveOthreInfo" id="PatArchiveOthreInfoResult">
        <result property="id" column="id"/>
        <result property="notrequiredFlag" column="notrequired_flag"/>
        <result property="notrequiredreason" column="notrequiredreason"/>
        <result property="patientno" column="patientno"/>
        <result property="sourcefrom" column="sourcefrom"/>
        <result property="patidHis" column="patid_his"/>
        <result property="sdFlag" column="sd_flag"/>
        <result property="pattype" column="pattype"/>
        <result property="viptype" column="viptype"/>
        <result property="name" column="name"/>
        <result property="sex" column="sex"/>
        <result property="nation" column="nation"/>
        <result property="nativePlace" column="native_place"/>
        <result property="placeOfResidence" column="place_of_residence"/>
        <result property="birthplace" column="birthplace"/>
        <result property="idcardno" column="idcardno"/>
        <result property="birthdate" column="birthdate"/>
        <result property="age" column="age"/>
        <result property="age2" column="age2"/>
        <result property="sourcefrom" column="sourcefrom"/>
        <result property="archivetime" column="archivetime"/>
        <result property="archiveby" column="archiveby"/>
        <result property="telcode" column="telcode"/>
        <result property="relativetelcode" column="relativetelcode"/>
        <result property="idcardtype" column="idcardtype"/>
        <result property="orgid" column="orgid"/>
        <result property="openid" column="openid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="dept" column="deptname"/>
        <result property="deptcode" column="deptcode"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="tag" column="tag"/>
        <result property="pattype" column="pattype"/>
        <result property="bedNo" column="bedno"/>
        <result property="starttime" column="starttime"/>
        <result property="endtime" column="endtime"/>
        <result property="ageUnit" column="age_unit"/>
        <result property="ageUnit2" column="age_unit2"/>
        <result property="inhospno" column="inhospno"/>
        <result property="nurseId" column="nurse_id"/>
        <result property="nurseName" column="nurse_name"/>
        <result property="outWayName" column="out_way_name"/>
        <result property="outWayId" column="out_way_id"/>
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="guid" column="guid"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="leaveicd10code" column="leaveicd10code"/>
        <result property="filterDrname" column="filter_drname"/>
        <result property="filterDrcode" column="filter_drcode"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedInhosp" id="PatMedInhospResult">
        <result property="inhospid" column="inhospid"/>
        <result property="inhospno" column="inhospno"/>
        <result property="serialnum" column="serialnum"/>
        <result property="hospitalname" column="hospitalname"/>
        <result property="hospitalcode" column="hospitalcode"/>
        <result property="hospitaldistrictcode" column="hospitaldistrictcode"/>
        <result property="hospitaldistrictname" column="hospitaldistrictname"/>
        <result property="icd10code" column="icd10code"/>
        <result property="diagname" column="diagname"/>
        <result property="starttime" column="starttime"/>
        <result property="endtime" column="endtime"/>
        <result property="deptcode" column="deptcode"/>
        <result property="deptname" column="deptname"/>
        <result property="roomno" column="roomno"/>
        <result property="bedNo" column="bed_no"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="patid" column="patid"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="leaveicd10code" column="leaveicd10code"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="schemestatus" column="schemestatus"/>
        <result property="generalschemestatus" column="generalschemestatus"/>
        <result property="leaveldeptcode" column="leaveldeptcode"/>
        <result property="leaveldeptname" column="leaveldeptname"/>
        <result property="hospitaldistrictid" column="hospitaldistrictid"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="leavehospitaldistrictid" column="leavehospitaldistrictid"/>
        <result property="deptid" column="deptid"/>
        <result property="leaveldeptid" column="leaveldeptid"/>
        <result property="schemetime" column="schemetime"/>
        <result property="patname" column="patname"/>
        <result property="patno" column="patno"/>
        <result property="inhospstate" column="inhospstate"/>
        <result property="deptcheckFlag" column="deptcheck_flag"/>
        <result property="wardcheckFlag" column="wardcheck_flag"/>
        <result property="diagcheckFlag" column="diagcheck_flag"/>
        <result property="age" column="age"/>
        <result property="sex" column="sex"/>
        <result property="telcode" column="telcode"/>
        <result property="longTaskReason" column="long_task_reason"/>
        <result property="nurseId" column="nurse_id"/>
        <result property="nurseName" column="nurse_name"/>
        <result property="outWayId" column="out_way_id"/>
        <result property="outWayName" column="out_way_name"/>
        <result property="guid" column="guid"/>
        <result property="operator" column="operator"/>
        <result property="operatorId" column="operator_id"/>
        <result property="remark" column="remark"/>
        <result property="tagname" column="tagname"/>
        <result property="fuflag" column="fuflag"/>
        <result property="fudate" column="fudate"/>
        <result property="fuperiod" column="fuperiod"/>
        <result property="futypecode" column="futypecode"/>
        <result property="futypedesc" column="futypedesc"/>
        <result property="fuadvice" column="fuadvice"/>
        <result property="fuspecialadvice" column="fuspecialadvice"/>
    </resultMap>
    <resultMap type="com.smartor.domain.PatMedOuthosp" id="PatMedOuthospResult">
        <result property="id" column="id"/>
        <result property="serialnum" column="serialnum"/>
        <result property="patid" column="patid"/>
        <result property="hospitalname" column="hospitalname"/>
        <result property="hospitalcode" column="hospitalcode"/>
        <result property="icd10code" column="icd10code"/>
        <result property="diagname" column="diagname"/>
        <result property="deptcode" column="deptcode"/>
        <result property="deptname" column="deptname"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="admitdate" column="admitdate"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="schemestatus" column="schemestatus"/>
        <result property="deptid" column="deptid"/>
        <result property="schemetime" column="schemetime"/>
        <result property="hpi" column="hpi"/>
        <result property="mainsuit" column="mainsuit"/>
        <result property="outhospno" column="outhospno"/>
        <result property="patname" column="patname"/>
        <result property="guid" column="guid"/>
        <result property="patno" column="patno"/>
        <result property="diagcheckFlag" column="diagcheck_flag"/>
        <result property="idcardno" column="idcardno"/>
        <result property="remark" column="remark"/>
    </resultMap>
    <resultMap type="com.smartor.domain.Icd10" id="Icd10Result">
        <result property="icdid" column="icdid"/>
        <result property="icdcode" column="icdcode"/>
        <result property="icdname" column="icdname"/>
        <result property="icdpym" column="icdpym"/>
        <result property="icdwbm" column="icdwbm"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="lastflag" column="lastflag"/>
        <result property="chimedflag" column="chimedflag"/>
        <result property="hisIcdid" column="his_icdid"/>
    </resultMap>
    <resultMap type="com.ruoyi.common.core.domain.entity.SysDept" id="SysDeptResult">
        <id property="deptId" column="dept_id"/>
        <id property="hisDeptId" column="his_dept_id"/>
        <result property="parentId" column="parent_id"/>
        <result property="hisParentId" column="his_parent_id"/>
        <result property="ancestors" column="ancestors"/>
        <result property="deptName" column="dept_name"/>
        <result property="orderNum" column="order_num"/>
        <result property="leader" column="leader"/>
        <result property="phone" column="phone"/>
        <result property="email" column="email"/>
        <result property="status" column="status"/>
        <result property="delFlag" column="del_flag"/>
        <result property="parentName" column="parent_name"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="deptCode" column="dept_code"/>
        <result property="deptType" column="dept_type"/>
        <result property="guid" column="guid"/>
        <result property="orgid" column="orgid"/>
        <result property="type" column="type"/>
    </resultMap>
    <resultMap type="com.ruoyi.common.core.domain.entity.SysUser" id="SysUserResult">
        <id property="userId" column="user_id"/>
        <id property="orgid" column="orgid"/>
        <id property="hisUserId" column="his_user_id"/>
        <result property="deptId" column="dept_id"/>
        <result property="hospInfo" column="hosp_info"/>
        <result property="deptInfo" column="dept_info"/>
        <result property="userName" column="user_name"/>
        <result property="nickName" column="nick_name"/>
        <result property="email" column="email"/>
        <result property="phonenumber" column="phonenumber"/>
        <result property="sex" column="sex"/>
        <result property="avatar" column="avatar"/>
        <result property="password" column="password"/>
        <result property="status" column="status"/>
        <result property="delFlag" column="del_flag"/>
        <result property="loginIp" column="login_ip"/>
        <result property="loginDate" column="login_date"/>
        <result property="createBy" column="create_by"/>
        <result property="idCard" column="id_card"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="title" column="title"/>
        <result property="birthday" column="birthday"/>
        <result property="jobPhone" column="job_phone"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
        <result property="userType" column="user_type"/>
        <result property="searchscope" column="searchscope"/>
        <result property="guid" column="guid"/>
    </resultMap>
    <sql id="selectPatArchiveVo">
        select notrequired_flag,
               notrequiredreason,
               patientno,
               patid_his,
               sd_flag,
               name,
               sex,
               idcardno,
               birthdate,
               age,
               nation,
               native_place,
               place_of_residence,
               birthplace,
               sourcefrom,
               archivetime,
               archiveby,
               telcode,
               relativetelcode,
               idcardtype,
               orgid,
               openid,
               viptype,
               care_facilities,
               case_path,
               degree_of_education,
               marital_status,
               income,
               medicare_type,
               care_person,
               case_person_age
        from healthy_archive
    </sql>
    <select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
        select user_id, role_id, orgid
        FROM yhyjsxx
        <where>
            <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
        </where>
    </select>
    <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
        select user_id, user_code, dept_type,department_id as
        dept_id,dept_name,deptparent,del_flag,orgid,create_time,create_by,update_time,update_by
        FROM yhyksxx
        <where>
            user_id != 'admin'
            <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
        </where>
    </select>
    <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
        <include refid="selectPatArchiveVo"/>
        <where>
            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
            <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
            <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="id != null  and id != ''">and id = #{id}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="viptype != null ">and viptype = #{viptype}</if>
            <if test="pattype != null ">and pattype = #{pattype}</if>
            <if test="patientno != null ">and patientno = CAST(#{patientno} AS INTEGER)</if>
            <if test="patidHis != null ">and patid_his = #{patidHis}</if>
            <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if>
            <if test="ageUnit != null ">and age_unit = #{ageUnit}</if>
            <if test="age != null ">and age = #{age}</if>
            <if test="age2 != null ">and age2 = #{age2}</if>
            <if test="ageUnit2 != null ">and age_unit2 = #{ageUnit2}</if>
            <if test="notrequiredFlag != null ">and notrequired_flag = #{notrequiredFlag}</if>
            <if test="notrequiredreason != null ">and notrequiredreason = #{notrequiredreason}</if>
            <if test="careFacilities != null ">and care_facilities = #{careFacilities}</if>
            <if test="casePath != null ">and case_path = #{casePath}</if>
            <if test="degreeOfEducation != null ">and degree_of_education = #{degreeOfEducation}</if>
            <if test="maritalStatus != null ">and marital_status = #{maritalStatus}</if>
            <if test="income != null ">and income = #{income}</if>
            <if test="medicareType != null ">and medicare_type = #{medicareType}</if>
            <if test="carePerson != null ">and care_person = #{carePerson}</if>
            <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
            <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
            <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
        </where>
    </select>
    <select id="selectPatMedInhospListCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
        select count(*)
        FROM healthy_inhosp
    </select>
    <select id="selectPatArchiveListByLastId" resultMap="PatArchiveResult">
        SELECT *
        FROM (
                 SELECT *,
                        ROW_NUMBER() OVER (ORDER BY patid_his) as row_num
                 FROM healthy_archive
             ) a
        WHERE row_num > #{lastRowNumber} LIMIT #{ps}
    </select>
    <select id="selectPatMedInhospListByLastId" resultMap="PatMedInhospResult">
        SELECT *
        FROM (SELECT *,
                     ROW_NUMBER() OVER (ORDER BY patno) as row_num
              FROM healthy_inhosp
             ) a
        WHERE row_num > #{lastRowNumber} LIMIT #{ps}
    </select>
    <select id="selectPatArchiveCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
        select count(*)
        FROM healthy_archive
    </select>
    <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
        select
        b.nurse_id,
        b.nurse_name,
        b.patname,
        b.out_way_id,
        b.out_way_name,
        b.inhospstate,
        b.patno,
        b.inhospno,
        b.serialnum,
        b.hospitalname,
        b.hospitalcode,
        b.hospitaldistrictcode,
        b.hospitaldistrictname,
        b.icd10code,
        b.diagname,
        b.starttime,
        b.endtime,
        b.deptcode,
        b.deptname,
        b.roomno,
        b.bed_no,
        b.orgid,
        b.leavediagname,
        b.leaveicd10code,
        b.drcode,
        b.drname,
        b.leaveldeptcode,
        b.leaveldeptname,
        b.hospitaldistrictid,
        b.leavehospitaldistrictcode,
        b.leavehospitaldistrictname,
        b.leavehospitaldistrictid,
        b.deptid,
        b.leaveldeptid
        FROM
        healthy_inhosp b
        <where>
            <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &gt;=
                to_char(#{startOutHospTime}::date,'YYMMDD')
            </if>
            <if test="endOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &lt;=
                to_char(#{endOutHospTime}::date,'YYMMDD')
            </if>
            <if test="startInHospTime != null ">and to_char(b.starttime,'YYMMDD') &gt;=
                to_char(#{startInHospTime}::date,'%y%m%d')
            </if>
            <if test="endInHospTime != null ">and to_char(b.starttime,'YYMMDD') &lt;=
                to_char(#{endInHospTime}::date,'YYMMDD')
            </if>
            <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
            <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
            <if test="serialnum != null ">and b.serialnum = #{serialnum}</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 nurseName != ''">and b.nurse_name = #{nurseName}</if>
            <if test="inhospstate != null ">and b.inhospstate = #{inhospstate}</if>
            <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
            <if test="outWayName != null ">and b.out_way_name = #{outWayName}</if>
            <if test="orgid != null ">and b.orgid = #{orgid}</if>
        </where>
    </select>
    <select id="selectPatMedOuthospList" parameterType="com.smartor.domain.PatMedOuthosp"
            resultMap="PatMedOuthospResult">
        select
        outhospno,
        patno,
        serialnum,
        hospitalname,
        hospitalcode,
        icd10code,
        diagname,
        deptcode,
        deptname,
        drcode,
        drname,
        admitdate,
        orgid,
        schemestatus,
        deptid,
        schemetime,
        hpi,
        patname,
        mainsuit
        from healthy_outhosp
        <where>
            <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') &gt;=
                to_char(#{beginTime}::date,'YYMMDD')
            </if>
            <if test="endTime != null ">and to_char( admitdate,'YYMMDD') &lt;=
                to_char(#{endTime}::date,'YYMMDD')
            </if>
        </where>
    </select>
    <select id="selectIcd10List" parameterType="com.smartor.domain.Icd10" resultMap="Icd10Result">
        select
        icdcode,
        his_icdid,
        lastflag,
        chimedflag,
        icdname,
        icdpym
        from healthy_disease
        <where>
            <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if>
            <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if>
            <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if>
            <if test="icdname != null  and icdname != ''">and icdname like concat('%', #{icdname}, '%')</if>
            <if test="icdpym != null  and icdpym != ''">and icdpym = #{icdpym}</if>
            <if test="icdwbm != null  and icdwbm != ''">and icdwbm = #{icdwbm}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
        </where>
    </select>
    <select id="selectUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
        select
        u.title,u.his_user_id, u.searchscope, u.dept_id, u.user_type,
        u.nick_name, u.user_name, u.email,u.id_card, u.avatar,
        u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status
        from healthy_user u
        <where>
            <if test="userId != null and userId != 0">
                AND u.user_id = #{userId}
            </if>
            <if test="userName != null and userName != ''">
                AND u.user_name like concat('%', #{userName}, '%')
            </if>
            <if test="nickName != null and nickName != ''">
                AND u.nick_name like concat('%', #{nickName}, '%')
            </if>
            <if test="status != null and status != ''">
                AND u.status = #{status}
            </if>
            <if test="idCard != null and idCard != ''">
                AND u.id_card = #{idCard}
            </if>
            <if test="title != null and title != ''">
                AND u.title = #{title}
            </if>
            <if test="jobPhone != null and jobPhone != ''">
                AND u.job_phone = #{jobPhone}
            </if>
            <if test="birthday != null and birthday != ''">
                AND u.birthday = #{birthday}
            </if>
            <if test="hisUserId != null and hisUserId != ''">
                AND u.his_user_id = #{hisUserId}
            </if>
            <if test="phonenumber != null and phonenumber != ''">
                AND u.phonenumber like concat('%', #{phonenumber}, '%')
            </if>
        </where>
    </select>
    <select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
        SELECT d.dept_code,
               d.TYPE,
               d.ancestors,
               d.dept_name,
               d.order_num,
               d.leader,
               d.phone,
               d.dept_type,
               d.email,
               d.status,
               d.his_dept_id,
               d.his_parent_id
        FROM healthy_dept d
    </select>
</mapper>
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -565,7 +565,9 @@
    @Override
    public List<PatArchive> patInfoByContion(PatArchiveReq patArchive) {
        List<PatArchive> patArchives = new ArrayList<>();
        if(ObjectUtils.isNotEmpty(patArchive.getPageNum())){
            patArchive.setPageNum(patArchive.getPageNum()*patArchive.getPageSize()-patArchive.getPageNum());
        }
        //根据条件获取患者信息
//        List<PatArchive> patArchiveList = patArchiveMapper.patInfoByContion(patArchive);
        List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>();
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -519,6 +519,8 @@
            </if>
        </where>
        order by a.update_time desc
        <if test="pageSize != null  and pageSize != ''"> limit ${pageNum},${pageSize} </if>
    </select>