| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.coffee.bus.mapper.BusInfusionHistoryMapper">
- <resultMap id="combineResult" type="com.coffee.bus.service.dto.CombineResult">
- <result column="infusion_id" property="id"/>
- <result column="device_id" property="deviceId"/>
- <result column="classification" property="classification"/>
- <result column="data_num" property="dataNumber"/>
- <result column="clinic_id" property="clinicId"/>
- <result column="device_type" property="type"/>
- <result column="patient_code" property="patientCode"/>
- <result column="ward" property="ward"/>
- <result column="bed_no" property="bedNo"/>
- <result column="total_dose" property="totalDose"/>
- <result column="first_dose" property="firstDose"/>
- <result column="remain_dose" property="remainDose"/>
- <result column="input_dose" property="inputDose"/>
- <result column="append_dose" property="appendDose"/>
- <result column="append_lock_time" property="appendLockTime"/>
- <result column="max_dose" property="maxDose"/>
- <result column="self_control_count" property="selfControlCount"/>
- <result column="self_control_lock_time" property="selfControlLockTime"/>
- <result column="pca_valid_count" property="pcaValidCount"/>
- <result column="pca_invalid_count" property="pcaInvalidCount"/>
- <result column="pca_total_count" property="pcaTotalCount"/>
- <result column="continue_dose" property="continueDose"/>
- <result column="pulse_dose" property="pulseDose"/>
- <result column="pulse_first_lock_time" property="pulseFirstLockTime"/>
- <result column="pulse_lock_time" property="pulseLockTime"/>
- <result column="flow_up_cycle" property="flowUpCycle"/>
- <result column="flow_down_cycle" property="flowDownCycle"/>
- <result column="flow_count" property="flowCount"/>
- <result column="flow_up_limit" property="flowUpLimit"/>
- <result column="flow_down_limit" property="flowDownLimit"/>
- <result column="flow_adjust_rate" property="flowAdjustRate"/>
- <result column="electric_quantity" property="electricQuantity"/>
- <result column="run_state" property="runState"/>
- <result column="device_alarm" property="alarm"/>
- <result column="warn_flow" property="warnFlow"/>
- <result column="warn_analgesic_poor" property="warnAnalgesicPoor"/>
- <result column="warn_low_battery" property="warnLowBattery"/>
- <result column="warn_will_finished" property="warnWillFinished"/>
- <result column="infusion_start_time" property="infusionStartTime"/>
- <result column="patient_name" property="patientName"/>
- <result column="infusion_start_time" property="infusionStartTime"/>
- <result column="infusion_finished" property="infusionFinished"/>
- <result column="is_undo" property="isUndo"/>
- <result column="last_upload_time" property="lastUploadTime"/>
- <result column="undo_by" property="undoBy"/>
- <result column="destroyer" property="destroyer"/>
- <result column="witnesses" property="witnesses"/>
- <result column="undo_time" property="undoTime"/>
- <result column="surgery_name" property="surgeryName"/>
- <result column="asa" property="asa"/>
- <result column="patient_gender" property="patientGender"/>
- <result column="patient_name" property="patientName"/>
- <result column="patient_age" property="patientAge"/>
- <result column="weight" property="weight"/>
- <result column="height" property="height"/>
- <result column="ana_doctor" property="anaDoctor"/>
- <result column="ana_type" property="anaType"/>
- <result column="anal_type" property="analType"/>
- <result column="surgery_doctor" property="surgeryDoctor"/>
- <result column="surgery_name" property="surgeryName"/>
- <result column="formula" property="formula" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
- <result column="entrust" property="entrust"/>
- </resultMap>
- <resultMap id="combineAlarmResult" type="com.coffee.bus.service.dto.CombineAlarmResult">
- <result column="device_type" property="type"/>
- <result column="infusion_id" property="id"/>
- <result column="infusion_start_time" property="infusionStartTime"/>
- <result column="cause" property="cause"/>
- <result column="alarm" property="isAlarm"/>
- <result column="run_state" property="runState"/>
- <result column="alarm_state" property="alarm"/>
- <result column="warn_will_finished" property="warnWillFinished"/>
- <result column="warn_analgesic_poor" property="warnAnalgesicPoor"/>
- <result column="warn_low_battery" property="warnLowBattery"/>
- <result column="warn_flow" property="warnFlow"/>
- </resultMap>
- <resultMap id="combineEvalResult" type="com.coffee.bus.service.dto.CombineEvalResult">
- <result column="infusion_id" property="id"/>
- <result column="eval_id" property="evalId"/>
- <result column="infusion_start_time" property="infusionStartTime"/>
- <result column="statics" property="statics"/>
- <result column="activity" property="activity"/>
- <result column="calm" property="calm"/>
- <result column="left_arm" property="leftArm"/>
- <result column="left_leg" property="leftLeg"/>
- <result column="right_arm" property="rightArm"/>
- <result column="right_leg" property="rightLeg"/>
- <result column="nausea_vomit" property="nauseaVomit"/>
- <result column="itch" property="itch"/>
- <result column="vertigo" property="vertigo"/>
- <result column="sore_throat" property="soreThroat"/>
- <result column="uroschesis" property="uroschesis"/>
- <result column="breath_depression" property="breathDepression"/>
- <result column="hoarseness" property="hoarseness"/>
- <result column="cognition_obstacle" property="cognitionObstacle"/>
- <result column="satisfaction" property="satisfaction"/>
- <result column="shrink_pressure" property="shrinkPressure"/>
- <result column="diastens_pressure" property="diastensPressure"/>
- <result column="heart_rate" property="heartRate"/>
- <result column="fetal_heart_rate" property="fetalHeartRate"/>
- <result column="breath_rate" property="breathRate"/>
- <result column="blood_oxygen_saturation" property="bloodOxygenSaturation"/>
- </resultMap>
- <select id="currentInClinic" resultType="com.coffee.bus.entity.BusInfusionHistoryEntity">
- select d.alias,i.* from
- (select * from bus_infusion_history where clinic_id=#{clinicId} ORDER BY start_time desc limit 1) as i
- left join bus_device as d on d.device_id=i.device_id
- </select>
- <select id="queryPage" resultMap="combineResult">
- select
- i.id as infusion_id,
- i.device_id as device_id,
- i.classification as classification,
- i.data_number as data_number,
- i.clinic_id as clinic_id,
- i.type as device_type,
- i.patient_code as patient_code,
- c.ward as ward,
- c.bed_no as bed_no,
- i.total_dose as total_dose,
- i.first_dose as first_dose,
- i.remain_dose as remain_dose,
- i.input_dose as input_dose,
- i.append_dose as append_dose,
- i.append_lock_time as append_lock_time,
- i.max_dose as max_dose,
- i.self_control_count as self_control_count,
- i.self_control_lock_time as self_control_lock_time,
- i.pca_valid_count as pca_valid_count,
- i.pca_invalid_count as pca_invalid_count,
- i.pca_total_count as pca_total_count,
- i.continue_dose as continue_dose,
- i.pulse_dose as pulse_dose,
- i.pulse_lock_time as pulse_lock_time,
- i.pulse_first_lock_time as pulse_first_lock_time,
- i.flow_up_cycle as flow_up_cycle,
- i.flow_down_cycle as flow_down_cycle,
- i.flow_count as flow_count,
- i.flow_up_limit as flow_up_limit,
- i.flow_down_limit as flow_down_limit,
- i.flow_adjust_rate as flow_adjust_rate,
- i.electric_quantity as electric_quantity,
- i.run_state as run_state,
- i.alarm as alarm,
- i.warn_will_finished as warn_will_finished,
- i.warn_analgesic_poor as warn_analgesic_poor,
- i.warn_low_battery as warn_low_battery,
- i.start_time as infusion_start_time,
- i.warn_flow as warn_flow,
- i.finished as infusion_finished,
- i.is_undo as is_undo,
- i.last_upload_time as last_upload_time,
- i.undo_by as undo_by,
- i.destroyer as destroyer,
- i.witnesses as witnesses,
- i.undo_time as undo_time,
- c.surgery_name as surgery_name,
- c.asa as asa,
- c.patient_gender as patient_gender,
- c.`patient_name` as patient_name,
- c.`patient_age` as patient_age,
- c.weight as weight,
- c.`height` as height,
- c.ana_doctor as ana_doctor,
- c.ana_type as ana_type,
- c.anal_type as anal_type,
- c.surgery_doctor as surgery_doctor,
- c.formula as formula,
- c.entrust as entrust
- from (select * from bus_infusion_history
- <where>
- <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
- and start_time > #{query.startTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and start_time < #{query.startTimeRange[1]}
- </if>
- </if>
- <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
- and undo_time > #{query.undoTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and undo_time < #{query.undoTimeRange[1]}
- </if>
- </if>
- <if test="query.deviceType != null">
- and device_type = #{query.deviceType}
- </if>
- <if test="query.deviceId != null">
- and device_id like concat('%',#{query.deviceId},'%')
- </if>
- <if test="query.finished != null">
- and device_id =#{query.finished}
- </if>
- <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
- and pca_valid_count > #{query.validPcaCountRange[0]}
- <if test="query.validPcaCountRange.size >1 ">
- and pca_valid_count < #{query.validPcaCountRange[1]}
- </if>
- </if>
- <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
- and pca_invalid_count > #{query.inValidPcaCountRange[0]}
- <if test="query.inValidPcaCountRange.size >1 ">
- and pca_invalid_count < #{query.inValidPcaCountRange[1]}
- </if>
- </if>
- <choose>
- <when test="query.warnWillFinished != false or query.warnAnalgesicPoor != false or query.warnLowBattery != false">
- and (
- <choose>
- <when test="query.warnWillFinished != false">warn_will_finished=1</when>
- <otherwise>warn_will_finished!=1</otherwise>
- </choose>
- <if test="query.warnAnalgesicPoor != false">or warn_analgesic_poor=1 </if>
- <if test="query.warnLowBattery != false"> or warn_low_battery=1 </if>
- <if test="query.warnFlow !=null">
- or warn_flow= #{query.warnFlow}
- </if>
- )
- </when>
- <otherwise>
- <if test="query.warnFlow !=null">
- and warn_flow= #{query.warnFlow}
- </if>
- </otherwise>
- </choose>
- </where>
- ) as i
- JOIN (select * from bus_clinic
- <where>
- <if test="query.patientCode != null">
- and patient_code like concat('%',#{query.patientCode},'%')
- </if>
- <if test="query.patientName != null">
- and patient_name like concat('%',#{query.patientName},'%')
- </if>
- <if test="query.patientGender != null">
- and patient_gender =#{query.patientGender}
- </if>
- <if test="query.ageRange != null and query.ageRange.size > 0">
- and patient_age > #{query.ageRange[0]}
- <if test="query.ageRange.size >1 ">
- and patient_age < #{query.ageRange[1]}
- </if>
- </if>
- <if test="query.weightRange != null and query.weightRange.size > 0">
- and weight > #{query.weightRange[0]}
- <if test="query.weightRange.size >1 ">
- and weight < #{query.weightRange[1]}
- </if>
- </if>
- <if test="query.asa != null">
- and asa like concat('%',#{query.asa},'%')
- </if>
- <if test="query.ward != null">
- and ward like concat('%',#{query.ward},'%')
- </if>
- <if test="query.bedNo != null">
- and bed_no like concat('%',#{query.bedNo},'%')
- </if>
- <if test="query.anaDoctor != null">
- and ana_doctor like concat('%',#{query.anaDoctor},'%')
- </if>
- <if test="query.anaType != null">
- and ana_type like concat('%',#{query.anaType},'%')
- </if>
- <if test="query.analType != null">
- and anal_type like concat('%',#{query.analType},'%')
- </if>
- <if test="query.drugName != null">
- and formula like concat('%',#{query.drugName},'%')
- </if>
- <if test="query.surgeryDoctor != null">
- and surgery_doctor like concat('%',#{query.surgeryDoctor},'%')
- </if>
- <if test="query.surgeryName != null">
- and surgery_name like concat('%',#{query.surgeryName},'%')
- </if>
- </where>
- ) as c
- on i.clinic_id=c.id
- <if test="(query.orderByDesc!=null and query.orderByDesc.size > 0) or (query.orderByAsc!=null and query.orderByAsc.size > 0)">
- order by
- </if>
- <if test="query.orderByDesc!=null and query.orderByDesc.size > 0">
- <foreach item="descItem" index="index" collection="query.orderByDesc" open="" separator="," close="">
- -- !!!!这里使用$不要使用#,否自只是对列名(字符串)进行排序,而不是进行列排序
- ${descItem} desc
- </foreach>
- </if>
- <if test="query.orderByAsc!=null and query.orderByAsc.size > 0">
- <if test="query.orderByDesc!=null and query.orderByDesc.size > 0">
- ,
- </if>
- <foreach item="ascItem" index="index" collection="query.orderByAsc" open="" separator="," close="">
- ${ascItem} asc
- </foreach>
- </if>
- </select>
- <select id="queryStatsAlarm" resultMap="combineAlarmResult">
- select
- i.type as device_type,
- i.id as infusion_id,
- i.start_time as infusion_start_time,
- a.cause as cause,
- i.patient_code as patient_code,
- a.alarm as alarm,
- a.run_state as run_state,
- a.alarm_state as alarm_state,
- a.warn_will_finished as warn_will_finished,
- a.warn_low_battery as warn_low_battery,
- a.warn_analgesic_poor as warn_analgesic_poor,
- a.warn_flow as warn_flow
- from (select * from bus_infusion_history
- <where>
- <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
- and start_time > #{query.startTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and start_time < #{query.startTimeRange[1]}
- </if>
- </if>
- <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
- and undo_time > #{query.undoTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and undo_time < #{query.undoTimeRange[1]}
- </if>
- </if>
- <if test="query.deviceType != null">
- and device_type = #{query.deviceType}
- </if>
- <if test="query.deviceId != null">
- and device_id like concat('%',#{query.deviceId},'%')
- </if>
- <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
- and pca_valid_count > #{query.validPcaCountRange[0]}
- <if test="query.validPcaCountRange.size >1 ">
- and pca_valid_count < #{query.validPcaCountRange[1]}
- </if>
- </if>
- <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
- and pca_invalid_count > #{query.inValidPcaCountRange[0]}
- <if test="query.inValidPcaCountRange.size >1 ">
- and pca_invalid_count < #{query.inValidPcaCountRange[1]}
- </if>
- </if>
- <choose>
- <when test="query.warnWillFinished != false or query.warnAnalgesicPoor != false or query.warnLowBattery != false">
- and (
- <choose>
- <when test="query.warnWillFinished != false">warn_will_finished=1</when>
- <otherwise>warn_will_finished!=1</otherwise>
- </choose>
- <if test="query.warnAnalgesicPoor != false">or warn_analgesic_poor=1 </if>
- <if test="query.warnLowBattery != false"> or warn_low_battery=1 </if>
- <if test="query.warnFlow !=null">
- or warn_flow= #{query.warnFlow}
- </if>
- )
- </when>
- <otherwise>
- <if test="query.warnFlow !=null">
- and warn_flow= #{query.warnFlow}
- </if>
- </otherwise>
- </choose>
- </where>
- ) as i
- JOIN (select * from bus_clinic
- <where>
- <if test="query.patientCode != null">
- and patient_code like concat('%',#{query.patientCode},'%')
- </if>
- <if test="query.patientName != null">
- and patient_name like concat('%',#{query.patientName},'%')
- </if>
- <if test="query.patientGender != null">
- and patient_gender =#{query.patientGender}
- </if>
- <if test="query.ageRange != null and query.ageRange.size > 0">
- and patient_age > #{query.ageRange[0]}
- <if test="query.ageRange.size >1 ">
- and patient_age < #{query.ageRange[1]}
- </if>
- </if>
- <if test="query.weightRange != null and query.weightRange.size > 0">
- and weight > #{query.weightRange[0]}
- <if test="query.weightRange.size >1 ">
- and weight < #{query.weightRange[1]}
- </if>
- </if>
- <if test="query.asa != null">
- and asa like concat('%',#{query.asa},'%')
- </if>
- <if test="query.ward != null">
- and ward like concat('%',#{query.ward},'%')
- </if>
- <if test="query.bedNo != null">
- and bed_no like concat('%',#{query.bedNo},'%')
- </if>
- <if test="query.anaDoctor != null">
- and ana_doctor like concat('%',#{query.anaDoctor},'%')
- </if>
- <if test="query.anaType != null">
- and ana_type like concat('%',#{query.anaType},'%')
- </if>
- <if test="query.analType != null">
- and anal_type like concat('%',#{query.analType},'%')
- </if>
- <if test="query.drugName != null">
- and formula like concat('%',#{query.drugName},'%')
- </if>
- <if test="query.surgeryDoctor != null">
- and surgery_doctor like concat('%',#{query.surgeryDoctor},'%')
- </if>
- <if test="query.surgeryName != null">
- and surgery_name like concat('%',#{query.surgeryName},'%')
- </if>
- </where>
- ) as c
- on i.clinic_id=c.id
- JOIN bus_device_alarm a on a.infusion_id = i.id
- </select>
- <select id="queryStatsAnal" resultMap="combineResult">
- select
- i.id as infusion_id,
- i.device_id as device_id,
- i.pca_valid_count as pca_valid_count,
- i.pca_invalid_count as pca_invalid_count,
- i.pca_total_count as pca_total_count,
- i.start_time as infusion_start_time,
- i.continue_dose as continue_dose,
- i.input_dose as input_dose,
- i.append_dose as append_dose,
- i.self_control_lock_time as self_control_lock_time,
- i.patient_code as patient_code,
- c.id as clinic_id,
- c.asa as asa,
- c.patient_gender as patient_gender,
- c.`patient_age` as patient_age,
- c.anal_type as anal_type,
- c.weight as weight,
- c.`height` as height
- from (select * from bus_infusion_history
- <where>
- <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
- and start_time > #{query.startTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and start_time < #{query.startTimeRange[1]}
- </if>
- </if>
- <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
- and undo_time > #{query.undoTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and undo_time < #{query.undoTimeRange[1]}
- </if>
- </if>
- <if test="query.deviceType != null">
- and device_type = #{query.deviceType}
- </if>
- <if test="query.deviceId != null">
- and device_id like concat('%',#{query.deviceId},'%')
- </if>
- <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
- and pca_valid_count > #{query.validPcaCountRange[0]}
- <if test="query.validPcaCountRange.size >1 ">
- and pca_valid_count < #{query.validPcaCountRange[1]}
- </if>
- </if>
- <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
- and pca_invalid_count > #{query.inValidPcaCountRange[0]}
- <if test="query.inValidPcaCountRange.size >1 ">
- and pca_invalid_count < #{query.inValidPcaCountRange[1]}
- </if>
- </if>
- <choose>
- <when test="query.warnWillFinished != false or query.warnAnalgesicPoor != false or query.warnLowBattery != false">
- and (
- <choose>
- <when test="query.warnWillFinished != false">warn_will_finished=1</when>
- <otherwise>warn_will_finished!=1</otherwise>
- </choose>
- <if test="query.warnAnalgesicPoor != false">or warn_analgesic_poor=1 </if>
- <if test="query.warnLowBattery != false"> or warn_low_battery=1 </if>
- <if test="query.warnFlow !=null">
- or warn_flow= #{query.warnFlow}
- </if>
- )
- </when>
- <otherwise>
- <if test="query.warnFlow !=null">
- and warn_flow= #{query.warnFlow}
- </if>
- </otherwise>
- </choose>
- </where>
- ) as i
- JOIN (select * from bus_clinic
- <where>
- <if test="query.patientCode != null">
- and patient_code like concat('%',#{query.patientCode},'%')
- </if>
- <if test="query.patientName != null">
- and patient_name like concat('%',#{query.patientName},'%')
- </if>
- <if test="query.patientGender != null">
- and patient_gender =#{query.patientGender}
- </if>
- <if test="query.ageRange != null and query.ageRange.size > 0">
- and patient_age > #{query.ageRange[0]}
- <if test="query.ageRange.size >1 ">
- and patient_age < #{query.ageRange[1]}
- </if>
- </if>
- <if test="query.weightRange != null and query.weightRange.size > 0">
- and weight > #{query.weightRange[0]}
- <if test="query.weightRange.size >1 ">
- and weight < #{query.weightRange[1]}
- </if>
- </if>
- <if test="query.asa != null">
- and asa like concat('%',#{query.asa},'%')
- </if>
- <if test="query.ward != null">
- and ward like concat('%',#{query.ward},'%')
- </if>
- <if test="query.bedNo != null">
- and bed_no like concat('%',#{query.bedNo},'%')
- </if>
- <if test="query.anaDoctor != null">
- and ana_doctor like concat('%',#{query.anaDoctor},'%')
- </if>
- <if test="query.anaType != null">
- and ana_type like concat('%',#{query.anaType},'%')
- </if>
- <if test="query.analType != null">
- and anal_type like concat('%',#{query.analType},'%')
- </if>
- <if test="query.drugName != null">
- and formula like concat('%',#{query.drugName},'%')
- </if>
- <if test="query.surgeryDoctor != null">
- and surgery_doctor like concat('%',#{query.surgeryDoctor},'%')
- </if>
- <if test="query.surgeryName != null">
- and surgery_name like concat('%',#{query.surgeryName},'%')
- </if>
- </where>
- ) as c
- on i.clinic_id=c.id
- </select>
- <select id="queryStatsEval" resultMap="combineEvalResult">
- select
- i.id as infusion_id,
- i.start_time as infusion_start_time,
- e.statics as statics,
- e.activity as activity,
- e.calm as calm,
- e.left_arm as left_arm,
- e.left_leg as left_leg,
- e.right_arm as right_arm,
- e.right_leg as right_leg,
- e.nausea_vomit as nausea_vomit,
- e.itch as itch,
- e.vertigo as vertigo,
- e.sore_throat as sore_throat,
- e.uroschesis as uroschesis,
- e.breath_depression as breath_depression,
- e.hoarseness as hoarseness,
- e.cognition_obstacle as cognition_obstacle,
- e.satisfaction as satisfaction,
- e.shrink_pressure as shrink_pressure,
- e.diastens_pressure as diastens_pressure,
- e.heart_rate as heart_rate,
- e.fetal_heart_rate as fetal_heart_rate,
- e.breath_rate as breath_rate,
- e.blood_oxygen_saturation as blood_oxygen_saturation,
- e.id as eval_id
- from (select * from bus_infusion_history
- <where>
- <if test="query.startTimeRange != null and query.startTimeRange.size > 0">
- and start_time > #{query.startTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and start_time < #{query.startTimeRange[1]}
- </if>
- </if>
- <if test="query.undoTimeRange != null and query.undoTimeRange.size > 0">
- and undo_time > #{query.undoTimeRange[0]}
- <if test="query.startTimeRange.size >1 ">
- and undo_time < #{query.undoTimeRange[1]}
- </if>
- </if>
- <if test="query.deviceType != null">
- and device_type = #{query.deviceType}
- </if>
- <if test="query.deviceId != null">
- and device_id like concat('%',#{query.deviceId},'%')
- </if>
- <if test="query.validPcaCountRange != null and query.validPcaCountRange.size > 0">
- and pca_valid_count > #{query.validPcaCountRange[0]}
- <if test="query.validPcaCountRange.size >1 ">
- and pca_valid_count < #{query.validPcaCountRange[1]}
- </if>
- </if>
- <if test="query.inValidPcaCountRange != null and query.inValidPcaCountRange.size > 0">
- and pca_invalid_count > #{query.inValidPcaCountRange[0]}
- <if test="query.inValidPcaCountRange.size >1 ">
- and pca_invalid_count < #{query.inValidPcaCountRange[1]}
- </if>
- </if>
- <choose>
- <when test="query.warnWillFinished != false or query.warnAnalgesicPoor != false or query.warnLowBattery != false">
- and (
- <choose>
- <when test="query.warnWillFinished != false">warn_will_finished=1</when>
- <otherwise>warn_will_finished!=1</otherwise>
- </choose>
- <if test="query.warnAnalgesicPoor != false">or warn_analgesic_poor=1 </if>
- <if test="query.warnLowBattery != false"> or warn_low_battery=1 </if>
- <if test="query.warnFlow !=null">
- or warn_flow= #{query.warnFlow}
- </if>
- )
- </when>
- <otherwise>
- <if test="query.warnFlow !=null">
- and warn_flow= #{query.warnFlow}
- </if>
- </otherwise>
- </choose>
- </where>
- ) as i
- JOIN (select * from bus_clinic
- <where>
- <if test="query.patientCode != null">
- and patient_code like concat('%',#{query.patientCode},'%')
- </if>
- <if test="query.patientName != null">
- and patient_name like concat('%',#{query.patientName},'%')
- </if>
- <if test="query.patientGender != null">
- and patient_gender =#{query.patientGender}
- </if>
- <if test="query.ageRange != null and query.ageRange.size > 0">
- and patient_age > #{query.ageRange[0]}
- <if test="query.ageRange.size >1 ">
- and patient_age < #{query.ageRange[1]}
- </if>
- </if>
- <if test="query.weightRange != null and query.weightRange.size > 0">
- and weight > #{query.weightRange[0]}
- <if test="query.weightRange.size >1 ">
- and weight < #{query.weightRange[1]}
- </if>
- </if>
- <if test="query.asa != null">
- and asa like concat('%',#{query.asa},'%')
- </if>
- <if test="query.ward != null">
- and ward like concat('%',#{query.ward},'%')
- </if>
- <if test="query.bedNo != null">
- and bed_no like concat('%',#{query.bedNo},'%')
- </if>
- <if test="query.anaDoctor != null">
- and ana_doctor like concat('%',#{query.anaDoctor},'%')
- </if>
- <if test="query.anaType != null">
- and ana_type like concat('%',#{query.anaType},'%')
- </if>
- <if test="query.analType != null">
- and anal_type like concat('%',#{query.analType},'%')
- </if>
- <if test="query.drugName != null">
- and formula like concat('%',#{query.drugName},'%')
- </if>
- <if test="query.surgeryDoctor != null">
- and surgery_doctor like concat('%',#{query.surgeryDoctor},'%')
- </if>
- <if test="query.surgeryName != null">
- and surgery_name like concat('%',#{query.surgeryName},'%')
- </if>
- </where>
- ) as c
- on i.clinic_id=c.id
- left join (select * from bus_evaluation) as e
- on e.infusion_id=i.id
- </select>
- </mapper>
|