xucaiqin 1 рік тому
батько
коміт
75572f19f4

+ 5 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/api/DeviceApiImpl.java

@@ -37,6 +37,11 @@ public class DeviceApiImpl implements DeviceApi {
         return null;
     }
 
+    @Override
+    public DevicesVo queryDevice(Long id) {
+        return iotDeviceService.query(id);
+    }
+
     @Override
     public List<DevicesVo> devicesQuery(DevicesNameVo devicesNameVo)  {
         return iotDeviceService.devicesQuery(devicesNameVo);

+ 1 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/mapper/IotDeviceMapper.java

@@ -69,4 +69,5 @@ public interface IotDeviceMapper extends BaseMapper<IotDevice> {
     List<DevicesVo> devicesQuery(DevicesNameVo devicesNameVo);
 
 
+    DevicesVo queryDevice(@Param("id") Long id);
 }

+ 4 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/java/com/middle/platform/manage/biz/service/IotDeviceService.java

@@ -336,6 +336,7 @@ public class IotDeviceService {
 
     /**
      * 根据设备名字模糊筛选
+     *
      * @author Aick Spt
      * @date 2024-05-07 17:03
      */
@@ -344,4 +345,7 @@ public class IotDeviceService {
     }
 
 
+    public DevicesVo query(Long id) {
+        return iotDeviceMapper.queryDevice(id);
+    }
 }

+ 11 - 0
iot-module/iot-module-manage/iot-module-manage-biz/src/main/resources/mapper/IotDeviceMapper.xml

@@ -177,6 +177,17 @@
             and id.del_flag = 0
         </where>
     </select>
+    <select id="queryDevice" resultType="com.middle.platform.manage.api.pojo.DevicesVo">
+        select id.id,
+               id.name
+        from iot_device id
+        <where>
+            <if test="id != null">
+                and id.id = #{id,jdbcType=BIGINT}
+            </if>
+            and id.del_flag = 0
+        </where>
+    </select>
 
     <select id="deviceCache" resultType="com.middle.platform.manage.api.pojo.DeviceVo">
         select id.id,