|
|
@@ -603,11 +603,7 @@
|
|
|
<!-- 设备表左连接(若 device_alias 来自设备表) -->
|
|
|
LEFT JOIN bus_device d ON i.device_id = d.id
|
|
|
<where>
|
|
|
- i.is_undo='0' and c.finished=0
|
|
|
- <!-- 租户过滤(必选) -->
|
|
|
- <if test="query.tenantId != null">
|
|
|
- AND p.tenant_id = #{query.tenantId}
|
|
|
- </if>
|
|
|
+ i.is_undo='0' and c.finished=0 and p.tenant_id = #{query.tenantId}
|
|
|
<!-- 患者基础条件 -->
|
|
|
<if test="query.patientCode != null">
|
|
|
AND p.code LIKE CONCAT('%', #{query.patientCode}, '%')
|
|
|
@@ -615,8 +611,9 @@
|
|
|
<if test="query.patientName != null">
|
|
|
AND c.patient_name LIKE CONCAT('%', #{query.patientName}, '%')
|
|
|
</if>
|
|
|
+ <!--todo-->
|
|
|
<if test="query.abnormal != null">
|
|
|
- AND p.patient_abnormal = #{query.abnormal} <!-- 假设患者异常字段为 patient_abnormal -->
|
|
|
+ AND c.patient_abnormal = #{query.abnormal} <!-- 假设患者异常字段为 patient_abnormal -->
|
|
|
</if>
|
|
|
<!-- 临床与病区条件 -->
|
|
|
<if test="query.wards != null and query.wards.size > 0">
|
|
|
@@ -626,7 +623,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="query.bedNo != null">
|
|
|
- AND c.bed_no = #{query.bedNo}
|
|
|
+ AND c.bed_no LIKE CONCAT('%', #{query.bedNo}, '%')
|
|
|
</if>
|
|
|
<if test="query.anaDoctor != null">
|
|
|
AND c.ana_doctor LIKE CONCAT('%', #{query.anaDoctor}, '%')
|
|
|
@@ -635,7 +632,7 @@
|
|
|
AND c.surgery_name LIKE CONCAT('%', #{query.surgeName}, '%')
|
|
|
</if>
|
|
|
<if test="query.anaType != null">
|
|
|
- AND c.ana_type = #{query.anaType}
|
|
|
+ AND c.ana_type LIKE CONCAT('%', #{query.anaType}, '%')
|
|
|
</if>
|
|
|
<!-- 设备与输注条件 -->
|
|
|
<if test="query.types != null and types.size > 0">
|
|
|
@@ -650,13 +647,24 @@
|
|
|
#{status}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="query.alarm != null">
|
|
|
- AND i.device_alarm = #{query.alarm} <!-- 是否有报警 -->
|
|
|
+ <!-- 无报警 -->
|
|
|
+ <if test="query.alarm != null and query.alarm=false">
|
|
|
+ AND i.device_alarm = 0
|
|
|
+ </if>
|
|
|
+ <!-- 有报警 -->
|
|
|
+ <if test="query.alarm != null and query.alarm=true">
|
|
|
+ AND i.device_alarm != 0
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <!--无提醒-->
|
|
|
+ <if test="query.warn != null and query.warn = false">
|
|
|
+ AND (i.warn_flow = 0 and i.warn_low_battery = 0 and i.warn_will_finished=0 and i.warn_analgesic_poor=0)
|
|
|
</if>
|
|
|
- <if test="query.warn != null">
|
|
|
- <!-- 简化提醒条件,可根据实际字段扩展 -->
|
|
|
- AND (i.warn_flow = 1 OR i.warn_low_battery = 1)
|
|
|
+ <!--有提醒-->
|
|
|
+ <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)
|
|
|
</if>
|
|
|
+
|
|
|
<if test="query.timeRange != null and query.timeRange.size == 1">
|
|
|
AND c.monitor_start_time >= #{query.timeRange[0]}
|
|
|
</if>
|
|
|
@@ -664,6 +672,21 @@
|
|
|
<if test="query.timeRange != null and query.timeRange.size > 1">
|
|
|
AND c.monitor_start_time <= #{query.timeRange[1]}
|
|
|
</if>
|
|
|
+
|
|
|
+ <!-- 已评价 -->
|
|
|
+ <if test="query.evaluate != null and query.evaluate = 1">
|
|
|
+ AND c.eval_time = #{query.manageType}
|
|
|
+ </if>
|
|
|
+ <!-- 待评价 -->
|
|
|
+ <if test="query.evaluate != null and query.evaluate = 2">
|
|
|
+ AND c.eval_time = #{query.manageType}
|
|
|
+ </if>
|
|
|
+ <!-- 未评价 -->
|
|
|
+ <if test="query.evaluate != null and query.evaluate = 3">
|
|
|
+ AND c.eval_time is null
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
<!-- 管理类型 -->
|
|
|
<if test="query.manageType != null">
|
|
|
AND c.manage_type = #{query.manageType}
|