物联设备更换区域,与设备预览的bug处理

This commit is contained in:
曹磊 2026-04-27 17:51:41 +08:00
parent 254a8bf8de
commit 9ec72317b7
3 changed files with 23 additions and 11 deletions

View File

@ -58,6 +58,9 @@
<if test="params.batchNo != null and params.batchNo != ''">
AND a.batch_no = #{params.batchNo}
</if>
<if test="params.deviceStatus != null and params.deviceStatus != ''">
AND t.online_status = #{params.deviceStatus}
</if>
order by a.batch_no,a.dimension,a.device_type,a.device_model,a.sn
</select>
@ -216,6 +219,7 @@
inner join nu_iot_tplink_camera b on a.sn = b.mac
where a.nu_id = #{nuId}
and a.device_type = 'SURVEILLANCECAMERA'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="findCameraInfoUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
@ -224,7 +228,7 @@
left join nu_iot_tplink_camera b on a.sn = b.mac
where a.nu_id is null
and a.device_type = 'SURVEILLANCECAMERA'
and a.device_status != '损坏'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="waterMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
@ -233,6 +237,7 @@
inner join nu_iot_tq_water_meter b on a.sn = b.cid
where a.nu_id = #{nuId}
and a.device_type = 'sb'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="findWaterMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
@ -241,7 +246,7 @@
left join nu_iot_tq_water_meter b on a.sn = b.cid
where a.nu_id is null
and a.device_type = 'sb'
and a.device_status != '损坏'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="electricityMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
@ -250,6 +255,7 @@
inner join nu_iot_ds_electricity_meter b on a.sn = b.sn
where a.nu_id = #{nuId}
and a.device_type = 'db'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="findElectricityMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
@ -258,7 +264,7 @@
left join nu_iot_ds_electricity_meter b on a.sn = b.sn
where a.nu_id is null
and a.device_type = 'db'
and a.device_status != '损坏'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="humidDeviceList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
@ -267,6 +273,7 @@
inner join nu_iot_yiweilian_humid_device b on a.sn = b.sn
where a.nu_id = #{nuId}
and a.device_type = 'wsdj'
and ifnull(a.device_status,'') != '损坏'
</select>
<select id="findHumidDeviceUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
@ -275,7 +282,7 @@
left join nu_iot_yiweilian_humid_device b on a.sn = b.sn
where a.nu_id is null
and a.device_type = 'wsdj'
and a.device_status != '损坏'
and ifnull(a.device_status,'') != '损坏'
</select>
<update id="editPreviewStatusBySn">

View File

@ -80,7 +80,7 @@ public class DeviceManagerServiceImpl extends ServiceImpl<DeviceManagerMapper, D
DeviceManager deviceManager = new DeviceManager();
deviceManager.setId(deviceBindLog.getId());
deviceManager.setDeviceStatus(deviceBindLog.getOptType());
if(deviceBindLog.getOptType().equals("绑定")||deviceBindLog.getOptType().equals("更换")){
if(deviceBindLog.getOptType().equals("绑定区域")||deviceBindLog.getOptType().equals("更换区域")){
deviceManager.setNuId(deviceBindLog.getNuId());
}
baseMapper.updateById(deviceManager);

View File

@ -322,24 +322,29 @@
a.create_time,
a.update_time,
a.remarks,
t.online_status as deviceStatus
t.online_status as deviceStatus,
t.device_index
from nu_iot_device_preview a
left join nu_base_info c on a.nu_id = c.nu_id
inner join (
select mac as sn,
( case device_status when '0' then '离线' when '1' then '在线' end ) as online_status
( case device_status when '0' then '离线' when '1' then '在线' end ) as online_status,
device_index
from nu_iot_tplink_camera
union all
select sn,
( case relay_state when '0' then '离线' else '在线' end ) as online_status
( case relay_state when '0' then '离线' else '在线' end ) as online_status,
'' as device_index
from nu_iot_ds_electricity_meter
union all
select cid as sn,
( case relay_state when '0' then '离线' else '在线' end ) as online_status
( case relay_state when '0' then '离线' else '在线' end ) as online_status,
'' as device_index
from nu_iot_tq_water_meter
union all
select sn,
( case status when '0' then '在线' else '离线' end ) as online_status
( case status when '0' then '在线' else '离线' end ) as online_status,
'' as device_index
from nu_iot_yiweilian_humid_device
) t on a.sn = t.sn
where a.sn is not null