物联设备更换区域,与设备预览的bug处理
This commit is contained in:
parent
254a8bf8de
commit
9ec72317b7
|
|
@ -58,6 +58,9 @@
|
||||||
<if test="params.batchNo != null and params.batchNo != ''">
|
<if test="params.batchNo != null and params.batchNo != ''">
|
||||||
AND a.batch_no = #{params.batchNo}
|
AND a.batch_no = #{params.batchNo}
|
||||||
</if>
|
</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
|
order by a.batch_no,a.dimension,a.device_type,a.device_model,a.sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -216,6 +219,7 @@
|
||||||
inner join nu_iot_tplink_camera b on a.sn = b.mac
|
inner join nu_iot_tplink_camera b on a.sn = b.mac
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
and a.device_type = 'SURVEILLANCECAMERA'
|
and a.device_type = 'SURVEILLANCECAMERA'
|
||||||
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findCameraInfoUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
<select id="findCameraInfoUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||||
|
|
@ -223,8 +227,8 @@
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_iot_tplink_camera b on a.sn = b.mac
|
left join nu_iot_tplink_camera b on a.sn = b.mac
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
and a.device_type = 'SURVEILLANCECAMERA'
|
and a.device_type = 'SURVEILLANCECAMERA'
|
||||||
and a.device_status != '损坏'
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="waterMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
<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
|
inner join nu_iot_tq_water_meter b on a.sn = b.cid
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
and a.device_type = 'sb'
|
and a.device_type = 'sb'
|
||||||
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findWaterMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
<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
|
left join nu_iot_tq_water_meter b on a.sn = b.cid
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
and a.device_type = 'sb'
|
and a.device_type = 'sb'
|
||||||
and a.device_status != '损坏'
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="electricityMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<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
|
inner join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
and a.device_type = 'db'
|
and a.device_type = 'db'
|
||||||
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findElectricityMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<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
|
left join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
and a.device_type = 'db'
|
and a.device_type = 'db'
|
||||||
and a.device_status != '损坏'
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="humidDeviceList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
<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
|
inner join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
and a.device_type = 'wsdj'
|
and a.device_type = 'wsdj'
|
||||||
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findHumidDeviceUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
<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
|
left join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
and a.device_type = 'wsdj'
|
and a.device_type = 'wsdj'
|
||||||
and a.device_status != '损坏'
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="editPreviewStatusBySn">
|
<update id="editPreviewStatusBySn">
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class DeviceManagerServiceImpl extends ServiceImpl<DeviceManagerMapper, D
|
||||||
DeviceManager deviceManager = new DeviceManager();
|
DeviceManager deviceManager = new DeviceManager();
|
||||||
deviceManager.setId(deviceBindLog.getId());
|
deviceManager.setId(deviceBindLog.getId());
|
||||||
deviceManager.setDeviceStatus(deviceBindLog.getOptType());
|
deviceManager.setDeviceStatus(deviceBindLog.getOptType());
|
||||||
if(deviceBindLog.getOptType().equals("绑定")||deviceBindLog.getOptType().equals("更换")){
|
if(deviceBindLog.getOptType().equals("绑定区域")||deviceBindLog.getOptType().equals("更换区域")){
|
||||||
deviceManager.setNuId(deviceBindLog.getNuId());
|
deviceManager.setNuId(deviceBindLog.getNuId());
|
||||||
}
|
}
|
||||||
baseMapper.updateById(deviceManager);
|
baseMapper.updateById(deviceManager);
|
||||||
|
|
|
||||||
|
|
@ -322,24 +322,29 @@
|
||||||
a.create_time,
|
a.create_time,
|
||||||
a.update_time,
|
a.update_time,
|
||||||
a.remarks,
|
a.remarks,
|
||||||
t.online_status as deviceStatus
|
t.online_status as deviceStatus,
|
||||||
|
t.device_index
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_base_info c on a.nu_id = c.nu_id
|
left join nu_base_info c on a.nu_id = c.nu_id
|
||||||
inner join (
|
inner join (
|
||||||
select mac as sn,
|
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
|
from nu_iot_tplink_camera
|
||||||
union all
|
union all
|
||||||
select sn,
|
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
|
from nu_iot_ds_electricity_meter
|
||||||
union all
|
union all
|
||||||
select cid as sn,
|
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
|
from nu_iot_tq_water_meter
|
||||||
union all
|
union all
|
||||||
select sn,
|
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
|
from nu_iot_yiweilian_humid_device
|
||||||
) t on a.sn = t.sn
|
) t on a.sn = t.sn
|
||||||
where a.sn is not null
|
where a.sn is not null
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue