Commit 2729c332 authored by lisong's avatar lisong

添加站端双月报数据源查询接口

parent 2d311b0b
...@@ -320,4 +320,35 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -320,4 +320,35 @@ public class EquipmentAlarmController extends AbstractBaseController {
return CommonResponseUtil.success(map); return CommonResponseUtil.success(map);
} }
@RequestMapping(value = "/fireFacilitiesList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "数字换流站根据code获取装备详情", produces = "application/json;charset=UTF-8", notes = "数字换流站根据id获取装备详情")
public ResponseModel fireFacilitiesList(@RequestParam(value = "bizOrgCode") String bizOrgCode,
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "endTime") String endTime) {
List<Map<String, Object>> list = iEquipmentSpecificAlarmService.fireFacilitiesList(bizOrgCode, startTime, endTime);
return CommonResponseUtil.success(list);
}
@RequestMapping(value = "/dailyMaintenance", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站端双月报装备统计故障告警信息", produces = "application/json;charset=UTF-8", notes = "数字换流站根据id获取装备详情")
public ResponseModel dailyMaintenance(@RequestParam(value = "bizOrgCode") String bizOrgCode,
@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "orgCode") String orgCode,
@RequestParam(value = "endTime") String endTime) {
Map<String, Object> map = iEquipmentSpecificAlarmService.dailyMaintenance(bizOrgCode, orgCode, startTime, endTime);
return CommonResponseUtil.success(map);
}
@RequestMapping(value = "/inspectionMessage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站端双月报巡检信息", produces = "application/json;charset=UTF-8", notes = "数字换流站根据id获取装备详情")
public ResponseModel inspectionMessage(@RequestParam(value = "startTime") String startTime,
@RequestParam(value = "orgCode") String orgCode,
@RequestParam(value = "endTime") String endTime) {
Map<String, Object> map = iEquipmentSpecificAlarmService.inspectionMessage(orgCode, startTime, endTime);
return CommonResponseUtil.success(map);
}
} }
...@@ -207,4 +207,16 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -207,4 +207,16 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
* @return * @return
*/ */
List<EquipAlarmLineVo> equipAlarmLine(HashMap<String, Object> hashMap); List<EquipAlarmLineVo> equipAlarmLine(HashMap<String, Object> hashMap);
List<Map<String, Object>> fireFacilitiesList(@Param("bizOrgCode") String bizOrgCode
, @Param("startTime") String startTime
, @Param("endTime") String endTime);
Map<String, Object> dailyMaintenance(@Param("bizOrgCode") String bizOrgCode
, @Param("orgCode") String orgCode, @Param("startTime") String startTime
, @Param("endTime") String endTime);
Map<String, Object> inspectionMessage(@Param("orgCode") String orgCode
, @Param("startTime") String startTime
, @Param("endTime") String endTime);
} }
...@@ -87,4 +87,8 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -87,4 +87,8 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
LinkedList<Map<String, Object>> equipStatusCount(HashMap<String, Object> hashMap); LinkedList<Map<String, Object>> equipStatusCount(HashMap<String, Object> hashMap);
Map<String, Object> equipAlarmLine(HashMap<java.lang.String,java.lang.Object> hashMap); Map<String, Object> equipAlarmLine(HashMap<java.lang.String,java.lang.Object> hashMap);
List<Map<String, Object>> fireFacilitiesList(String bizOrgCode, String startTime, String endTime);
Map<String, Object> dailyMaintenance(String bizOrgCode,String orgCode, String startTime, String endTime);
Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime);
} }
...@@ -714,4 +714,18 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -714,4 +714,18 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
return resultMap; return resultMap;
} }
@Override
public List<Map<String, Object>> fireFacilitiesList(String bizOrgCode, String startTime, String endTime) {
return equipmentSpecificAlarmMapper.fireFacilitiesList(bizOrgCode, startTime, endTime);
}
@Override
public Map<String, Object> dailyMaintenance(String bizOrgCode, String orgCode, String startTime, String endTime) {
return equipmentSpecificAlarmMapper.dailyMaintenance(bizOrgCode, orgCode, startTime, endTime);
}
@Override
public Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime) {
return equipmentSpecificAlarmMapper.inspectionMessage(orgCode, startTime, endTime);
}
} }
...@@ -1240,4 +1240,73 @@ ...@@ -1240,4 +1240,73 @@
ORDER BY ORDER BY
s.date DESC s.date DESC
</select> </select>
<select id="fireFacilitiesList" resultType="java.util.Map">
SELECT temp.id,temp.name,IFNULL(temp1.notReturned,0) AS notReturned ,IFNULL(temp2.returned,0) AS returned ,
CASE
WHEN (temp1.notReturned > 0 ) THEN
"异常"
ELSE "正常"
END
AS `status`
FROM
(SELECT ffs.id,ffs.name FROM f_fire_fighting_system ffs
WHERE ffs.biz_org_code = #{bizOrgCode}) temp
LEFT JOIN
(SELECT esa.system_ids,COUNT(1) AS notReturned
FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN"
and esa.equipment_specific_index_value = "true"
and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp1
on
FIND_IN_SET(temp.id,temp1.system_ids)
LEFT JOIN
(SELECT esa.system_ids,COUNT(1) AS returned
FROM wl_equipment_specific_alarm esa WHERE esa.type = "BREAKDOWN"
AND esa.equipment_specific_index_value = "false"
and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp2
on
FIND_IN_SET(temp.id,temp2.system_ids)
</select>
<select id="dailyMaintenance" resultType="java.util.Map">
select
(SELECT count(1) AS total FROM wl_equipment_specific wes
WHERE wes.biz_org_code = #{bizOrgCode})AS total,
(
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime}
)AS alarmEquipNum,
(
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime} AND esa.equipment_specific_index_value = "true"
)as returned,
(
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime} AND esa.equipment_specific_index_value = "false"
)as motReturned
</select>
<select id="inspectionMessage" resultType="java.util.Map">
SELECT
(SELECT COUNT(DISTINCT(equipment_id)) FROM p_point_classify
) AS total,
(
SELECT count(DISTINCT(point_id)) FROM p_check WHERE org_code =#{orgCode}
and create_date
between #{startTime} and #{endTime}
)as pointNum,
(
SELECT count(DISTINCT(ppc.equipment_id)) FROM
(SELECT point_classify_id FROM p_check_input WHERE point_classify_id in(SELECT id FROM p_point_classify)
and is_ok = 2 and org_code = #{orgCode} and create_date
between #{startTime} and #{endTime})
pci
LEFT JOIN p_point_classify ppc on pci.point_classify_id = ppc.id
)AS unqualified,
(
SELECT COUNT(1) FROM p_point_classify
WHERE id not in(SELECT DISTINCT(point_classify_id) FROM p_check_input
WHERE org_code = #{orgCode} and create_date
between #{startTime} and #{endTime})
)AS missedCheck
</select>
</mapper> </mapper>
\ No newline at end of file
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