You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doucs-collect-gdszy/src/main/resources/mapper/TBasicMapper.xml

59 lines
2.0 KiB
XML

<?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` = #{dto.patientId}
</if>
<if test="dto.jzh != null and dto.jzh != ''">
and `jzh` = #{dto.jzh}
</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>
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>