BusDeviceManualMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.coffee.bus.mapper.BusDeviceManualMapper">
  4. <resultMap id="monitorResult" type="com.coffee.bus.service.dto.ManualMonitorResult">
  5. <result column="patient_code" property="patientCode"/>
  6. <result column="patient_name" property="patientName"/>
  7. <result column="patient_age" property="patientAge"/>
  8. <result column="patient_gender" property="patientGender"/>
  9. <result column="ward" property="ward"/>
  10. <result column="bed_no" property="bedNo"/>
  11. <result column="surgery_name" property="surgeryName"/>
  12. <result column="ana_doctor" property="anaDoctor"/>
  13. <result column="start_time" property="startTime"/>
  14. <result column="monitor_start_time" property="monitorStartTime"/>
  15. <result column="device_type" property="deviceType"/>
  16. <result column="clinic_id" property="clinicId"/>
  17. </resultMap>
  18. <select id="selectMonitor" resultMap="monitorResult" parameterType="com.coffee.bus.service.dto.ManualMonitorQuery">
  19. select
  20. c.patient_code as patient_code,
  21. c.patient_name as patient_name,
  22. c.patient_gender as patient_gender,
  23. c.patient_age as patient_age,
  24. c.monitor_start_time as monitor_start_time,
  25. c.id as clinic_id,
  26. c.ward as ward,
  27. c.bed_no as bed_no,
  28. c.`name` as surgery_name,
  29. c.ana_doctor as ana_doctor,
  30. c.start_time as start_time,
  31. IFNULL(dm.type,-1) as device_type
  32. from
  33. (select * from bus_clinic where monitor_type=0 and finished=0 ) as c
  34. left JOIN bus_device_manual as dm on c.id=dm.clinic_id
  35. <where>
  36. <if test="query.blurry != null">
  37. (
  38. c.`bed_no` like concat('%', #{query.blurry}, '%') or c.`patient_code` like concat('%', #{query.blurry}, '%') or c.ward LIKE concat('%', #{query.blurry}, '%') OR c.patient_name LIKE concat('%', #{query.blurry}, '%')
  39. )
  40. </if>
  41. <if test="query.types != null and query.types.size > 0">
  42. and type in
  43. <foreach item="type" index="index" collection="query.types" open="(" separator="," close=")">
  44. #{type, jdbcType=VARCHAR}
  45. </foreach>
  46. </if>
  47. </where>
  48. </select>
  49. </mapper>