物联设备预览时因为id重复出现重复数据

This commit is contained in:
曹磊 2026-03-25 14:13:13 +08:00
parent 04e9eeb645
commit 44b4628c54
2 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ public class CameraInfo implements Serializable {
/**ID*/
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "ID")
private Integer id;
private String id;
/**设备编码*/
@Excel(name = "设备编码", width = 15)
@ApiModelProperty(value = "设备编码")

View File

@ -283,25 +283,25 @@
<select id="previewList" parameterType="com.nu.modules.tplink.camera.entity.CameraInfo" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
select a.*,b.nu_name,b.area_flag
from (
select id,nu_id,device_index,mac as sn,device_model,device_type,
select mac as id,nu_id,device_index,mac as sn,device_model,device_type,
( case device_status when '0' then '离线' when '1' then '在线' end ) as device_status,
dimension,
maintain_status
from nu_iot_tplink_camera
union all
select id,nu_id,sn as device_index,sn,'' as device_model,'db' as device_type,
select sn as id,nu_id,sn as device_index,sn,'' as device_model,'db' as device_type,
( case relay_state when '0' then '拉闸' else '合闸' end ) as device_status,
dimension,
maintain_status
from nu_iot_ds_electricity_meter
union all
select id,nu_id,cid as device_index,cid as sn,'' as device_model,'sb' as device_type,
select cid as id,nu_id,cid as device_index,cid as sn,'' as device_model,'sb' as device_type,
( case relay_state when '0' then '关阀' else '开阀' end ) as device_status,
dimension,
maintain_status
from nu_iot_tq_water_meter
union all
select id,nu_id,sn as device_index,sn,'' as device_model,'wsdj' as device_type,
select sn as id,nu_id,sn as device_index,sn,'' as device_model,'wsdj' as device_type,
( case status when '0' then '在线' else '离线' end ) as device_status,
dimension,
maintain_status