Commit c8ac8d15 authored by litengwei's avatar litengwei

bug提交

parent adff13ab
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.patrol.business.service.intfc.IEquipmentHandlerService;
import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.Toke;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.dao.entity.InputItem;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -70,7 +71,8 @@ public class EquipmentRuleController extends AbstractBaseController{
// param.put("classifyId",classifyId);
// param.put("orgCode",orgCode);
List<InputItem> list=equipmentHandlerService.getEquipmnetRulesByName(equipmentName);
return CommonResponseUtil.success(list);
Object ov= ToJson.tojson(list);
return CommonResponseUtil.success(ov);
}
}
......@@ -4822,101 +4822,91 @@
</select>
<select id="getFoamTankBySuper" resultType="java.util.Map">
SELECT
a.`name`,
IFNULL( a.nowLevel, '--' ) AS nowLevel,
a.id,
IFNULL( a.image, '' ) AS image,
a.unit,
a.minLevel AS minLevel,
a.maxLevel AS maxLevel,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN a.minLevel - a.nowLevel > 0 THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
'foamTank' AS type
FROM
(
SELECT
ed.`name`,
es.iot_code,
es.id,
ec.image,
ei.unit,
max( CASE WHEN ei.equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' THEN ei.`value` END ) AS nowLevel,
max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) AS minLevel,
max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) AS maxLevel
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_index ei ON es.id = ei.equipment_specific_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON e.category_id = ec.id
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92031900%'
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND es.iot_code IS NOT NULL
GROUP BY
es.id
) a UNION ALL
SELECT
a.`name`,
IFNULL( a.nowLevel, '--' ) AS nowLevel,
a.id,
IFNULL( a.image, '' ) AS image,
'M' AS unit,
a.minLevel AS minLevel,
a.maxLevel AS maxLevel,
select
*,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN a.minLevel - a.nowLevel > 0 THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
a.type AS type
FROM
CASE
WHEN nowLevel IS NOT NULL
AND maxLevel IS NOT NULL
AND nowLevel - maxLevel > 0 THEN '1'
WHEN nowLevel IS NOT NULL
AND minLevel IS NOT NULL
AND nowLevel != '--'
AND nowLevel - minLevel >= 0 THEN '2'
WHEN nowLevel IS NOT NULL
AND minLevel IS NOT NULL
AND nowLevel != '--'
AND minLevel - nowLevel > 0 THEN '0'
ELSE '4'
END ) AS `status`
from
(
SELECT
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
a.`name`, IFNULL( a.nowLevel, '--' ) AS nowLevel, a.id, IFNULL( a.image, '' ) AS image, a.unit, a.minLevel AS minLevel, a.maxLevel AS maxLevel, (
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN '--'
WHEN a.minLevel - a.nowLevel > 0 THEN '缺水'
ELSE '正常'
END ) AS levelStatus, 'foamTank' AS type
FROM
(
SELECT
FORMAT( avg( IFNULL( ei.`value`, 0 ) ), 2 )
ed.`name`, es.iot_code, es.id, ec.image, ei.unit, max( CASE WHEN ei.equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' THEN ei.`value` END ) AS nowLevel, max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) AS minLevel, max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) AS maxLevel
FROM
wl_equipment_specific_index ei
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON
es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_index ei ON
es.id = ei.equipment_specific_id
LEFT JOIN wl_equipment e ON
e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON
e.category_id = ec.id
LEFT JOIN wl_form_instance_equip fi ON
fi.instance_id = es.id
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,
ec.image,
r.resource_type AS type,
r.sequence_nbr AS id
ed.`code` LIKE '92031900%'
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND es.iot_code IS NOT NULL
GROUP BY
es.id ) a
UNION ALL
SELECT
a.`name`, IFNULL( a.nowLevel, '--' ) AS nowLevel, a.id, IFNULL( a.image, '' ) AS image, 'M' AS unit, a.minLevel AS minLevel, a.maxLevel AS maxLevel, (
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN '--'
WHEN a.minLevel - a.nowLevel > 0 THEN '缺水'
ELSE '正常'
END ) AS levelStatus, a.type AS type
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
WHERE
r.resource_type = 'waterTank'
AND r.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND r.is_delete = 1
GROUP BY
r.sequence_nbr
) a
ORDER BY
levelStatus DESC
(
SELECT
r.`name`, IFNULL( rp.min_water_level, 0 ) AS minLevel, IFNULL( rp.max_water_level, 0 ) AS maxLevel, (
SELECT
FORMAT( avg( IFNULL( ei.`value`, 0 ) ), 2 )
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, ec.image, r.resource_type AS type, r.sequence_nbr AS id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON
rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON
ec.id = r.equip_category_id
WHERE
r.resource_type = 'waterTank'
AND r.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND r.is_delete = 1
GROUP BY
r.sequence_nbr ) a
ORDER BY
levelStatus DESC ) as b order by status asc
</select>
<select id="getPipeNetworkBySuper" resultType="java.util.Map">
......
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