2026-07-24 17:57:42 +08:00
|
|
|
<?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.czblood.busNurse.mapper.SampleInfoMapper">
|
|
|
|
|
|
|
|
|
|
<select id="queryList" resultType="java.util.Map">
|
|
|
|
|
SELECT xk_sample_info.Sample_No,
|
|
|
|
|
xk_sample_info.Purpose,
|
|
|
|
|
xk_sample_info.Dept,
|
|
|
|
|
xk_sample_info.Relate_ApplyNo,
|
|
|
|
|
xk_sample_info.Blood_Type,
|
|
|
|
|
xk_sample_info.Rh_Blood_Type,
|
|
|
|
|
xk_sample_info.Sample_Name,
|
|
|
|
|
xk_sample_info.Sex,
|
|
|
|
|
xk_sample_info.Age,
|
|
|
|
|
xk_sample_info.Birthday,
|
|
|
|
|
xk_sample_info.Pick_Nurse,
|
|
|
|
|
xk_sample_info.Pick_Date,
|
|
|
|
|
xk_sample_info.Send_Nurse,
|
|
|
|
|
xk_sample_info.Send_Date,
|
|
|
|
|
xk_sample_info.TakeOver_Man,
|
|
|
|
|
xk_sample_info.TakeOver_Date,
|
|
|
|
|
xk_sample_info.Discard_Person,
|
|
|
|
|
xk_sample_info.Discard_Date,
|
|
|
|
|
xk_sample_info.Discard_Reason,
|
|
|
|
|
xk_sample_info.Exp2,
|
|
|
|
|
xk_sample_info.Overdue_Flag ,
|
|
|
|
|
xk_sample_info.sendperson,
|
|
|
|
|
xk_sample_info.sample_status,
|
|
|
|
|
xk_transfuse_apply_bloodbreed.blood_breed,
|
|
|
|
|
(select is_match from xk_blood_breed where xk_blood_breed.breed_code = xk_transfuse_apply_bloodbreed.blood_breed ) as is_match
|
|
|
|
|
FROM xk_sample_info
|
|
|
|
|
LEFT JOIN xk_transfuse_apply ON (xk_sample_info.Relate_ApplyNo = xk_transfuse_apply.bill_no)
|
|
|
|
|
LEFT JOIN xk_transfuse_apply_bloodbreed ON (xk_transfuse_apply_bloodbreed.bill_no = xk_transfuse_apply.bill_no)
|
|
|
|
|
where (xk_sample_info.pick_date Between #{stime} AND #{etime})
|
|
|
|
|
<if test="dept != null and dept != ''">AND (xk_sample_info.dept = #{dept})</if>
|
|
|
|
|
<if test="sample_no != null and sample_no != ''">and (xk_sample_info.Sample_No = #{sample_no})</if>
|
|
|
|
|
UNION ALL
|
|
|
|
|
SELECT
|
|
|
|
|
'不需要血型复核' AS Sample_No,
|
|
|
|
|
'A' AS Purpose,
|
|
|
|
|
xk_transfuse_apply.dept_id AS dept,
|
|
|
|
|
xk_transfuse_apply.bill_no AS Relate_ApplyNo,
|
|
|
|
|
xk_patient_info.abo AS Blood_Type,
|
|
|
|
|
xk_patient_info.rh AS Rh_Blood_Type,
|
|
|
|
|
xk_patient_info.patient_name AS Sample_Name,
|
|
|
|
|
xk_patient_info.patient_sex AS Sex,
|
|
|
|
|
xk_patient_info.age AS Age,
|
|
|
|
|
xk_patient_info.patient_birthday AS Birthday,
|
|
|
|
|
'' AS Pick_Nurse,
|
|
|
|
|
'' AS Pick_Date,
|
|
|
|
|
'' AS Send_Nurse,
|
|
|
|
|
'' AS Send_Date,
|
|
|
|
|
'' AS TakeOver_Man,
|
|
|
|
|
'' AS TakeOver_Date,
|
|
|
|
|
'' AS Discard_Person,
|
|
|
|
|
'' AS Discard_Date,
|
|
|
|
|
'' AS Discard_Reason,
|
|
|
|
|
'' AS Exp2,
|
|
|
|
|
'' AS Overdue_Flag,
|
|
|
|
|
'' AS sendperson,
|
|
|
|
|
'1' AS sample_status,
|
|
|
|
|
xk_transfuse_apply_bloodbreed.blood_breed,
|
|
|
|
|
(select is_match from xk_blood_breed where xk_blood_breed.breed_code = xk_transfuse_apply_bloodbreed.blood_breed ) as is_match
|
|
|
|
|
FROM xk_transfuse_apply
|
|
|
|
|
LEFT JOIN xk_transfuse_apply_bloodbreed ON (xk_transfuse_apply.bill_no = xk_transfuse_apply_bloodbreed.bill_no)
|
|
|
|
|
INNER JOIN xk_patient_info ON (xk_transfuse_apply.beinhos_id = xk_patient_info.beinhos_id)
|
|
|
|
|
WHERE xk_transfuse_apply.isxxfh = '0'
|
|
|
|
|
and xk_transfuse_apply.apply_date Between #{stime} AND #{etime}
|
|
|
|
|
<if test="dept != null and dept != ''">AND (xk_transfuse_apply.dept_id = #{dept})</if>
|
|
|
|
|
<if test="sample_no != null and sample_no != ''">and (xk_transfuse_apply.bill_no = #{sample_no)}</if>
|
|
|
|
|
</select>
|
2026-07-28 17:20:29 +08:00
|
|
|
<select id="querySampleInfoData" resultType="java.util.Map">
|
|
|
|
|
SELECT xk_transfuse_apply_bloodbreed.blood_breed,
|
|
|
|
|
xk_transfuse_apply_bloodbreed.blood_num,
|
|
|
|
|
xk_transfuse_apply_bloodbreed.unit,
|
|
|
|
|
xk_transfuse_apply.bill_no,
|
|
|
|
|
xk_transfuse_apply.beinhos_id,
|
|
|
|
|
xk_transfuse_apply.dept_id,
|
|
|
|
|
xk_transfuse_apply.patient_bed,
|
|
|
|
|
xk_transfuse_apply.apply_date,
|
|
|
|
|
xk_transfuse_apply.apply_medic,
|
|
|
|
|
xk_patient_info.patient_name,
|
|
|
|
|
xk_patient_info.abo,
|
|
|
|
|
xk_patient_info.rh,
|
|
|
|
|
xk_patient_info.patient_sex,
|
|
|
|
|
xk_patient_info.age,
|
|
|
|
|
xk_patient_info.patient_birthday,
|
|
|
|
|
xk_transfuse_apply.sample_id,
|
|
|
|
|
xk_transfuse_apply.bill_stasus
|
|
|
|
|
FROM xk_patient_info,
|
|
|
|
|
xk_transfuse_apply,
|
|
|
|
|
xk_transfuse_apply_bloodbreed
|
|
|
|
|
WHERE ( xk_patient_info.beinhos_id = xk_transfuse_apply.beinhos_id )
|
|
|
|
|
and ( xk_transfuse_apply.bill_no = xk_transfuse_apply_bloodbreed.bill_no )
|
|
|
|
|
<![CDATA[and ( xk_transfuse_apply.operation_type = 'C' ) and xk_transfuse_apply.bill_stasus <> 'Z']]>
|
|
|
|
|
and xk_transfuse_apply.sample_id IS NULL and xk_transfuse_apply.isxxfh is null
|
|
|
|
|
<if test="dept != null and dept != ''">AND (xk_transfuse_apply.dept_id = #{dept})</if>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="queryMaxTestDateInfo" resultType="com.czblood.bus.pojo.XkCheckBloodtype">
|
|
|
|
|
SELECT top 1 * FROM xk_check_bloodtype Where Beinhos_id = #{beinhos_id} Order By test_date Desc
|
|
|
|
|
</select>
|
2026-07-24 17:57:42 +08:00
|
|
|
</mapper>
|