feat:首页接口提供,2-告警数量,7-风险预警分布
This commit is contained in:
parent
5fa519e54c
commit
34fa234c60
@ -101,4 +101,24 @@ public class WlsbEarlyWarningInformationController extends BaseController
|
||||
{
|
||||
return toAjax(wlsbEarlyWarningInformationService.deleteWlsbEarlyWarningInformationByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取风险分布数量
|
||||
* @return 数据集
|
||||
*/
|
||||
@GetMapping(value = "/get-risk-distribution-count")
|
||||
public AjaxResult getRiskdistributionCount()
|
||||
{
|
||||
return success(wlsbEarlyWarningInformationService.getRiskdistributionCount());
|
||||
}
|
||||
/**
|
||||
* 获取告警数量
|
||||
* @return 数据
|
||||
*/
|
||||
@GetMapping(value = "/get-alarms-count")
|
||||
public AjaxResult getAlarmsCount()
|
||||
{
|
||||
return success((Object) wlsbEarlyWarningInformationService.getAlarmsCount());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.god.wlsbforewarning.mapper;
|
||||
|
||||
import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 预警信息Mapper接口
|
||||
@ -58,4 +59,8 @@ public interface WlsbEarlyWarningInformationMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWlsbEarlyWarningInformationByIds(String[] ids);
|
||||
|
||||
List<Map<String, String>> getRiskdistributionCount();
|
||||
|
||||
String getAlarmsCount();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.god.wlsbforewarning.service;
|
||||
|
||||
import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 预警信息Service接口
|
||||
@ -58,4 +59,8 @@ public interface IWlsbEarlyWarningInformationService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWlsbEarlyWarningInformationById(String id);
|
||||
|
||||
List<Map<String,String>> getRiskdistributionCount();
|
||||
|
||||
String getAlarmsCount();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
|
||||
import com.god.wlsbforewarning.mapper.WlsbEarlyWarningInformationMapper;
|
||||
import com.god.wlsbforewarning.service.IWlsbEarlyWarningInformationService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -92,4 +93,14 @@ public class WlsbEarlyWarningInformationServiceImpl implements IWlsbEarlyWarning
|
||||
{
|
||||
return wlsbEarlyWarningInformationMapper.deleteWlsbEarlyWarningInformationById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getRiskdistributionCount() {
|
||||
return wlsbEarlyWarningInformationMapper.getRiskdistributionCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAlarmsCount() {
|
||||
return wlsbEarlyWarningInformationMapper.getAlarmsCount();
|
||||
}
|
||||
}
|
||||
|
@ -110,4 +110,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getRiskdistributionCount" resultType="map">
|
||||
SELECT
|
||||
CONCAT(warning_level,'风险') warningLevel,
|
||||
count(*) count
|
||||
FROM
|
||||
`wlsb_early_warning_information`
|
||||
GROUP BY
|
||||
warning_level
|
||||
</select>
|
||||
<select id="getAlarmsCount" resultType="string">
|
||||
SELECT
|
||||
count(*) count
|
||||
FROM
|
||||
`wlsb_early_warning_information`
|
||||
WHERE
|
||||
`status` = '未处理'
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -208,7 +208,7 @@
|
||||
<el-form-item label="设备名称" prop="deviceName" >
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时间" prop="time" >
|
||||
<el-form-item label="时间" prop="time" style="width:100%;">
|
||||
<el-date-picker clearable
|
||||
v-model="form.time"
|
||||
type="datetime"
|
||||
|
Loading…
Reference in New Issue
Block a user