Commit 27350fb3 authored by KeYong's avatar KeYong

修改水池液位bug

parent a1ea72b9
......@@ -36,6 +36,9 @@ public class UnitTransformUtil {
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1");
map.put("abs", "--");
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
......@@ -66,6 +69,9 @@ public class UnitTransformUtil {
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1");
map.put("abs", "--");
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
......@@ -96,6 +102,9 @@ public class UnitTransformUtil {
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1");
map.put("abs", "--");
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
......@@ -128,6 +137,9 @@ public class UnitTransformUtil {
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1");
map.put("abs", "--");
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
......
......@@ -4791,7 +4791,14 @@
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
-- IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
IFNULL((select
avg(IFNULL(ei.`value`, 0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
AND FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0), '--') AS nowLevel,
IFNULL(CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`unit` END,'--') AS 'unit',
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
......
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