|
|
@@ -132,13 +132,13 @@
|
|
|
i.run_state as device_run_state,
|
|
|
i.alarm as device_alarm,
|
|
|
i.start_time as infusion_start_time
|
|
|
- FROM (SELECT `name`,gender,infusion_id,CODE,id,tenant_id FROM bus_patient WHERE bus_patient.`alarm`=1) AS p
|
|
|
+ FROM (SELECT `name`,gender,infusion_id,CODE,id FROM bus_patient WHERE bus_patient.`alarm`=1) AS p
|
|
|
join (select * from bus_infusion_history where is_undo=0 and finished=0) as i on i.patient_id=p.id
|
|
|
join (select device_id,alias from bus_device) as d on d.device_id=i.device_id
|
|
|
join (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON c.`patient_id`=p.id;
|
|
|
<where>
|
|
|
- <if test="query.tenantId!=null">
|
|
|
- and p.tenant_id=#{query.tenantId}
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and p.tenant_id=#{tenantId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -165,11 +165,11 @@
|
|
|
c.finished as finished,
|
|
|
c.monitor_start_time as monitor_start_time,
|
|
|
c.config_person as config_person
|
|
|
- FROM (SELECT `name`,gender,CODE,tenant_id,id,tenant_id FROM bus_patient WHERE bus_patient.`alarm`=2 ) AS p
|
|
|
+ FROM (SELECT `name`,gender,CODE,tenant_id,id FROM bus_patient WHERE bus_patient.`alarm`=2 ) AS p
|
|
|
join (SELECT * FROM bus_clinic WHERE finished=0 and monitor_type=1) AS c ON c.`patient_id`=p.id
|
|
|
<where>
|
|
|
- <if test="query.tenantId!=null">
|
|
|
- and p.tenant_id=#{query.tenantId}
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and p.tenant_id=#{tenantId}
|
|
|
</if>
|
|
|
</where>
|
|
|
order by c.monitor_start_time desc;
|