Commit a02200af authored by zhangsen's avatar zhangsen

物联设备

parent bd4b0865
......@@ -18,5 +18,9 @@ public class BigScreenVo {
private List<Map<String, Object>> industryPool;
private List<Map<String, Object>> equipInfo;
private List<Map<String, Object>> breakdownInfo;
// private Integer carNum;
}
......@@ -401,4 +401,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Integer getCarNum(@Param("companyCode") String companyCode);
List<Map<String, Object>> getCarInfo(@Param("companyCode") String companyCode);
List<Map<String, Object>> getEquipInfo(@Param("companyCode") String companyCode, @Param("alarmType") String alarmType);
}
......@@ -1357,6 +1357,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum);
bigScreenVo.setIndustryPool(industryPool);
bigScreenVo.setPool(pool);
List<Map<String, Object>> equipInfo = fireFightingSystemMapper.getEquipInfo(companyCode, null);
List<Map<String, Object>> breakdown = fireFightingSystemMapper.getEquipInfo(companyCode, "BREAKDOWN");
bigScreenVo.setEquipInfo(equipInfo);
bigScreenVo.setBreakdownInfo(breakdown);
return bigScreenVo;
}
}
......@@ -2831,4 +2831,70 @@
wc.id
) a) b
</select>
<select id="getEquipInfo" resultType="java.util.Map">
SELECT
temp.total,
temp.notReturned,
temp.alarmEquipTotalNum,(
temp.alarmEquipTotalNum - temp.notReturned
) AS returned,
(
TRUNCATE ( abs(( temp.alarmEquipTotalNum ) / IF (( temp.total = 0 ), 1, temp.total )), 2 ) * 100
) AS equipAbs,
(
TRUNCATE ( abs(( temp.alarmEquipTotalNum - temp.notReturned ) / IF (( temp.alarmEquipTotalNum = 0 ), 1, temp.alarmEquipTotalNum )), 2 ) * 100
) AS returnAbs
FROM
(
SELECT
(
SELECT
count( 1 )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = es.biz_org_code
WHERE
e.is_iot = 1
<if test="companyCode != null and companyCode != ''">
and ou.`code` = #{companyCode}
</if>
) AS total,
(
SELECT
COUNT(
DISTINCT ( esa.iot_code ))
FROM
wl_equipment_specific_alarm esa
LEFT JOIN cb_org_usr ou ON ou.amos_org_code = esa.org_code
WHERE
esa.create_date LIKE CONCAT( DATE_FORMAT( now(), '%Y-%m' ), '%' )
<if test="alarmType != null and alarmType != ''">
AND esa.type = #{alarmType}
</if>
<if test="companyCode != null and companyCode != ''">
and ou.`code` = #{companyCode}
</if>
) AS alarmEquipTotalNum,
(
SELECT
COUNT(
DISTINCT ( esa.iot_code ))
FROM
wl_equipment_specific_alarm esa
LEFT JOIN cb_org_usr ou ON ou.amos_org_code = esa.org_code
WHERE
esa.equipment_specific_index_value = "true"
AND esa.create_date LIKE CONCAT( DATE_FORMAT( now(), '%Y-%m' ), '%' )
<if test="alarmType != null and alarmType != ''">
AND esa.type = #{alarmType}
</if>
<if test="companyCode != null and companyCode != ''">
and ou.`code` = #{companyCode}
</if>
) AS notReturned
) temp
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment