Compare commits
14 Commits
master
...
collector-
Author | SHA1 | Date |
---|---|---|
|
df5ae0271d | 9 months ago |
|
3d063eb15d | 9 months ago |
|
ca37cdad70 | 11 months ago |
|
95bd4434f3 | 2 years ago |
|
e59ecf1df0 | 2 years ago |
|
e553ed947c | 2 years ago |
|
3c544dae7d | 2 years ago |
|
5b37537b5a | 2 years ago |
|
bb89370413 | 2 years ago |
|
7096fc0f57 | 2 years ago |
|
cbfa2b44ce | 2 years ago |
|
e09cbf2d75 | 2 years ago |
|
4f33626843 | 2 years ago |
|
2f040453ee | 2 years ago |
@ -0,0 +1,73 @@
|
|||||||
|
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
|
||||||
|
|
||||||
|
<id>exe</id>
|
||||||
|
<formats>
|
||||||
|
<format>dir</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<fileSets>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/lib</outputDirectory>
|
||||||
|
<directory>${basedir}/target/lib</directory>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/config</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.xml</include>
|
||||||
|
<include>*.yml</include>
|
||||||
|
<include>*.properties</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/dataConfig</outputDirectory>
|
||||||
|
<directory>${basedir}/target/dataConfig</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.json</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources/bin</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.bat</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources/bin</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.xml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.exe</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
<!-- 将项目启动jar打包到boot目录中 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/target</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>${project.build.finalName}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
</assembly>
|
@ -0,0 +1 @@
|
|||||||
|
{"lastExecuteDate":"2023-11-15"}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.docus.server.collect.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者扫描条件
|
||||||
|
*
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("患者扫描条件传输对象")
|
||||||
|
public class PatientScanConditionDTO {
|
||||||
|
@ApiModelProperty("住院号")
|
||||||
|
@NotBlank(message = "住院号不能为空!")
|
||||||
|
private String inpatientNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("出院日期 yyyy-MM-dd")
|
||||||
|
@NotBlank(message = "出院日期不能为空!")
|
||||||
|
private String disDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("病人姓名")
|
||||||
|
@NotBlank(message = "病人姓名不能为空!")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "为出院日期的 00:00:00,只在后端查询中使用", hidden = true)
|
||||||
|
private String disDateTime;
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.docus.server.collect.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者扫描数据 - pat_sm 视图
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "患者扫描数据", description = "患者扫描数据")
|
||||||
|
@Data
|
||||||
|
public class PatientScan implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "患者主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "住院号")
|
||||||
|
private String inpatientNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "住院次数")
|
||||||
|
private String admissTimes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "病人姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "出院日期")
|
||||||
|
private String disDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图像路径")
|
||||||
|
private String imagePath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文件名")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分段名称")
|
||||||
|
private String zdAssortName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类id")
|
||||||
|
private String zdAssortId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "扫描日期")
|
||||||
|
private String scanDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "扫描盘号")
|
||||||
|
private String ph;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package com.docus.server.collect.infrastructure.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
|
||||||
|
import com.docus.infrastructure.redis.service.IdService;
|
||||||
|
import com.docus.infrastructure.redis.service.RedisLock;
|
||||||
|
import com.docus.server.collect.entity.CollectTask;
|
||||||
|
import com.docus.server.collect.infrastructure.dao.CollectTaskDao;
|
||||||
|
import com.docus.server.collect.infrastructure.mapper.CollectTaskMapper;
|
||||||
|
import com.docus.server.collect.service.dto.ReportFileInfoDTO;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集任务表dao层实现
|
||||||
|
*
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class CollectTaskDaoImpl extends BaseDaoImpl<CollectTaskMapper, CollectTask> implements CollectTaskDao {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IdService idService;
|
||||||
|
@Resource
|
||||||
|
private RedisLock redisLock;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long saveTask(ReportFileInfoDTO reportFileInfoDTO) {
|
||||||
|
Date now = new Date();
|
||||||
|
LambdaQueryWrapper<CollectTask> queryCollectTaskWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryCollectTaskWrapper.eq(CollectTask::getC1, reportFileInfoDTO.getSerialNum());
|
||||||
|
queryCollectTaskWrapper.eq(CollectTask::getSysflag, reportFileInfoDTO.getSysFlag());
|
||||||
|
queryCollectTaskWrapper.eq(CollectTask::getPatientId, reportFileInfoDTO.getPatientId());
|
||||||
|
CollectTask collectTask = baseMapper.selectOne(queryCollectTaskWrapper);
|
||||||
|
// 更新或者新增
|
||||||
|
if (collectTask != null) {
|
||||||
|
collectTask.setState("0");
|
||||||
|
collectTask.setSyncTime(now);
|
||||||
|
collectTask.setC2(reportFileInfoDTO.getFileTitle());
|
||||||
|
baseMapper.updateById(collectTask);
|
||||||
|
} else {
|
||||||
|
collectTask = new CollectTask();
|
||||||
|
collectTask.setId(getNewTaskId());
|
||||||
|
collectTask.setPatientId(reportFileInfoDTO.getPatientId());
|
||||||
|
collectTask.setSysflag(reportFileInfoDTO.getSysFlag());
|
||||||
|
collectTask.setState("0");
|
||||||
|
collectTask.setSyncTime(now);
|
||||||
|
collectTask.setC1(reportFileInfoDTO.getSerialNum());
|
||||||
|
collectTask.setC2(reportFileInfoDTO.getFileTitle());
|
||||||
|
collectTask.setC3(reportFileInfoDTO.getJzh());
|
||||||
|
baseMapper.insert(collectTask);
|
||||||
|
}
|
||||||
|
return collectTask.getId();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long getNewTaskId() {
|
||||||
|
long id = idService.getDateSeq();
|
||||||
|
LambdaQueryWrapper<CollectTask> queryCollectTaskWrapper = new LambdaQueryWrapper<>();
|
||||||
|
while (true) {
|
||||||
|
queryCollectTaskWrapper.eq(CollectTask::getId, id);
|
||||||
|
CollectTask collectTask = baseMapper.selectOne(queryCollectTaskWrapper);
|
||||||
|
if (collectTask == null) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
queryCollectTaskWrapper.clear();
|
||||||
|
id = id + 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long saveTaskUseLock(ReportFileInfoDTO reportFileInfoDTO) throws InterruptedException {
|
||||||
|
|
||||||
|
String lockFlag = "docus:gdszy:downloadplatform:report:" + reportFileInfoDTO.getPatientId() + ":" + reportFileInfoDTO.getSysFlag();
|
||||||
|
try {
|
||||||
|
redisLock.tryLock(lockFlag, 10 * 1000, 10 * 1000);
|
||||||
|
return saveTask(reportFileInfoDTO);
|
||||||
|
} finally {
|
||||||
|
redisLock.unLock(lockFlag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.docus.server.collect.infrastructure.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.docus.server.collect.entity.CollectTask;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@DS("archive-mysql")
|
||||||
|
@Mapper
|
||||||
|
public interface CollectTaskMapper extends BaseMapper<CollectTask> {
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.docus.server.collect.infrastructure.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.docus.server.collect.dto.TBasicQrDto;
|
||||||
|
import com.docus.server.collect.entity.TBasic;
|
||||||
|
import com.docus.server.collect.entity.TSeal;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@DS("archive-mysql")
|
||||||
|
@Mapper
|
||||||
|
public interface PatientBasicMapper {
|
||||||
|
/**
|
||||||
|
* 根据患者信息条件获取基础病案信息 from `docus_medicalrecord`.`t_basic`
|
||||||
|
*
|
||||||
|
* @param dto 患者基础信息条件
|
||||||
|
* @return 病案基础信息
|
||||||
|
*/
|
||||||
|
List<TBasic> getBasicInfo(@Param("dto") TBasicQrDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据封存id查询封存病案id
|
||||||
|
* @date 2024/1/15 10:41
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @param sealId 封存id
|
||||||
|
* @return 封存病案信息
|
||||||
|
*/
|
||||||
|
TSeal getBySealId(@Param("sealId") String sealId);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.docus.server.collect.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PatScanSyncResult {
|
||||||
|
private int patientTotalCount;
|
||||||
|
private int successPatientCount;
|
||||||
|
private int fileCount;
|
||||||
|
private String msg;
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<service>
|
<service>
|
||||||
<id>docus-webservice-gdszy</id>
|
<id>docus-collect-gdszy-patient-scan</id>
|
||||||
<name>生产-嘉时病案采集-广东省中医</name>
|
<name>生产-嘉时病案采集-广东省中医-扫描视图同步</name>
|
||||||
<description>生产-嘉时病案采集-广东省中医</description>
|
<description>生产-嘉时病案采集-广东省中医-扫描视图同步</description>
|
||||||
<startmode>Automatic</startmode>
|
<startmode>Automatic</startmode>
|
||||||
<executable>%BASE%\start.bat</executable>
|
<executable>%BASE%\start.bat</executable>
|
||||||
<log mode="none"></log>
|
<log mode="none"></log>
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
<?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.docus.server.collect.infrastructure.mapper.DownloadTaskMapper">
|
||||||
|
<select id="getDownloadTaskIdFromSanAssort" resultType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
`id`
|
||||||
|
FROM
|
||||||
|
`docus_archivefile`.`t_scan_assort`
|
||||||
|
where
|
||||||
|
`patient_id` = #{patientId}
|
||||||
|
and `source`= #{source}
|
||||||
|
and `file_column_1`= #{serialNum}
|
||||||
|
</select>
|
||||||
|
<select id="getDownloadTaskIdFromDownFile" resultType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
`t_scan_assort_id`
|
||||||
|
FROM
|
||||||
|
`docus_archivefile`.`af_downfile`
|
||||||
|
WHERE
|
||||||
|
`patient_id` = #{patientId}
|
||||||
|
and `collectorid` = #{source}
|
||||||
|
and `serialnum` = #{serialNum}
|
||||||
|
order by `create_time` desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findSealByCondition" resultType="com.docus.server.collect.entity.TSeal">
|
||||||
|
SELECT *
|
||||||
|
FROM
|
||||||
|
`docus_medicalrecord`.`t_seal`
|
||||||
|
where
|
||||||
|
1=1
|
||||||
|
<if test="seal.sealId != null and seal.sealId != ''">
|
||||||
|
AND seal_id=#{seal.sealId}
|
||||||
|
</if>
|
||||||
|
<if test="seal.patientId != null and seal.patientId != ''">
|
||||||
|
AND patient_id=#{seal.patientId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getFileIdFromDownfile" resultType="java.lang.Long">
|
||||||
|
select `t_scan_assort_id` from `docus_archivefile`.`af_downfile` where `t_scan_assort_id`=#{fileId} LIMIT 1
|
||||||
|
</select>
|
||||||
|
<select id="getFileIdFromSanAssort" resultType="java.lang.Long">
|
||||||
|
select id from `docus_archivefile`.`t_scan_assort` where id=#{fileId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,63 @@
|
|||||||
|
<?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.docus.server.collect.infrastructure.mapper.PatientBasicMapper">
|
||||||
|
<sql id="basicInfoColumns">
|
||||||
|
patient_id
|
||||||
|
as patientId,
|
||||||
|
admiss_times as admissTimes,
|
||||||
|
inpatient_no as inpatientNo,
|
||||||
|
admiss_id as admissId,
|
||||||
|
admiss_date as admissDate,
|
||||||
|
dis_date as disDate,
|
||||||
|
admiss_dept_name as admissDeptName,
|
||||||
|
dis_dept_name as disDeptName ,
|
||||||
|
jzh,
|
||||||
|
name,
|
||||||
|
emp_id as empId
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getBasicInfo" resultType="com.docus.server.collect.entity.TBasic">
|
||||||
|
select
|
||||||
|
<include refid="basicInfoColumns"></include>
|
||||||
|
FROM
|
||||||
|
`docus_medicalrecord`.`t_basic`
|
||||||
|
WHERE
|
||||||
|
is_cancel=0
|
||||||
|
<if test="dto.patientId != null and dto.patientId != ''">
|
||||||
|
and `patient_id` = #{dto.patientId}
|
||||||
|
</if>
|
||||||
|
<if test="dto.jzh != null and dto.jzh != ''">
|
||||||
|
and `jzh` = #{dto.jzh}
|
||||||
|
</if>
|
||||||
|
<if test="dto.empId != null and dto.empId != ''">
|
||||||
|
and `emp_id` = #{dto.empId}
|
||||||
|
</if>
|
||||||
|
<if test="dto.inpatientNo != null and dto.inpatientNo != ''">
|
||||||
|
and `inpatient_no` = #{dto.inpatientNo}
|
||||||
|
</if>
|
||||||
|
<if test="dto.admisstimes != null">
|
||||||
|
and `admiss_times` = #{dto.admissTimes}
|
||||||
|
</if>
|
||||||
|
<if test="dto.disDateStart != null and dto.disDateStart != ''">
|
||||||
|
and `dis_date` between #{dto.disDateStart} and #{dto.disDateEnd}
|
||||||
|
</if>
|
||||||
|
<if test="dto.name != null and dto.name != ''">
|
||||||
|
and `name` = #{dto.name}
|
||||||
|
</if>
|
||||||
|
<if test="dto.ignorePh==1">
|
||||||
|
and ph is null
|
||||||
|
</if>
|
||||||
|
limit 2
|
||||||
|
</select>
|
||||||
|
<select id="getBySealId" resultType="com.docus.server.collect.entity.TSeal">
|
||||||
|
SELECT *
|
||||||
|
FROM
|
||||||
|
`docus_medicalrecord`.`t_seal`
|
||||||
|
where
|
||||||
|
seal_id=#{sealId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,49 @@
|
|||||||
|
<?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.docus.server.collect.infrastructure.mapper.PatientScanMapper">
|
||||||
|
<sql id="patSmViewField">
|
||||||
|
主键 as id,
|
||||||
|
住院号 as inpatientNo,
|
||||||
|
次数 as admissTimes,
|
||||||
|
病人姓名 as name,
|
||||||
|
出院日期 as disDate,
|
||||||
|
图像路径 as imagePath,
|
||||||
|
文件名 as fileName,
|
||||||
|
分段名称 as zdAssortName,
|
||||||
|
分类id as zdAssortId,
|
||||||
|
扫描日期 as scanDate,
|
||||||
|
扫描盘号 as ph
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getScanData" resultType="com.docus.server.collect.entity.PatientScan">
|
||||||
|
select
|
||||||
|
<include refid="patSmViewField"></include>
|
||||||
|
from pat_sm
|
||||||
|
where
|
||||||
|
住院号=#{dto.inpatientNo}
|
||||||
|
and 病人姓名=#{dto.name}
|
||||||
|
and 出院日期=#{dto.disDateTime}
|
||||||
|
and 扫描盘号 like 'G%'
|
||||||
|
</select>
|
||||||
|
<select id="getScanPatientConditionByScanDate" resultType="com.docus.server.collect.dto.PatientScanConditionDTO">
|
||||||
|
select 住院号 as inpatientNo,
|
||||||
|
出院日期 as disDateTime,
|
||||||
|
病人姓名 as name
|
||||||
|
from pat_sm
|
||||||
|
where 扫描日期 between #{start} and #{end}
|
||||||
|
and 扫描盘号 like 'G%'
|
||||||
|
group by 住院号, 出院日期,病人姓名
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getScanPatientConditionByDisDate" resultType="com.docus.server.collect.dto.PatientScanConditionDTO">
|
||||||
|
select 住院号 as inpatientNo,
|
||||||
|
出院日期 as disDateTime,
|
||||||
|
病人姓名 as name
|
||||||
|
from pat_sm
|
||||||
|
where 出院日期 between #{start} and #{end}
|
||||||
|
and 扫描盘号 like 'G%'
|
||||||
|
group by 住院号, 出院日期,病人姓名
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -1,123 +0,0 @@
|
|||||||
<?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.docus.server.collect.infrastructure.mapper.DownloadTaskMapper">
|
|
||||||
<sql id="basicInfoColumns">
|
|
||||||
patient_id as patientId,
|
|
||||||
admiss_times as admissTimes,
|
|
||||||
inpatient_no as inpatientNo,
|
|
||||||
admiss_id as admissId,
|
|
||||||
admiss_date as admissDate,
|
|
||||||
dis_date as disDate,
|
|
||||||
admiss_dept_name as admissDeptName,
|
|
||||||
dis_dept_name as disDeptName ,
|
|
||||||
jzh,
|
|
||||||
name,
|
|
||||||
emp_id as empId
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="getBasicInfo" resultType="com.docus.server.collect.entity.TBasic">
|
|
||||||
select
|
|
||||||
<include refid="basicInfoColumns"></include>
|
|
||||||
FROM
|
|
||||||
`docus_medicalrecord`.`t_basic`
|
|
||||||
WHERE
|
|
||||||
is_cancel=0
|
|
||||||
<if test="basic.patientId != null and basic.patientId != ''">
|
|
||||||
and `patient_id` = #{basic.patientId}
|
|
||||||
</if>
|
|
||||||
<if test="basic.jzh != null and basic.jzh != ''">
|
|
||||||
and `jzh` = #{basic.jzh}
|
|
||||||
</if>
|
|
||||||
<if test="basic.empId != null and basic.empId != ''">
|
|
||||||
and `emp_id` = #{basic.empId}
|
|
||||||
</if>
|
|
||||||
<if test="basic.inpatientNo != null and basic.inpatientNo != ''">
|
|
||||||
and `inpatient_no` = #{basic.inpatientNo}
|
|
||||||
</if>
|
|
||||||
<if test="basic.admisstimes != null">
|
|
||||||
and `admiss_times` = #{basic.admissTimes}
|
|
||||||
</if>
|
|
||||||
limit 2
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="countBasicInfo" resultType="java.lang.Integer">
|
|
||||||
select
|
|
||||||
count(1)
|
|
||||||
from `docus_medicalrecord`.`t_basic`
|
|
||||||
WHERE
|
|
||||||
is_cancel=0
|
|
||||||
<if test="dto.patientId != null and dto.patientId != ''">
|
|
||||||
and `patient_id` = #{dto.patientId}
|
|
||||||
</if>
|
|
||||||
<if test="dto.jzh != null and dto.jzh != ''">
|
|
||||||
and `jzh` = #{dto.jzh}
|
|
||||||
</if>
|
|
||||||
<if test="dto.empId != null and dto.empId != ''">
|
|
||||||
and `emp_id` = #{dto.empId}
|
|
||||||
</if>
|
|
||||||
<if test="dto.inpatientNo != null and dto.inpatientNo != ''">
|
|
||||||
and `inpatient_no` = #{dto.inpatientNo}
|
|
||||||
</if>
|
|
||||||
<if test="dto.admisstimes != null">
|
|
||||||
and `admiss_times` = #{dto.admissTimes}
|
|
||||||
</if>
|
|
||||||
<if test="dto.admisstimes != null">
|
|
||||||
and `dis_date` between #{dto.disDateStart} AND #{dto.disDateEnd}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<select id="pageBasicInfo" resultType="com.docus.server.collect.entity.TBasic">
|
|
||||||
select
|
|
||||||
<include refid="basicInfoColumns"></include>
|
|
||||||
from `docus_medicalrecord`.`t_basic`
|
|
||||||
WHERE
|
|
||||||
is_cancel=0
|
|
||||||
<if test="dto.patientId != null and dto.patientId != ''">
|
|
||||||
and `patient_id` = #{dto.patientId}
|
|
||||||
</if>
|
|
||||||
<if test="dto.jzh != null and dto.jzh != ''">
|
|
||||||
and `jzh` = #{dto.jzh}
|
|
||||||
</if>
|
|
||||||
<if test="dto.empId != null and dto.empId != ''">
|
|
||||||
and `emp_id` = #{dto.empId}
|
|
||||||
</if>
|
|
||||||
<if test="dto.inpatientNo != null and dto.inpatientNo != ''">
|
|
||||||
and `inpatient_no` = #{dto.inpatientNo}
|
|
||||||
</if>
|
|
||||||
<if test="dto.admisstimes != null">
|
|
||||||
and `admiss_times` = #{dto.admissTimes}
|
|
||||||
</if>
|
|
||||||
<if test="dto.admisstimes != null">
|
|
||||||
and `dis_date` between #{dto.disDateStart} AND #{dto.disDateEnd}
|
|
||||||
</if>
|
|
||||||
<if test="dto.admisstimes != null">
|
|
||||||
and `dis_date` between #{dto.disDateStart} AND #{dto.disDateEnd}
|
|
||||||
</if>
|
|
||||||
LIMIT ${offset},${size}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDownloadTaskIdFromSanAssort" resultType="java.lang.Long">
|
|
||||||
SELECT
|
|
||||||
`id`
|
|
||||||
FROM
|
|
||||||
`docus_archivefile`.`t_scan_assort`
|
|
||||||
where
|
|
||||||
`patient_id` = #{patientId}
|
|
||||||
and `source`= #{source}
|
|
||||||
and `file_column_1`= #{serialNum}
|
|
||||||
</select>
|
|
||||||
<select id="getDownloadTaskIdFromDownFile" resultType="java.lang.Long">
|
|
||||||
SELECT
|
|
||||||
`t_scan_assort_id`
|
|
||||||
FROM
|
|
||||||
`docus_archivefile`.`af_downfile`
|
|
||||||
WHERE
|
|
||||||
`patient_id` = #{patientId}
|
|
||||||
and `collectorid` = #{source}
|
|
||||||
and `serialnum` = #{serialNum}
|
|
||||||
order by `create_time` desc limit 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue