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.
124 lines
4.5 KiB
XML
124 lines
4.5 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">
|
|
<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>
|