|
|
@@ -0,0 +1,49 @@
|
|
|
+<?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.airway.repository.BizDeviceRepository">
|
|
|
+
|
|
|
+ <resultMap id="stdResult" type="cn.tr.module.airway.controller.vo.BizDeviceVO">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="deviceCode" column="device_code"/>
|
|
|
+ <result property="alias" column="alias"/>
|
|
|
+ <result property="androidVersion" column="android_version"/>
|
|
|
+ <result property="deviceType" column="device_type"/>
|
|
|
+ <result property="airwayVersion" column="airway_version"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="count" column="count"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="hospitalName" column="hospital_name"/>
|
|
|
+ <result property="hospitalId" column="hospital_id"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="stdSelectBizDeviceList" resultMap="stdResult">
|
|
|
+ select
|
|
|
+ bd.id as id,
|
|
|
+ bd.device_code as device_code,
|
|
|
+ bd.alias as alias,
|
|
|
+ bd.android_version as android_version,
|
|
|
+ bd.device_type as device_type,
|
|
|
+ bd.airway_version as airway_version,
|
|
|
+ bd.remark as remark,
|
|
|
+ bd.count as count,
|
|
|
+ bd.create_time as create_time,
|
|
|
+ st.name as hospital_name,
|
|
|
+ st.id as hospital_id
|
|
|
+ from biz_device as bd
|
|
|
+ LEFT JOIN sys_tenant as st on bd.tenant_id=st.id
|
|
|
+ <where>
|
|
|
+ <if test="query.hospitalId != null and query.hospitalId != ''">
|
|
|
+ and bd.tenant_id = #{query.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="query.blurry != null and query.blurry != ''">
|
|
|
+ and (bd.alias like concat('%',#{query.blurry},'%') or bd.device_code like concat('%',#{query.blurry},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateDeviceCount">
|
|
|
+ update biz_device set count =(select count(1) from biz_video where device_code = #{deviceCode}) where device_code= #{deviceCode}'
|
|
|
+ </update>
|
|
|
+</mapper>
|