Просмотр исходного кода

修复 农事设备绑定到基地未绑定到地块的情况下地块设备列表能看到设备的问题

zhaiyifei 10 месяцев назад
Родитель
Сommit
d37355e759

+ 2 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/domain/reqvo/IotDeviceListReqVo.java

@@ -50,4 +50,6 @@ public class IotDeviceListReqVo extends IotDevice {
 
     /** 标记类型 0 手动标记 1  机器自动标记 */
     private String cbdrecogMarktype;
+
+    private String blockId;
 }

+ 9 - 1
src/main/resources/mapper/IotDeviceMapper.xml

@@ -126,9 +126,17 @@
     <!--为了区分上面那个列表,那个是被用在设备统一管理界面,这个是各个子模块的列表-->
     <select id="selectIotDeviceListByType"
             resultType="com.yunfeiyun.agmp.iotm.web.domain.resvo.IotDeviceListResVo">
-        <include refid="selectIotDeviceVo"/>
+        SELECT d.* ,dt.devtypeName, dc.devclassName,dt.devtypePreview devPic
+        FROM IotDevice AS d
+            LEFT JOIN TosDevicetype AS dt ON dt.devtypeBid = d.devtypeBid
+            LEFT JOIN TosDeviceclass AS dc ON dc.devclassBid = d.devclassBid
+            <if test="blockId != null  and blockId != ''">
+                LEFT JOIN TmnBlock AS tb ON tb.tmnId = d.devBid
+            </if>
         <where>
             d.tid = #{tid} and d.devDelstatus = '0'
+            <if test="blockId != null  and blockId != ''">and tb.blockId = #{blockId}</if>
+
             <if test="devBid != null  and devBid != ''">and d.devBid = #{devBid}</if>
             <if test="devtypeBid != null  and devtypeBid != ''">and d.devtypeBid = #{devtypeBid}</if>
             <if test="firmBid != null  and firmBid != ''">and d.firmBid = #{firmBid}</if>