Commit c579e363 authored by 张森's avatar 张森

炮阀API添加

parent b37161cc
......@@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -47,6 +48,18 @@ public class AlarmStatisticController extends AbstractBaseController {
return CommonResponseUtil.success(list);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("炮阀")
@GetMapping(value = "/fireCannonValve")
public ResponseModel<List<Map<String, Object>>> fireCannonValve(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return CommonResponseUtil.success(iEmergencyService.fireCannonValve(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/alarmList")
@ApiOperation(httpMethod = "GET", value = "消防告警信息", notes = "消防告警信息")
......
......@@ -121,4 +121,6 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object >> getEquipStatistic(@Param("bizOrgCode") String bizOrgCode, @Param("equipCodeKey") String equipCodeKey);
List<Map<String, Object >> getAllTypeEquipStatistic(@Param("bizOrgCode") String bizOrgCode, @Param("list") List<String> list);
List<Map<String, Object>> fireCannonValve(@Param("bizOrgCode") String bizOrgCode);
}
......@@ -89,4 +89,6 @@ public interface IEmergencyService {
List<Map<String, Object >> getEquipStatistic(String bizOrgCode, String equipCodeKey);
List<Map<String, Object >> getAllTypeEquipStatistic(String bizOrgCode);
List<Map<String, Object>> fireCannonValve(String bizOrgCode);
}
......@@ -715,4 +715,10 @@ public class EmergencyServiceImpl implements IEmergencyService {
List<String> list = EmergencyEquipTypeEnum.getCodeList();
return emergencyMapper.getAllTypeEquipStatistic(bizOrgCode, list);
}
@Override
public List<Map<String, Object>> fireCannonValve(String bizOrgCode) {
List<Map<String, Object>> list = emergencyMapper.fireCannonValve(bizOrgCode);
return Optional.ofNullable(list).orElse(org.apache.commons.compress.utils.Lists.newArrayList());
}
}
......@@ -1735,4 +1735,27 @@
AND wed.equipment_name is not null
GROUP BY `code`
</select>
<select id="fireCannonValve" resultType="java.util.Map">
SELECT
temp.name,
temp.alarm,
temp.id,
temp.code,
'--' AS value,
IFNULL((SELECT CASE WHEN wesi.`value` = 'true' THEN wesi.equipment_index_name ELSE '关到位' END FROM wl_equipment_specific_index wesi
WHERE wesi.equipment_specific_id = temp.id AND wesi.equipment_index_key = 'CAFS_GunValve_OpenToPosition' ORDER BY wesi.update_date DESC LIMIT 1),'关到位') AS stateValue
FROM
(
SELECT wes.id,wes.name,wes.code,
CASE WHEN (SELECT is_alarm FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key ) = 1
AND wes.realtime_iot_index_value = 'true' THEN
1 ELSE 0
END AS alarm
FROM wl_equipment_specific wes
WHERE
wes.equipment_code LIKE concat( '920302', '%' )
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) 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