|
|
|
<?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="getBasicInfo" resultType="com.docus.server.collect.entity.TBasic">
|
|
|
|
select
|
|
|
|
`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`
|
|
|
|
FROM
|
|
|
|
`docus_medicalrecord`.`t_basic`
|
|
|
|
WHERE
|
|
|
|
is_cancel=0
|
|
|
|
<if test="dto.patientId != null and dto.patientId != ''">
|
|
|
|
and `patient_id` = #{basic.patientId}
|
|
|
|
</if>
|
|
|
|
<if test="dto.jzh != null and dto.jzh != ''">
|
|
|
|
and `jzh` = #{basic.jzh}
|
|
|
|
</if>
|
|
|
|
<if test="basic.empId != null and basic.empId != ''">
|
|
|
|
and `emp_id` = #{basic.empId}
|
|
|
|
</if>
|
|
|
|
<if test="dto.inpatientNo != null and dto.inpatientNo != ''">
|
|
|
|
and `inpatient_no` = #{basic.inpatientNo}
|
|
|
|
</if>
|
|
|
|
<if test="dto.admisstimes != null">
|
|
|
|
and `admiss_times` = #{basic.admissTimes}
|
|
|
|
</if>
|
|
|
|
limit 2
|
|
|
|
</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>
|