feat:首页接口提供,2-告警数量,7-风险预警分布

This commit is contained in:
LiWeiJie 2024-09-02 16:05:39 +08:00
parent 5fa519e54c
commit 34fa234c60
6 changed files with 60 additions and 2 deletions

View File

@ -101,4 +101,24 @@ public class WlsbEarlyWarningInformationController extends BaseController
{ {
return toAjax(wlsbEarlyWarningInformationService.deleteWlsbEarlyWarningInformationByIds(ids)); 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());
}
} }

View File

@ -2,6 +2,7 @@ package com.god.wlsbforewarning.mapper;
import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation; import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 预警信息Mapper接口 * 预警信息Mapper接口
@ -58,4 +59,8 @@ public interface WlsbEarlyWarningInformationMapper
* @return 结果 * @return 结果
*/ */
public int deleteWlsbEarlyWarningInformationByIds(String[] ids); public int deleteWlsbEarlyWarningInformationByIds(String[] ids);
List<Map<String, String>> getRiskdistributionCount();
String getAlarmsCount();
} }

View File

@ -2,6 +2,7 @@ package com.god.wlsbforewarning.service;
import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation; import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 预警信息Service接口 * 预警信息Service接口
@ -58,4 +59,8 @@ public interface IWlsbEarlyWarningInformationService
* @return 结果 * @return 结果
*/ */
public int deleteWlsbEarlyWarningInformationById(String id); public int deleteWlsbEarlyWarningInformationById(String id);
List<Map<String,String>> getRiskdistributionCount();
String getAlarmsCount();
} }

View File

@ -5,6 +5,7 @@ import com.god.wlsbforewarning.domain.WlsbEarlyWarningInformation;
import com.god.wlsbforewarning.mapper.WlsbEarlyWarningInformationMapper; import com.god.wlsbforewarning.mapper.WlsbEarlyWarningInformationMapper;
import com.god.wlsbforewarning.service.IWlsbEarlyWarningInformationService; import com.god.wlsbforewarning.service.IWlsbEarlyWarningInformationService;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -92,4 +93,14 @@ public class WlsbEarlyWarningInformationServiceImpl implements IWlsbEarlyWarning
{ {
return wlsbEarlyWarningInformationMapper.deleteWlsbEarlyWarningInformationById(id); return wlsbEarlyWarningInformationMapper.deleteWlsbEarlyWarningInformationById(id);
} }
@Override
public List<Map<String, String>> getRiskdistributionCount() {
return wlsbEarlyWarningInformationMapper.getRiskdistributionCount();
}
@Override
public String getAlarmsCount() {
return wlsbEarlyWarningInformationMapper.getAlarmsCount();
}
} }

View File

@ -110,4 +110,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </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> </mapper>

View File

@ -205,10 +205,10 @@
<!-- <el-form-item label="设备ID" prop="deviceId"> <!-- <el-form-item label="设备ID" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备ID" /> <el-input v-model="form.deviceId" placeholder="请输入设备ID" />
</el-form-item> --> </el-form-item> -->
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName" >
<el-input v-model="form.deviceName" placeholder="请输入设备名称" /> <el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item> </el-form-item>
<el-form-item label="时间" prop="time" > <el-form-item label="时间" prop="time" style="width:100%;">
<el-date-picker clearable <el-date-picker clearable
v-model="form.time" v-model="form.time"
type="datetime" type="datetime"