73 lines
3.6 KiB
XML
73 lines
3.6 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.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>
|
||
|
|
</mapper>
|