|
|
@@ -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 > 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 > 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 > 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>
|