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 34f9a80a9b002afb63a3f333298e9d7ed9311fc4..a68b3a2c2b3d898fed671a0a53c9c22a4948518f 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 7f16e5f98c7960b61c8e5a9a9bc41c392697ec02..9e6a7ff38fdde710c826c5021216f3fce93cca29 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 +