| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?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="cn.tr.module.smart.common.repository.BizDeviceRepository">
- <resultMap id="deviceDto" type="cn.tr.module.smart.common.dto.BizDeviceDTO">
- <result property="deviceId" column="device_id"/>
- <result property="deviceType" column="device_type"/>
- <result property="patientName" column="patient_name"/>
- <result property="continueDose" column="continue_dose"/>
- <result property="totalDose" column="total_dose"/>
- <result property="remainDose" column="remain_dose"/>
- <result property="pcaTotalCount" column="pca_total_count"/>
- <result property="pcaInvalidCount" column="pca_invalid_count"/>
- <result property="pcaValidCount" column="pca_valid_count"/>
- <result property="electricQuantity" column="electric_quantity"/>
- </resultMap>
- <select id="selectDeviceList" resultMap="deviceDto">
- SELECT
- bd.device_id,
- bih.device_type,
- bcr.patient_name,
- bih.continue_dose,
- bih.total_dose,
- bih.remain_dose,
- bih.pca_total_count,
- bih.pca_invalid_count,
- bih.pca_valid_count,
- bih.electric_quantity
- FROM
- biz_device bd
- left 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.deviceType != null and query.deviceType != ''">
- and bih.device_type = #{query.deviceType}
- </if>
- <if test="query.patientName != null and query.patientName != ''">
- and bcr.patient_name like concat('%',#{query.patientName},'%')
- </if>
- </where>
- order by bih.last_upload_time desc
- </select>
- </mapper>
|