|
|
@@ -110,14 +110,14 @@
|
|
|
</select>
|
|
|
|
|
|
<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.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
|
|
|
+ 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_doctor as surgery_doctor,
|
|
|
@@ -260,4 +260,85 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</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="deviceAlias" column="device_alias"/>
|
|
|
+ <result property="clinicStartTime" column="clinic_start_time"/>
|
|
|
+ <result property="undoTime" column="undo_time"/>
|
|
|
+ <result property="formula" column="formula"/>
|
|
|
+ <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"/>
|
|
|
+ </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
|
|
|
+ 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>
|
|
|
+ <if test="query.undoTime != null and query.undoTime.size ==1">
|
|
|
+ and undo_time > #{query.timeRange[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 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.ward != null and query.ward.size > 0">
|
|
|
+ and c.ward in
|
|
|
+ <foreach item="w" index="index" collection="query.ward" 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.clinicName!=null and query.clinicName!=''">
|
|
|
+ and clinic_name like concat('%',#{query.clinicName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.liquidType!=null and query.liquidType == true">
|
|
|
+ and liquid_checker is null
|
|
|
+ </if>
|
|
|
+ <if test="query.liquidType!=null and query.liquidType == false">
|
|
|
+ and liquid_checker is not null
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by undo_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|