Commit f0541523ef896b7822925487a7e7949f5dfa0d30

Authored by 云中非
1 parent d401024d

fix: 网关子设备与网关设备的tb_device_id关联

@@ -140,7 +140,7 @@ @@ -140,7 +140,7 @@
140 LEFT JOIN attribute_kv c ON ifd.tb_device_id = c.entity_id::TEXT AND c.entity_type ='DEVICE' AND c.attribute_key='lastDisconnectTime' 140 LEFT JOIN attribute_kv c ON ifd.tb_device_id = c.entity_id::TEXT AND c.entity_type ='DEVICE' AND c.attribute_key='lastDisconnectTime'
141 LEFT JOIN attribute_kv e ON ifd.tb_device_id = e.entity_id::TEXT AND e.entity_type ='DEVICE' AND e.attribute_key='lastConnectTime' 141 LEFT JOIN attribute_kv e ON ifd.tb_device_id = e.entity_id::TEXT AND e.entity_type ='DEVICE' AND e.attribute_key='lastConnectTime'
142 LEFT JOIN device d ON d.id::TEXT = ifd.tb_device_id 142 LEFT JOIN device d ON d.id::TEXT = ifd.tb_device_id
143 - LEFT JOIN tk_device idg ON idg.id = ifd.gateway_id 143 + LEFT JOIN tk_device idg ON idg.tb_device_id = ifd.gateway_id
144 <where> 144 <where>
145 <if test="tenantId !=null and tenantId !=''"> 145 <if test="tenantId !=null and tenantId !=''">
146 AND ifd.tenant_id = #{tenantId} 146 AND ifd.tenant_id = #{tenantId}