|
|
@@ -281,4 +281,67 @@
|
|
|
</where>
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findByPatientCode" resultMap="monitorResult">
|
|
|
+ select
|
|
|
+ p.`name` as patient_name,
|
|
|
+ p.`code` as patient_code,
|
|
|
+ p.gender as gender,
|
|
|
+ p.alarm as patient_alarm,
|
|
|
+ p.tmp_finished as tmp_finished,
|
|
|
+ p.monitor_start_time as monitor_start_time,
|
|
|
+ p.monitor_end_time as monitor_end_time,
|
|
|
+ i.device_id as device_id,
|
|
|
+ i.clinic_id as clinic_id,
|
|
|
+ i.ward as ward,
|
|
|
+ i.bed_no as bed_no,
|
|
|
+ i.total_dose as total_dose,
|
|
|
+ i.first_dose as first_dose,
|
|
|
+ i.remain_dose as remain_dose,
|
|
|
+ i.input_dose as input_dose,
|
|
|
+ i.append_dose as append_dose,
|
|
|
+ i.append_lock_time as append_lock_time,
|
|
|
+ i.max_dose as max_dose,
|
|
|
+ i.electric_quantity as electric_quantity,
|
|
|
+ i.warn_flow as warn_flow,
|
|
|
+ i.self_control_count as self_control_count,
|
|
|
+ i.self_control_lock_time as self_control_lock_time,
|
|
|
+ i.pca_valid_count as pca_valid_count,
|
|
|
+ i.pca_invalid_count as pca_invalid_count,
|
|
|
+ i.pca_total_count as pca_total_count,
|
|
|
+ i.continue_dose as continue_dose,
|
|
|
+ i.pulse_dose as pulse_dose,
|
|
|
+ i.pulse_lock_time as pulse_lock_time,
|
|
|
+ i.pulse_first_lock_time as pulse_first_lock_time,
|
|
|
+ i.flow_up_cycle as flow_up_cycle,
|
|
|
+ i.flow_down_cycle as flow_down_cycle,
|
|
|
+ i.flow_count as flow_count,
|
|
|
+ i.flow_up_limit as flow_up_limit,
|
|
|
+ i.flow_down_limit as flow_down_limit,
|
|
|
+ i.flow_adjust_rate as flow_adjust_rate,
|
|
|
+ i.run_state as run_state,
|
|
|
+ i.warn_will_finished as warn_will_finished,
|
|
|
+ i.warn_analgesic_poor as warn_analgesic_poor,
|
|
|
+ i.warn_low_battery as warn_low_battery,
|
|
|
+ i.alarm as device_alarm,
|
|
|
+ i.start_time as infusion_start_time,
|
|
|
+ i.remark as remark,
|
|
|
+ i.type as device_type,
|
|
|
+ r.alias as device_alias,
|
|
|
+ c.ana_doctor as ana_doctor,
|
|
|
+ c.patient_age as patient_age,
|
|
|
+ c.ana_type as ana_type,
|
|
|
+ c.anal_type as anal_type,
|
|
|
+ c.surgery_doctor as surgery_doctor,
|
|
|
+ c.surgery_name as surgery_name
|
|
|
+ from
|
|
|
+ (select * from bus_patient where tenant_id=#{tenantId} and code=#{patientCode} )
|
|
|
+ as p
|
|
|
+ join
|
|
|
+ bus_infusion_history as i on p.infusion_id=i.id
|
|
|
+ join (select device_id,alias from bus_device_running) as r on r.device_id=i.device_id
|
|
|
+ left join bus_clinic c on i.clinic_id=c.id
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
</mapper>
|