|
@@ -25,6 +25,8 @@ |
|
@@ -25,6 +25,8 @@ |
25
|
<result property="description" column="description"/>
|
25
|
<result property="description" column="description"/>
|
26
|
<result property="customerId" column="customer_id"/>
|
26
|
<result property="customerId" column="customer_id"/>
|
27
|
<result property="organizationId" column="organization_id"/>
|
27
|
<result property="organizationId" column="organization_id"/>
|
|
|
28
|
+ <result property="gatewayId" column="gateway_id"/>
|
|
|
29
|
+ <result property="gatewayName" column="gateway_name"/>
|
28
|
<association property="deviceProfile" javaType="org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO">
|
30
|
<association property="deviceProfile" javaType="org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO">
|
29
|
<result property="name" column="profile_name"/>
|
31
|
<result property="name" column="profile_name"/>
|
30
|
<result property="transportType" column="transport_type"/>
|
32
|
<result property="transportType" column="transport_type"/>
|
|
@@ -41,6 +43,7 @@ |
|
@@ -41,6 +43,7 @@ |
41
|
<result property="createdTime" column="created_time"/>
|
43
|
<result property="createdTime" column="created_time"/>
|
42
|
<result property="lastOnlineTime" column="last_online_time"/>
|
44
|
<result property="lastOnlineTime" column="last_online_time"/>
|
43
|
</resultMap>
|
45
|
</resultMap>
|
|
|
46
|
+
|
44
|
<sql id="basicColumns">
|
47
|
<sql id="basicColumns">
|
45
|
ifd.id,ifd.name,ifd.device_info,ifd.profile_id,ifd.active_time,ifd.tenant_id,ifd.description
|
48
|
ifd.id,ifd.name,ifd.device_info,ifd.profile_id,ifd.active_time,ifd.tenant_id,ifd.description
|
46
|
,ifd.tb_device_id,ifd.label,ifd.last_connect_time,ifd.device_type,ifd.device_state,ifd.create_time,ifd.update_time,ifd.creator,
|
49
|
,ifd.tb_device_id,ifd.label,ifd.last_connect_time,ifd.device_type,ifd.device_state,ifd.create_time,ifd.update_time,ifd.creator,
|
|
@@ -48,6 +51,7 @@ |
|
@@ -48,6 +51,7 @@ |
48
|
</sql>
|
51
|
</sql>
|
49
|
<sql id="detailColumns">
|
52
|
<sql id="detailColumns">
|
50
|
<include refid="basicColumns"/>
|
53
|
<include refid="basicColumns"/>
|
|
|
54
|
+ ,ifd.gateway_id,idg.name gateway_name
|
51
|
,ifdp.name AS profile_name,ifdp.transport_type
|
55
|
,ifdp.name AS profile_name,ifdp.transport_type
|
52
|
,io.name AS organization_name
|
56
|
,io.name AS organization_name
|
53
|
</sql>
|
57
|
</sql>
|
|
@@ -109,6 +113,7 @@ |
|
@@ -109,6 +113,7 @@ |
109
|
FROM iotfs_device ifd
|
113
|
FROM iotfs_device ifd
|
110
|
LEFT JOIN device_profile ifdp ON ifd.profile_id = CAST (ifdp.id AS VARCHAR)
|
114
|
LEFT JOIN device_profile ifdp ON ifd.profile_id = CAST (ifdp.id AS VARCHAR)
|
111
|
LEFT JOIN iotfs_organization io ON io.id = ifd.organization_id
|
115
|
LEFT JOIN iotfs_organization io ON io.id = ifd.organization_id
|
|
|
116
|
+ LEFT JOIN iotfs_device idg ON idg.id = ifd.gateway_id
|
112
|
<where>
|
117
|
<where>
|
113
|
<if test="tenantId !=null and tenantId !=''">
|
118
|
<if test="tenantId !=null and tenantId !=''">
|
114
|
AND ifd.tenant_id = #{tenantId}
|
119
|
AND ifd.tenant_id = #{tenantId}
|