预警信息
This commit is contained in:
parent
2148619314
commit
d214b89b56
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.base.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
|
@ -44,6 +45,30 @@ public class TbProPower implements Serializable {
|
|||
@Size(max = 50,message = "杆塔纬度最大长度要小于 50")
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 感知设备类型数
|
||||
*/
|
||||
@ApiModelProperty(value="感知设备类型数")
|
||||
private Integer devTypeNum;
|
||||
|
||||
/**
|
||||
* 感知设备数量
|
||||
*/
|
||||
@ApiModelProperty(value="感知设备数量")
|
||||
private Integer devNum;
|
||||
|
||||
/**
|
||||
* 设备正常数量
|
||||
*/
|
||||
@ApiModelProperty(value="设备正常数量")
|
||||
private Integer successNum;
|
||||
|
||||
/**
|
||||
* 设备异常数量
|
||||
*/
|
||||
@ApiModelProperty(value="设备异常数量")
|
||||
private Integer errorNum;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -145,15 +145,15 @@ public class ProjectViewTwoController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工程id获取大屏首页地图工程信息
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getProjectAndDeviceById")
|
||||
public AjaxResult getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||
return success(projectViewService.getProjectAndDeviceById(record));
|
||||
}
|
||||
// /**
|
||||
// * 根据工程id获取大屏首页地图工程信息
|
||||
// * @param record
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/getProjectAndDeviceById")
|
||||
// public AjaxResult getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||
// return success(projectViewService.getProjectAndDeviceById(record));
|
||||
// }
|
||||
|
||||
|
||||
// /**
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ public class ProjectViewServiceImpl {
|
|||
if (CollectionUtils.isNotEmpty(powerList)) {
|
||||
record.setProPowerList(powerList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -272,11 +273,11 @@ public class ProjectViewServiceImpl {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据工程id获取大屏首页地图工程信息
|
||||
* @return
|
||||
*/
|
||||
public DeviceNumByProjectVo getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||
return deviceNumByProjectMapper.getProjectAndDeviceById(record);
|
||||
}
|
||||
// /**
|
||||
// * 根据工程id获取大屏首页地图工程信息
|
||||
// * @return
|
||||
// */
|
||||
// public DeviceNumByProjectVo getProjectAndDeviceById(DeviceNumByProjectVo record) {
|
||||
// return deviceNumByProjectMapper.getProjectAndDeviceById(record);
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,30 @@ public class ProjectAreaGroupVo implements Serializable {
|
|||
*/
|
||||
private String proStatus;
|
||||
|
||||
/**
|
||||
* 感知设备类型数
|
||||
*/
|
||||
@ApiModelProperty(value="感知设备类型数")
|
||||
private Integer devTypeNum;
|
||||
|
||||
/**
|
||||
* 感知设备数量
|
||||
*/
|
||||
@ApiModelProperty(value="感知设备数量")
|
||||
private Integer devNum;
|
||||
|
||||
/**
|
||||
* 设备正常数量
|
||||
*/
|
||||
@ApiModelProperty(value="设备正常数量")
|
||||
private Integer successNum;
|
||||
|
||||
/**
|
||||
* 设备异常数量
|
||||
*/
|
||||
@ApiModelProperty(value="设备异常数量")
|
||||
private Integer errorNum;
|
||||
|
||||
/**
|
||||
* 杆塔信息集合
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -198,34 +198,48 @@
|
|||
|
||||
<select id="getProjectListGroupAreaByTypeCode" resultType="com.bonus.screen.vo.ProjectAreaGroupVo">
|
||||
SELECT
|
||||
a.id AS areaId,
|
||||
a.area_name as areaName,
|
||||
p.id AS projectId,
|
||||
p.pro_name AS projectName,
|
||||
p.lon,p.lat
|
||||
a.id AS areaId,
|
||||
a.area_name as areaName,
|
||||
tp.id AS projectId,
|
||||
tp.pro_name AS projectName,
|
||||
tp.lon,tp.lat,
|
||||
count(distinct td.dev_type) as devTypeNum,
|
||||
count(td.id) as devNum,
|
||||
count(case when td.dev_warn = 0 then 1 end) as successNum,
|
||||
count(case when td.dev_warn = 1 then 1 end) as errorNum
|
||||
FROM
|
||||
tb_project p
|
||||
tb_project tp
|
||||
LEFT JOIN
|
||||
tb_area a ON a.id = p.area_id
|
||||
tb_area a ON a.id = tp.area_id
|
||||
left join tb_bd_device_record tbdr on tp.id = tbdr.pro_id
|
||||
left join tb_device td on tbdr.record_id = td.bd_id and td.dev_status = 0 and td.del_flag = 0
|
||||
<where>
|
||||
p.del_flag = 0
|
||||
tp.del_flag = 0
|
||||
<if test="projectTypeCode != null">
|
||||
and p.pro_type = #{projectTypeCode}
|
||||
and tp.pro_type = #{projectTypeCode}
|
||||
</if>
|
||||
<if test="areaId != null">
|
||||
and p.area_id = #{areaId}
|
||||
and tp.area_id = #{areaId}
|
||||
</if>
|
||||
</where>
|
||||
group by tp.id
|
||||
</select>
|
||||
<select id="getProPowerListByProId" resultType="com.bonus.base.domain.TbProPower">
|
||||
select id as id,
|
||||
pro_id as proId,
|
||||
gt_name as gtName,
|
||||
lon as lon,
|
||||
lat as lat
|
||||
from tb_pro_power
|
||||
where pro_id = #{proId}
|
||||
and del_flag = 0
|
||||
select
|
||||
tpp.id as id,
|
||||
tpp.pro_id as proId,
|
||||
tpp.gt_name as gtName,
|
||||
tpp.lon as lon,
|
||||
tpp.lat as lat,
|
||||
count(distinct td.dev_type) as devTypeNum,
|
||||
count(td.id) as devNum,
|
||||
count(case when td.dev_warn = 0 then 1 end) as successNum,
|
||||
count(case when td.dev_warn = 1 then 1 end) as errorNum
|
||||
from tb_pro_power tpp
|
||||
left join tb_bd_device_record tbdr on tpp.id = tbdr.power_id
|
||||
left join tb_device td on tbdr.record_id = td.bd_id and td.dev_status = 0 and td.del_flag = 0
|
||||
where tpp.pro_id = #{proId}
|
||||
and tpp.del_flag = 0
|
||||
</select>
|
||||
<select id="getList" resultType="java.lang.Integer">
|
||||
select count(1) from tb_team where del_flag = 0 and pro_id = #{id}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@
|
|||
LEFT JOIN tb_bd_device_record tbdr ON td.dev_code = tbdr.dev_code
|
||||
LEFT JOIN tb_project tp ON tbdr.pro_id = tp.id
|
||||
WHERE tddr.is_warn = 1
|
||||
<if test="devTypeCode != null and devTypeCode != ''">
|
||||
and td.dev_type = #{devTypeCode}
|
||||
</if>
|
||||
<if test="proName != null and proName != ''">
|
||||
and tp.pro_name like concat('%',#{proName},'%')
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue