فهرست منبع

完好率接口

Zimo 14 ساعت پیش
والد
کامیت
32d62f94cc

+ 3 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotDeviceMapper.java

@@ -351,4 +351,7 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
     List<IotDeviceSimple> selectCodeAndNameList();
     List<IotDeviceSimple> selectTypeNumber(@Param("reqVO") IotDevicePageReqVO reqVO,@Param("products") List<Integer> products);
     List<IotDeviceRespVO> selectExport(@Param("reqVO") IotDevicePageReqVO reqVO);
+    Long getTotalA(@Param("reqVO") IotDevicePageReqVO reqVO);
+    List<Long> getFailureCount(@Param("reqVO") IotDevicePageReqVO reqVO);
+    List<Long> getRepairCount(@Param("reqVO") IotDevicePageReqVO reqVO);
 }

+ 63 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotDeviceMapper.xml

@@ -610,4 +610,67 @@
         </where>
     </select>
 
+
+
+    <select id="getTotalA" resultType="java.lang.Long">
+        SELECT COUNT(1) FROM RQ_IOT_DEVICE b WHERE ASSET_CLASS IN(select id from rq_iot_product_classify a
+        <where>
+            a.deleted=0
+            <if test='reqVO.remark!=null'>
+                AND a.remark = #{reqVO.remark}
+            </if>
+        </where>
+        )
+        and
+        b.deleted=0
+        <if test="reqVO.deptIds != null and reqVO.deptIds.size &gt; 0">
+            AND b.dept_id IN
+            <foreach collection="reqVO.deptIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getFailureCount" resultType="java.lang.Long">
+        select b.device_id from (SELECT ID FROM RQ_IOT_DEVICE c WHERE ASSET_CLASS IN(select id from rq_iot_product_classify a
+        <where>
+            a.deleted=0
+            <if test='reqVO.remark!=null'>
+                AND a.remark = #{reqVO.remark}
+            </if>
+        </where>
+        )
+        and
+        c.deleted=0
+        <if test="reqVO.deptIds != null and reqVO.deptIds.size &gt; 0">
+            AND c.dept_id IN
+            <foreach collection="reqVO.deptIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+        )a
+        left JOIN (select DISTINCT(device_id) from rq_iot_failure_report where `status`!='finished')b
+        on a.id=b.device_id where b.device_id is not NULL
+    </select>
+    <select id="getRepairCount" resultType="java.lang.Long">
+        select b.device_id from (SELECT ID FROM RQ_IOT_DEVICE c WHERE ASSET_CLASS IN(select id from rq_iot_product_classify a
+        <where>
+            a.deleted=0
+            <if test='reqVO.remark!=null'>
+                AND a.remark = #{reqVO.remark}
+            </if>
+        </where>
+        )
+        and
+        c.deleted=0
+        <if test="reqVO.deptIds != null and reqVO.deptIds.size &gt; 0">
+            AND c.dept_id IN
+            <foreach collection="reqVO.deptIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+        )a
+        left JOIN (select DISTINCT(device_id) from rq_iot_maintain where `status`!='finished')b
+        on a.id=b.device_id where b.device_id is not NULL
+    </select>
 </mapper>