Commit f227a036 authored by lisong's avatar lisong

修改物联报表-周报表数据精度bug

parent 94345de5
......@@ -4222,8 +4222,40 @@
if (SUM(a1.lastAlarmNum)>0,IFNULL( convert( ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum))/SUM(a1.lastAlarmNum),char(5)),'-'),ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)))*100 as alarmWOW,
(CASE WHEN (SUM(a1.exepctionNum)-SUM(a1.lastExepctionNum)) <0 THEN '减少' else '增加' end ) as status1,
(CASE WHEN (SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)) <0 THEN '减少' else '增加' end ) as status2,
FORMAT(if(SUM(a1.num)>0, convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),char(5)), SUM(a1.num - a1.exepctionNum))*100, 2) as normalRate,
FORMAT(if(SUM(a1.num)>0,convert(SUM(a1.faultNum)/SUM(a1.num),char(5)),SUM(a1.faultNum)) *100, 2) as faultRate,
FORMAT(
IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.num - a1.exepctionNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.num - a1.exepctionNum )
) * 100,
2
) AS normalRate,
FORMAT(
IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.faultNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.faultNum )
) * 100,
2
) AS faultRate,
a1.create_date
from
(SELECT
......
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