Commit 827350b0 authored by 李秀明's avatar 李秀明

feat: 消防系统运行情况、消防告警信息接口新增参数与返回字段

parent 172ef7aa
...@@ -52,9 +52,11 @@ public class EmergencyController extends AbstractBaseController { ...@@ -52,9 +52,11 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("系统状态") @ApiOperation("系统状态")
@GetMapping(value = "/system/state") @GetMapping(value = "/system/state")
public ResponseModel getSystemState() { public ResponseModel getSystemState(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo(); if (StringUtils.isEmpty(bizOrgCode)) {
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode(); ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
}
return CommonResponseUtil.success(iEmergencyService.getSystemState(bizOrgCode)); return CommonResponseUtil.success(iEmergencyService.getSystemState(bizOrgCode));
} }
...@@ -687,7 +689,9 @@ public class EmergencyController extends AbstractBaseController { ...@@ -687,7 +689,9 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(required = false) String name, @RequestParam(required = false) String name,
@RequestParam(required = false) Integer cleanStatus, @RequestParam(required = false) Integer cleanStatus,
@RequestParam(required = false) Integer handleStatus, @RequestParam(required = false) Integer handleStatus,
@RequestParam(required = false) String bizOrgCode) { @RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String systemCode
) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize); Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (StringUtils.isEmpty(bizOrgCode)) { if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
...@@ -699,7 +703,7 @@ public class EmergencyController extends AbstractBaseController { ...@@ -699,7 +703,7 @@ public class EmergencyController extends AbstractBaseController {
} }
} }
} }
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, types, emergencyLevels, name, cleanStatus, handleStatus)); return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
...@@ -100,7 +100,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -100,7 +100,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param name 设备名称 * @param name 设备名称
* @return * @return
*/ */
Page<Map<String, Object>> alarmList(@Param("page") Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus); Page<Map<String, Object>> alarmList(@Param("page") Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus, @Param("handleStatus") Integer handleStatus);
IPage<EquipTypeImgAmountVO> getEmergencyEquipList(@Param("page") IPage page, @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage); IPage<EquipTypeImgAmountVO> getEmergencyEquipList(@Param("page") IPage page, @Param("equipTypeAmountPage") EquipTypeAmountPageDTO equipTypeAmountPage);
......
...@@ -67,7 +67,7 @@ public interface IEmergencyService { ...@@ -67,7 +67,7 @@ public interface IEmergencyService {
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode); List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode);
Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus); Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, String systemCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus);
Map<String, List<PressurePumpCountVo>> getPressurePumpDay(); Map<String, List<PressurePumpCountVo>> getPressurePumpDay();
......
...@@ -617,8 +617,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -617,8 +617,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus) { public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, String systemCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus) {
return emergencyMapper.alarmList(page, bizOrgCode, types, emergencyLevels, name, cleanStatus, handleStatus); return emergencyMapper.alarmList(page, bizOrgCode, systemCode, types, emergencyLevels, name, cleanStatus, handleStatus);
} }
//稳压泵定时向缓存中存昨日启动次数任务 //稳压泵定时向缓存中存昨日启动次数任务
......
...@@ -1301,86 +1301,65 @@ ...@@ -1301,86 +1301,65 @@
</select> </select>
<select id="alarmList" resultType="java.util.Map"> <select id="alarmList" resultType="java.util.Map">
SELECT SELECT
wlesal.id, wlesal.id,
concat( concat(wlesal.equipment_specific_name, wlesal.equipment_specific_index_name) AS alamContent,
wlesal.equipment_specific_name, IF (wlesal.confirm_type IS NULL, '未确认', '已确认') handleStatus,
wlesal.equipment_specific_index_name IF (wlesal.clean_time IS NOT NULL, '已消除', '未消除' ) cleanStatus,
) AS alamContent, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_code AS code,
IF ( wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.confirm_type IS NULL, wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
'未确认', CASE wlesal.equipment_specific_index_value
'已确认' WHEN 'true' THEN '是'
) handleStatus, WHEN 'false' THEN '否'
ELSE wlesal.equipment_specific_index_value
IF ( END AS fireEquipmentPointValue,
wlesal.clean_time IS NOT NULL, wlesal.type AS typeCode,
'已消除', (
'未消除' SELECT
) cleanStatus, type_name
wlesal.equipment_index_id AS fireEquipmentIndexId, FROM
wlesal.equipment_specific_code AS code, wl_signal_classify sc
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, WHERE
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, sc.type_code = wlesal.type
CASE wlesal.equipment_specific_index_value LIMIT 1
WHEN 'true' THEN ) AS type,
'是' wlesal.equipment_specific_name AS equipmentSpecificName,
WHEN 'false' THEN wlesal.location,
'否' date_format(wlesal.create_date, '%Y-%m-%d %H:%i:%s') createDate,
ELSE wlesal.emergency_level_describe AS emergencyLevelDescribe,
wlesal.equipment_specific_index_value fs.name AS systemName
END AS fireEquipmentPointValue,
wlesal.type AS typeCode,
(
SELECT
type_name
FROM
wl_signal_classify sc
WHERE
sc.type_code = wlesal.type
LIMIT 1
) AS type,
wlesal.equipment_specific_name AS equipmentSpecificName,
wlesal.location,
date_format(
wlesal.create_date,
'%Y-%m-%d %H:%i:%s'
) createDate,
wlesal.emergency_level_describe AS emergencyLevelDescribe
FROM FROM
wl_equipment_specific_alarm_log wlesal wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wes ON wes.id = wlesal.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = wes.system_id
<where> <where>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
and wlesal.biz_org_code like concat(#{bizOrgCode},'%') and wlesal.biz_org_code like concat(#{bizOrgCode},'%')
</if> </if>
<if test="systemCode != null and systemCode != ''">
and fs.code = #{systemCode}
</if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and wlesal.equipment_specific_name like concat('%', #{name},'%') and wlesal.equipment_specific_name like concat('%', #{name},'%')
</if> </if>
<if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 2"> <if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 2">
and wlesal.clean_time IS NULL and wlesal.clean_time IS NULL
</if> </if>
<if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 1"> <if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 1">
and wlesal.clean_time IS NOT NULL and wlesal.clean_time IS NOT NULL
</if> </if>
<if test="handleStatus != null and handleStatus != '' and handleStatus == 2"> <if test="handleStatus != null and handleStatus != '' and handleStatus == 2">
and wlesal.confirm_type IS NULL and wlesal.confirm_type IS NULL
</if> </if>
<if test="handleStatus != null and handleStatus != '' and handleStatus == 1"> <if test="handleStatus != null and handleStatus != '' and handleStatus == 1">
and wlesal.confirm_type IS NOT NULL and wlesal.confirm_type IS NOT NULL
</if> </if>
<if test="types != null"> <if test="types != null">
<foreach collection="types" index="index" item="item" open="and (" separator=" OR " close=")"> <foreach collection="types" index="index" item="item" open="and (" separator=" OR " close=")">
wlesal.type = #{item} wlesal.type = #{item}
</foreach> </foreach>
</if> </if>
<if test="emergencyLevels != null"> <if test="emergencyLevels != null">
<foreach collection="emergencyLevels" index="index" item="item" open="and (" separator=" OR " close=")"> <foreach collection="emergencyLevels" index="index" item="item" open="and (" separator=" OR " close=")">
wlesal.emergency_level = #{item} wlesal.emergency_level = #{item}
...@@ -1388,7 +1367,7 @@ ...@@ -1388,7 +1367,7 @@
</if> </if>
</where> </where>
ORDER BY ORDER BY
wlesal.create_date DESC wlesal.create_date DESC
</select> </select>
<select id="getEmergencyMaterials" resultType="java.util.Map"> <select id="getEmergencyMaterials" 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