|
@@ -34,7 +34,11 @@
|
|
|
<result column="monitor_alarm" property="monitorAlarm"/>
|
|
<result column="monitor_alarm" property="monitorAlarm"/>
|
|
|
<result column="infusion_count" property="infusionCount"/>
|
|
<result column="infusion_count" property="infusionCount"/>
|
|
|
<result column="eval_count" property="evalCount"/>
|
|
<result column="eval_count" property="evalCount"/>
|
|
|
-
|
|
|
|
|
|
|
+ <result column="liquid_executor" property="liquidExecutor"/>
|
|
|
|
|
+ <result column="liquid_checker" property="liquidChecker"/>
|
|
|
|
|
+ <result column="liquid_remark" property="liquidRemark"/>
|
|
|
|
|
+ <result column="liquid_time" property="liquidTime"/>
|
|
|
|
|
+ <result column="liquid_type" property="liquidType"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<select id="stats" resultMap="stats">
|
|
<select id="stats" resultMap="stats">
|
|
|
SELECT
|
|
SELECT
|
|
@@ -106,12 +110,15 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="pageQuery" resultMap="queryResult" parameterType="com.nb.web.service.bus.service.dto.ClinicQuery">
|
|
<select id="pageQuery" resultMap="queryResult" parameterType="com.nb.web.service.bus.service.dto.ClinicQuery">
|
|
|
- select p.id as patient_id,
|
|
|
|
|
|
|
+ select p.id as patient_id,
|
|
|
c.id as clinic_id,
|
|
c.id as clinic_id,
|
|
|
c.patient_code as patient_code,
|
|
c.patient_code as patient_code,
|
|
|
c.patient_name as patient_name,
|
|
c.patient_name as patient_name,
|
|
|
c.ward as ward,
|
|
c.ward as ward,
|
|
|
- c.bed_no as bed_no,
|
|
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN c.manual_bedno IS NOT NULL AND c.manual_bedno != '' THEN c.manual_bedno
|
|
|
|
|
+ ELSE c.bed_no
|
|
|
|
|
+ END as bed_no,
|
|
|
c.`surgery_name` as surgery_name,
|
|
c.`surgery_name` as surgery_name,
|
|
|
c.surgery_doctor as surgery_doctor,
|
|
c.surgery_doctor as surgery_doctor,
|
|
|
c.ana_doctor as ana_doctor,
|
|
c.ana_doctor as ana_doctor,
|
|
@@ -119,11 +126,20 @@
|
|
|
c.finished as finished,
|
|
c.finished as finished,
|
|
|
c.start_time as clinic_start_time,
|
|
c.start_time as clinic_start_time,
|
|
|
c.monitor_start_time as monitor_start_time,
|
|
c.monitor_start_time as monitor_start_time,
|
|
|
- c.end_time as monitor_end_time
|
|
|
|
|
|
|
+ c.end_time as monitor_end_time,
|
|
|
|
|
+ c.liquid_type as liquid_type,
|
|
|
|
|
+ c.liquid_executor as liquid_executor,
|
|
|
|
|
+ c.liquid_checker as liquid_checker,
|
|
|
|
|
+ c.liquid_remark as liquid_remark,
|
|
|
|
|
+ c.liquid_time as liquid_time
|
|
|
from bus_clinic as c
|
|
from bus_clinic as c
|
|
|
left join bus_patient
|
|
left join bus_patient
|
|
|
as p on c.patient_id = p.id
|
|
as p on c.patient_id = p.id
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ <if test="query.liquid!=null and query.liquid == true">
|
|
|
|
|
+ and c.finished= 1
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
<if test="query.monitorType!=null and query.monitorType!=''">
|
|
<if test="query.monitorType!=null and query.monitorType!=''">
|
|
|
and c.monitor_type=#{query.monitorType}
|
|
and c.monitor_type=#{query.monitorType}
|
|
|
</if>
|
|
</if>
|
|
@@ -143,7 +159,7 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.bedNo!=null and query.bedNo!=''">
|
|
<if test="query.bedNo!=null and query.bedNo!=''">
|
|
|
- and c.bed_no like concat('%',#{query.bedNo},'%')
|
|
|
|
|
|
|
+ and bed_no like concat('%',#{query.bedNo},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.timeRange != null and query.timeRange.size >0">
|
|
<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[1]}
|
|
and c.monitor_start_time > #{query.timeRange[0]} and c.monitor_start_time < #{query.timeRange[1]}
|
|
@@ -244,4 +260,121 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap id="stdLiquidResult" type="com.nb.web.service.bus.controller.vo.BusLiquidListVO">
|
|
|
|
|
+ <result property="clinicId" column="clinic_id"/>
|
|
|
|
|
+ <result property="clinicName" column="clinic_name"/>
|
|
|
|
|
+ <result property="patientId" column="patient_id"/>
|
|
|
|
|
+ <result property="patientCode" column="patient_code"/>
|
|
|
|
|
+ <result property="patientName" column="patient_name"/>
|
|
|
|
|
+ <result property="ward" column="ward"/>
|
|
|
|
|
+ <result property="bedNo" column="bed_no"/>
|
|
|
|
|
+ <result property="deviceId" column="device_id"/>
|
|
|
|
|
+ <result property="clinicStartTime" column="clinic_start_time"/>
|
|
|
|
|
+ <result property="undoTime" column="undo_time"/>
|
|
|
|
|
+ <result property="formula" column="formula" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
|
|
|
|
+ <result property="totalDose" column="total_dose"/>
|
|
|
|
|
+ <result property="remainDose" column="remain_dose"/>
|
|
|
|
|
+ <result property="liquidExecutor" column="liquid_executor"/>
|
|
|
|
|
+ <result property="liquidChecker" column="liquid_checker"/>
|
|
|
|
|
+ <result property="liquidRemark" column="liquid_remark"/>
|
|
|
|
|
+ <result property="liquidTime" column="liquid_time"/>
|
|
|
|
|
+ <result property="liquidMethod" column="liquid_method"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectLiquidPage" resultMap="stdLiquidResult">
|
|
|
|
|
+ select
|
|
|
|
|
+ c.id as clinic_id,
|
|
|
|
|
+ c.patient_id as patient_id,
|
|
|
|
|
+ c.patient_code as patient_code,
|
|
|
|
|
+ c.patient_name as patient_name,
|
|
|
|
|
+ c.ward as ward,
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN c.manual_bedno IS NOT NULL AND c.manual_bedno != '' THEN c.manual_bedno
|
|
|
|
|
+ ELSE c.bed_no
|
|
|
|
|
+ END as bed_no,
|
|
|
|
|
+ c.surgery_name as clinic_name,
|
|
|
|
|
+ i.device_id as device_id,
|
|
|
|
|
+ c.monitor_start_time as clinic_start_time,
|
|
|
|
|
+ i.undo_time as undo_time,
|
|
|
|
|
+ c.formula as formula,
|
|
|
|
|
+ i.total_dose as total_dose,
|
|
|
|
|
+ i.remain_dose as remain_dose,
|
|
|
|
|
+ c.liquid_executor as liquid_executor,
|
|
|
|
|
+ c.liquid_checker as liquid_checker,
|
|
|
|
|
+ c.liquid_remark as liquid_remark,
|
|
|
|
|
+ c.liquid_time as liquid_time,
|
|
|
|
|
+ c.liquid_method as liquid_method
|
|
|
|
|
+ from bus_clinic as c
|
|
|
|
|
+ join bus_patient as p on c.patient_id = p.id
|
|
|
|
|
+ join bus_infusion_history as i on p.infusion_id = i.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ c.finished = 1
|
|
|
|
|
+ <if test="query.undoTime != null and query.undoTime.size ==1">
|
|
|
|
|
+ and undo_time > #{query.undoTime[0]}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.undoTime != null and query.undoTime.size > 1">
|
|
|
|
|
+ and undo_time > #{query.undoTime[0]} and c.undo_time < #{query.undoTime[1]}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.patientCode!=null and query.patientCode!=''">
|
|
|
|
|
+ and c.patient_code like concat('%',#{query.patientCode},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.bedNo!=null and query.bedNo!=''">
|
|
|
|
|
+ and bed_no like concat('%',#{query.bedNo},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.wards != null and query.wards.size > 0">
|
|
|
|
|
+ and c.ward in
|
|
|
|
|
+ <foreach item="w" index="index" collection="query.wards" open="(" separator="," close=")">
|
|
|
|
|
+ #{w, jdbcType=VARCHAR}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.patientName!=null and query.patientName!=''">
|
|
|
|
|
+ and patient_name like concat('%',#{query.patientName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.surgeryName!=null and query.surgeryName!=''">
|
|
|
|
|
+ and c.surgery_name like concat('%',#{query.surgeryName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.liquidType!=null and query.liquidType == false">
|
|
|
|
|
+ and liquid_checker is null
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.liquidType!=null and query.liquidType == true">
|
|
|
|
|
+ and liquid_checker is not null
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by undo_time desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectLiquidByIds" resultMap="stdLiquidResult">
|
|
|
|
|
+ select
|
|
|
|
|
+ c.id as clinic_id,
|
|
|
|
|
+ c.patient_id as patient_id,
|
|
|
|
|
+ c.patient_code as patient_code,
|
|
|
|
|
+ c.patient_name as patient_name,
|
|
|
|
|
+ c.ward as ward,
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN c.manual_bedno IS NOT NULL AND c.manual_bedno != '' THEN c.manual_bedno
|
|
|
|
|
+ ELSE c.bed_no
|
|
|
|
|
+ END as bed_no,
|
|
|
|
|
+ c.surgery_name as clinic_name,
|
|
|
|
|
+ i.device_id as device_id,
|
|
|
|
|
+ c.monitor_start_time as clinic_start_time,
|
|
|
|
|
+ i.undo_time as undo_time,
|
|
|
|
|
+ c.formula as formula,
|
|
|
|
|
+ i.total_dose as total_dose,
|
|
|
|
|
+ i.remain_dose as remain_dose,
|
|
|
|
|
+ c.liquid_executor as liquid_executor,
|
|
|
|
|
+ c.liquid_checker as liquid_checker,
|
|
|
|
|
+ c.liquid_remark as liquid_remark,
|
|
|
|
|
+ c.liquid_time as liquid_time
|
|
|
|
|
+ from bus_clinic as c
|
|
|
|
|
+ left join bus_patient as p on c.patient_id = p.id
|
|
|
|
|
+ left join bus_infusion_history as i on p.infusion_id = i.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and c.id in
|
|
|
|
|
+ <foreach item="w" index="index" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{w, jdbcType=VARCHAR}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|