|
@@ -86,6 +86,7 @@
|
|
|
<result column="block2" property="block2"/>
|
|
<result column="block2" property="block2"/>
|
|
|
<result column="block_status" property="blockStatus"/>
|
|
<result column="block_status" property="blockStatus"/>
|
|
|
<result column="abnormal" property="abnormal"/>
|
|
<result column="abnormal" property="abnormal"/>
|
|
|
|
|
+ <result column="abnormal_reason" property="abnormalReason"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="deviceNone" type="com.nb.web.service.bus.service.dto.PatientDeviceNoneResult">
|
|
<resultMap id="deviceNone" type="com.nb.web.service.bus.service.dto.PatientDeviceNoneResult">
|
|
@@ -246,8 +247,9 @@
|
|
|
c.ward as ward,
|
|
c.ward as ward,
|
|
|
c.bed_no as bed_no,
|
|
c.bed_no as bed_no,
|
|
|
c.eval_time as eval_time,
|
|
c.eval_time as eval_time,
|
|
|
|
|
+ c.manage_type as manage_type,
|
|
|
c.abnormal as abnormal,
|
|
c.abnormal as abnormal,
|
|
|
- c.manage_type as manage_type
|
|
|
|
|
|
|
+ c.abnormal_reason as abnormal_reason
|
|
|
from
|
|
from
|
|
|
(select * from bus_patient
|
|
(select * from bus_patient
|
|
|
<where>
|
|
<where>
|
|
@@ -349,7 +351,10 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.timeRange != null and query.timeRange.size >0">
|
|
<if test="query.timeRange != null and query.timeRange.size >0">
|
|
|
- and monitor_start_time >= #{query.timeRange[0]} and monitor_start_time <= #{query.timeRange[1]}
|
|
|
|
|
|
|
+ and monitor_start_time >= #{query.timeRange[0]}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.timeRange != null and query.timeRange.size >1">
|
|
|
|
|
+ and monitor_start_time <= #{query.timeRange[1]}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.tenantId!=null">
|
|
<if test="query.tenantId!=null">
|
|
|
and tenant_id=#{query.tenantId}
|
|
and tenant_id=#{query.tenantId}
|
|
@@ -454,7 +459,8 @@
|
|
|
c.surgery_name as surgery_name,
|
|
c.surgery_name as surgery_name,
|
|
|
c.ward as ward,
|
|
c.ward as ward,
|
|
|
c.bed_no as bed_no,
|
|
c.bed_no as bed_no,
|
|
|
- c.eval_time as eval_time
|
|
|
|
|
|
|
+ c.eval_time as eval_time,
|
|
|
|
|
+ bh.code as hospital_code
|
|
|
from
|
|
from
|
|
|
(select * from bus_patient
|
|
(select * from bus_patient
|
|
|
<where>
|
|
<where>
|
|
@@ -471,6 +477,7 @@
|
|
|
bus_infusion_history as i on p.infusion_id=i.id
|
|
bus_infusion_history as i on p.infusion_id=i.id
|
|
|
left join (select device_id,alias,product_no from bus_device) as d on d.device_id=i.device_id
|
|
left join (select device_id,alias,product_no from bus_device) as d on d.device_id=i.device_id
|
|
|
left join (select * from bus_clinic where monitor_type=1) c on p.clinic_id=c.id
|
|
left join (select * from bus_clinic where monitor_type=1) c on p.clinic_id=c.id
|
|
|
|
|
+ left join bus_hospital as bh on bh.tenant_id=p.tenant_id
|
|
|
limit 1
|
|
limit 1
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -570,7 +577,7 @@
|
|
|
c.eval_time AS eval_time, <!-- 评价时间 -->
|
|
c.eval_time AS eval_time, <!-- 评价时间 -->
|
|
|
c.manage_type AS manage_type,
|
|
c.manage_type AS manage_type,
|
|
|
c.abnormal as abnormal,
|
|
c.abnormal as abnormal,
|
|
|
- c.monitor_start_time as monitor_start_time
|
|
|
|
|
|
|
+ c.monitor_start_time as monitor_start_time,
|
|
|
<!-- 设备与输注信息 -->
|
|
<!-- 设备与输注信息 -->
|
|
|
i.device_id AS device_id,
|
|
i.device_id AS device_id,
|
|
|
d.alias AS device_alias, <!-- 假设来自设备表,若未关联需调整 -->
|
|
d.alias AS device_alias, <!-- 假设来自设备表,若未关联需调整 -->
|
|
@@ -674,14 +681,14 @@
|
|
|
|
|
|
|
|
<!--无提醒-->
|
|
<!--无提醒-->
|
|
|
<if test="query.warn != null and query.warn == false">
|
|
<if test="query.warn != null and query.warn == false">
|
|
|
- AND (i.warn_flow is null and i.warn_low_battery = 0 and i.warn_will_finished =0 and i.warn_analgesic_poor=0)
|
|
|
|
|
|
|
+ AND ((i.warn_flow is null or i.warn_flow = 0) and i.warn_low_battery = 0 and i.warn_will_finished =0 and i.warn_analgesic_poor=0)
|
|
|
</if>
|
|
</if>
|
|
|
<!--有提醒-->
|
|
<!--有提醒-->
|
|
|
<if test="query.warn != null and query.warn == true">
|
|
<if test="query.warn != null and query.warn == true">
|
|
|
- AND (i.warn_flow = 1 or i.warn_low_battery = 1 or i.warn_will_finished=1 or i.warn_analgesic_poor=1)
|
|
|
|
|
|
|
+ AND ((i.warn_flow is not null and i.warn_flow != 0) or i.warn_low_battery = 1 or i.warn_will_finished=1 or i.warn_analgesic_poor=1)
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
- <if test="query.timeRange != null and query.timeRange.size == 1">
|
|
|
|
|
|
|
+ <if test="query.timeRange != null and query.timeRange.size > 0">
|
|
|
AND c.monitor_start_time >= #{query.timeRange[0]}
|
|
AND c.monitor_start_time >= #{query.timeRange[0]}
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 时间区间查询 -->
|
|
<!-- 时间区间查询 -->
|
|
@@ -694,7 +701,7 @@
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 待评价 -->
|
|
<!-- 待评价 -->
|
|
|
<if test="query.evaluate != null and query.evaluate == 2">
|
|
<if test="query.evaluate != null and query.evaluate == 2">
|
|
|
- and c.eval_time is not null and DATE_ADD(c.eval_time,INTERVAL #{query.interval} MINUTE) > NOW()
|
|
|
|
|
|
|
+ and c.eval_time is not null and DATE_ADD(c.eval_time,INTERVAL #{query.interval} MINUTE) < NOW()
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 未评价 -->
|
|
<!-- 未评价 -->
|
|
|
<if test="query.evaluate != null and query.evaluate == 3">
|
|
<if test="query.evaluate != null and query.evaluate == 3">
|