diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java index 34f9a80a..a68b3a2c 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java @@ -45,7 +45,7 @@ public class DeviceController extends BaseController { startPage(); List list = new ArrayList<>(); - if(device.getUserName()==null || device.getUserName()=="" ) + if(device.getUserId() == null) { list = deviceService.selectDeviceList(device); }else { @@ -65,7 +65,7 @@ public class DeviceController extends BaseController { startPage(); List list = new ArrayList<>(); - if(device.getUserName()==null || device.getUserName()=="" ) + if(device.getUserId() == null) { list = deviceService.selectDeviceShortList(device); }else { diff --git a/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml b/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml index 7f16e5f9..9e6a7ff3 100644 --- a/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml +++ b/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml @@ -167,10 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and device_name like concat('%', #{deviceName}, '%') and product_id = #{productId} and product_name like concat('%', #{productName}, '%') - - and user_id = #{userId} - or device_id in (select device_id from iot_device_user where iot_device_user.user_name = #{userName}) - + and user_id = #{userId} and user_name like concat('%', #{userName}, '%') and tenant_id = #{tenantId} and tenant_name like concat('%', #{tenantName}, '%') @@ -180,24 +177,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by create_time desc +