112 lines
6.7 KiB
XML
112 lines
6.7 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.busDoctor.mapper.TransfuseApplyMapper">
|
||
|
|
<select id="queryList" resultType="map">
|
||
|
|
SELECT DISTINCT xk_transfuse_apply.bill_no,
|
||
|
|
xk_transfuse_apply.dept_id,
|
||
|
|
xk_patient_info.patient_name,
|
||
|
|
xk_transfuse_apply.apply_date,
|
||
|
|
xk_transfuse_apply.apply_medic,
|
||
|
|
xk_transfuse_apply.bill_stasus,
|
||
|
|
xk_transfuse_apply.beinhos_id ,
|
||
|
|
xk_transfuse_apply.abo_type,
|
||
|
|
xk_transfuse_apply.rh_type,
|
||
|
|
xk_transfuse_apply.is_large_use,
|
||
|
|
SUBSTRING(( SELECT ',' +xx.breed_name+CONVERT(varchar(255),CONVERT(decimal(10,1),x.blood_num))+x.unit
|
||
|
|
from xk_transfuse_apply_bloodbreed x join xk_blood_breed xx on xx.breed_code=x.blood_breed where x.bill_no=xk_transfuse_apply.bill_no FOR XML PATH('') ),2,999) as req_breed
|
||
|
|
FROM xk_patient_info RIGHT OUTER JOIN xk_transfuse_apply ON xk_patient_info.beinhos_id = xk_transfuse_apply.beinhos_id
|
||
|
|
WHERE ( xk_transfuse_apply.operation_type = 'C' OR ISNULL(xk_transfuse_apply.operation_type,'') = '')
|
||
|
|
and xk_transfuse_apply.apply_date > getdate() - #{day}
|
||
|
|
<if test="bill_status != null and bill_status != ''">and xk_transfuse_apply.bill_stasus = #{bill_status}</if>
|
||
|
|
<if test="dept_code != null and dept_code != ''">and xk_transfuse_apply.dept_id = #{dept_code}</if>
|
||
|
|
<if test="dept_code != null and dept_code != ''">and (xk_transfuse_apply.dept_id = #{dept_code} or xk_transfuse_apply.input_dept = #{dept_code})</if>
|
||
|
|
<if test="doctor_code != null and doctor_code != ''">and xk_transfuse_apply.apply_medic = #{doctor_code}</if>
|
||
|
|
</select>
|
||
|
|
<select id="queryApplyOne" resultType="java.util.Map">
|
||
|
|
SELECT top 1 xk_patient_info.hos_id,
|
||
|
|
xk_patient_info.patient_name,
|
||
|
|
xk_patient_info.age,
|
||
|
|
xk_transfuse_apply.zone_id,
|
||
|
|
xk_patient_info.patient_sex,
|
||
|
|
xk_patient_info.patient_birthday,
|
||
|
|
xk_transfuse_apply.patient_bed,
|
||
|
|
xk_transfuse_apply.casehistory_id,
|
||
|
|
xk_transfuse_apply.dept_id,
|
||
|
|
xk_transfuse_apply.card_no,
|
||
|
|
xk_patient_info.apanage,
|
||
|
|
xk_transfuse_apply.hos_id,
|
||
|
|
xk_transfuse_apply.bill_no,
|
||
|
|
xk_transfuse_apply.beinhos_id,
|
||
|
|
xk_patient_info.transfuse_history,
|
||
|
|
xk_patient_info.gestation_history,
|
||
|
|
xk_patient_info.parturition_history,
|
||
|
|
xk_patient_info.reaction_history,
|
||
|
|
xk_transfuse_apply.apply_date,
|
||
|
|
xk_transfuse_apply.send_person,
|
||
|
|
xk_transfuse_apply.charge_sign,
|
||
|
|
xk_transfuse_apply.input_person,
|
||
|
|
xk_transfuse_apply.receive_date,
|
||
|
|
xk_transfuse_apply.attending_medic,
|
||
|
|
xk_transfuse_apply.bank_director,
|
||
|
|
xk_transfuse_apply.medical_affairs,
|
||
|
|
xk_transfuse_apply.sample_id,
|
||
|
|
xk_transfuse_apply.gather_date,
|
||
|
|
xk_transfuse_apply.abo_type,
|
||
|
|
xk_transfuse_apply.rh_type,
|
||
|
|
xk_transfuse_apply.check_sign,
|
||
|
|
xk_transfuse_apply.bill_stasus,
|
||
|
|
xk_patient_info.out_sign,
|
||
|
|
xk_transfuse_apply.apply_medic,
|
||
|
|
xk_transfuse_apply.diagnoses,
|
||
|
|
xk_transfuse_apply.intent,
|
||
|
|
xk_transfuse_apply.treat_medic,
|
||
|
|
xk_transfuse_apply.causalis,
|
||
|
|
xk_transfuse_apply.use3_date,
|
||
|
|
xk_transfuse_apply.use2_date,
|
||
|
|
xk_transfuse_apply.use1_date,
|
||
|
|
xk_patient_info.match_history,
|
||
|
|
xk_transfuse_apply.apply_type,
|
||
|
|
xk_transfuse_apply.bill_type,
|
||
|
|
xk_transfuse_apply.operation_type ,
|
||
|
|
xk_transfuse_apply_bloodbreed.blood_breed ,
|
||
|
|
xk_transfuse_apply_bloodbreed.blood_num ,
|
||
|
|
xk_transfuse_apply_bloodbreed.unit ,
|
||
|
|
xk_transfuse_apply_bloodbreed.onetime_num ,
|
||
|
|
xk_transfuse_apply_bloodbreed.special_deal ,
|
||
|
|
xk_transfuse_apply_bloodbreed.replace_bloodbreed,
|
||
|
|
xk_transfuse_apply_bloodbreed.remark,
|
||
|
|
xk_transfuse_apply.bill_sort,
|
||
|
|
xk_transfuse_apply.sample_sign,
|
||
|
|
xk_transfuse_apply_bloodbreed.apply_bloodtype,
|
||
|
|
xk_transfuse_apply.check_explain,
|
||
|
|
xk_transfuse_apply.input_dept,
|
||
|
|
xk_transfuse_apply.send_able,
|
||
|
|
xk_transfuse_apply.medic_check_date,
|
||
|
|
xk_transfuse_apply.check_medic,xk_transfuse_apply.remark,
|
||
|
|
xk_transfuse_apply.is_large_use,xk_transfuse_apply.agreement_ink,
|
||
|
|
xk_transfuse_apply.beinhos_number ,xk_transfuse_apply.notify_sign,
|
||
|
|
xk_transfuse_apply.Use_Type ,xk_transfuse_apply.Valid_Flag,
|
||
|
|
xk_transfuse_apply.Ill_Code,xk_transfuse_apply.Dept_Type,
|
||
|
|
xk_transfuse_apply.Ops_Name,xk_transfuse_apply.Use1_Num,xk_transfuse_apply.operation_name,xk_transfuse_apply.operation_level
|
||
|
|
FROM xk_patient_info RIGHT OUTER JOIN xk_transfuse_apply ON xk_patient_info.beinhos_id = xk_transfuse_apply.beinhos_id ,
|
||
|
|
xk_transfuse_apply_bloodbreed
|
||
|
|
WHERE xk_transfuse_apply.bill_no = xk_transfuse_apply_bloodbreed.bill_no AND
|
||
|
|
xk_transfuse_apply.bill_no = #{bill_no}
|
||
|
|
</select>
|
||
|
|
<select id="queryApplyBeforeList" resultType="java.util.Map">
|
||
|
|
select
|
||
|
|
xk_transfuse_apply_before.bill_no,
|
||
|
|
xk_transfuse_apply_before.dept_id,
|
||
|
|
xk_patient_info.patient_name,
|
||
|
|
xk_transfuse_apply_before.beinhos_id,
|
||
|
|
xk_transfuse_apply_before.assess_data,
|
||
|
|
xk_transfuse_apply_before.assess_person
|
||
|
|
from
|
||
|
|
xk_transfuse_apply_before,xk_patient_info
|
||
|
|
where
|
||
|
|
xk_transfuse_apply_before.beinhos_id = xk_patient_info.beinhos_id AND
|
||
|
|
xk_transfuse_apply_before.assess_data>GETDATE() - 1 AND
|
||
|
|
(xk_transfuse_apply_before.dept_id=#{dept_id} or xk_transfuse_apply_before.assess_person=#{assess_person})
|
||
|
|
</select>
|
||
|
|
</mapper>
|