|
|
@@ -16,6 +16,68 @@
|
|
|
<result property="electricQuantity" column="electric_quantity"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="deviceDetail" type="cn.tr.module.smart.web.vo.BizDeviceAndClinicDetailVO">
|
|
|
+ <result property="alias" column="alias"/>
|
|
|
+ <result property="clinicRoomId" column="clinic_room_id"/>
|
|
|
+ <result property="patientId" column="patient_id"/>
|
|
|
+ <result property="patientName" column="patient_name"/>
|
|
|
+ <result property="patientName" column="patient_gender"/>
|
|
|
+ <result property="patientAge" column="patient_age"/>
|
|
|
+ <result property="imageUrl" column="image_url"/>
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="deviceId" column="device_id"/>
|
|
|
+ <result property="classification" column="classification"/>
|
|
|
+ <result property="dataNum" column="data_num"/>
|
|
|
+ <result property="patientCode" column="patient_code"/>
|
|
|
+ <result property="totalDose" column="total_dose"/>
|
|
|
+ <result property="firstDose" column="first_dose"/>
|
|
|
+ <result property="remainDose" column="remain_dose"/>
|
|
|
+ <result property="inputDose" column="input_dose"/>
|
|
|
+ <result property="appendDose" column="append_dose"/>
|
|
|
+ <result property="appendLockTime" column="append_lock_time"/>
|
|
|
+ <result property="maxDose" column="max_dose"/>
|
|
|
+ <result property="selfControlCount" column="self_control_count"/>
|
|
|
+ <result property="selfControlLockTime" column="self_control_lock_time"/>
|
|
|
+ <result property="pcaValidCount" column="pca_valid_count"/>
|
|
|
+ <result property="pcaInvalidCount" column="pca_invalid_count"/>
|
|
|
+ <result property="pcaTotalCount" column="pca_total_count"/>
|
|
|
+ <result property="continueDose" column="continue_dose"/>
|
|
|
+ <result property="pulseDose" column="pulse_dose"/>
|
|
|
+ <result property="pulseLockTime" column="pulse_lock_time"/>
|
|
|
+ <result property="pulseFirstLockTime" column="pulse_first_lock_time"/>
|
|
|
+ <result property="flowUpCycle" column="flow_up_cycle"/>
|
|
|
+ <result property="flowDownCycle" column="flow_down_cycle"/>
|
|
|
+ <result property="flowCount" column="flow_count"/>
|
|
|
+ <result property="flowUpLimit" column="flow_up_limit"/>
|
|
|
+ <result property="flowDownLimit" column="flow_down_limit"/>
|
|
|
+ <result property="flowAdjustRate" column="flow_adjust_rate"/>
|
|
|
+ <result property="flowRestricted" column="flow_restricted"/>
|
|
|
+ <result property="warnFlow" column="warn_flow"/>
|
|
|
+ <result property="electricQuantity" column="electric_quantity"/>
|
|
|
+ <result property="deviceRunState" column="device_run_state"/>
|
|
|
+ <result property="deviceAlarm" column="device_alarm"/>
|
|
|
+ <result property="infusionStartTime" column="infusion_start_time"/>
|
|
|
+ <result property="lastUploadTime" column="last_upload_time"/>
|
|
|
+ <result property="deviceType" column="device_type"/>
|
|
|
+ <result property="tenantId" column="tenant_id"/>
|
|
|
+ <result property="hospitalCode" column="hospital_code"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="warnWillFinished" column="warn_will_finished"/>
|
|
|
+ <result property="warnAnalgesicPoor" column="warn_analgesic_poor"/>
|
|
|
+ <result property="warnLowBattery" column="warn_low_battery"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="InfusionColumn">
|
|
|
+ bih.id,bih.device_id,bih.classification,bih.data_num,bih.patient_code,bih.total_dose,bih.first_dose,bih.remain_dose,
|
|
|
+ bih.input_dose,bih.append_dose,bih.append_lock_time,bih.max_dose,bih.self_control_count,bih.self_control_lock_time,
|
|
|
+ bih.pca_valid_count,bih.pca_invalid_count,bih.pca_total_count,bih.continue_dose,bih.pulse_dose,bih.pulse_lock_time,
|
|
|
+ bih.pulse_first_lock_time,bih.flow_up_cycle,bih.flow_down_cycle,bih.flow_count,bih.flow_up_limit,bih.flow_down_limit,
|
|
|
+ bih.flow_adjust_rate,bih.flow_restricted,bih.warn_flow,bih.electric_quantity,bih.device_run_state,bih.device_alarm,
|
|
|
+ bih.infusion_start_time,bih.last_upload_time,bih.device_type,bih.tenant_id,bih.hospital_code,bih.create_time,
|
|
|
+ bih.update_time,bih.update_by,bih.create_by,bih.warn_will_finished,bih.warn_analgesic_poor,bih.warn_low_battery
|
|
|
+ </sql>
|
|
|
<select id="selectDeviceList" resultMap="deviceDto">
|
|
|
SELECT
|
|
|
bd.device_id,
|
|
|
@@ -43,4 +105,32 @@
|
|
|
</where>
|
|
|
order by bih.last_upload_time desc
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectDeviceDetailAndClinicList" resultMap="deviceDetail">
|
|
|
+ SELECT
|
|
|
+ bd.alias,
|
|
|
+ bcr.id as clinic_room_id,
|
|
|
+ bcr.patient_id,
|
|
|
+ bcr.patient_name,
|
|
|
+ bcr.patient_gender,
|
|
|
+ bcr.patient_age,
|
|
|
+ bcr.image_url,
|
|
|
+ <include refid="InfusionColumn"/>
|
|
|
+ FROM
|
|
|
+ biz_device bd
|
|
|
+ JOIN biz_infusion_history bih ON bd.infusion_id = bih.ID
|
|
|
+ LEFT JOIN biz_infusion_clinic bic ON bih.ID = bic.infusion_id
|
|
|
+ LEFT JOIN biz_clinic_room bcr ON bic.clinic_id = bcr.ID
|
|
|
+ <where>
|
|
|
+ <if test="query.deviceId != null and query.deviceId != ''">
|
|
|
+ and bd.device_id = #{query.deviceId}
|
|
|
+ </if>
|
|
|
+ <if test="query.clinicId != null and query.clinicId != ''">
|
|
|
+ and bcr.id = #{query.clinicId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by bih.last_upload_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|