Commit d4b32d10 authored by 高建强's avatar 高建强

item:三维告警信息初始化、消防水池信息接口提供

parent 0d5d5664
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.*;
import java.util.List;
import java.util.Map;
import javax.persistence.*;
/**
* 消防站点
* @author Administrator
......@@ -92,6 +91,29 @@ public class FireStation extends BasicEntity{
@Lob
private String ue4Rotation;
/**
* 高度/最大液位(m)
*/
@Transient
private Double height;
/**
* 低度/最小液位(m)
*/
@Transient
private Double low;
/**
* 实时液位(m)
*/
@Transient
private String level;
/**
* 设计容量(m³)
*/
@Transient
private Double designCapacity;
@Transient
public List<Map> getFireEquipmentInfo() {
return fireEquipmentInfo;
......@@ -206,4 +228,36 @@ public class FireStation extends BasicEntity{
public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation;
}
public Double getHeight() {
return height;
}
public void setHeight(Double height) {
this.height = height;
}
public Double getLow() {
return low;
}
public void setLow(Double low) {
this.low = low;
}
public Double getDesignCapacity() {
return designCapacity;
}
public void setDesignCapacity(Double designCapacity) {
this.designCapacity = designCapacity;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
}
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.controller
* @ClassName: EquipmentSpecificIndexController
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexController
* @Date: 2021/1/18 16:32
* @Version: 1.0
*/
@RestController
@RequestMapping(value = "/api/equipSpecificIndex")
@Api(tags = "装备性能指标Api")
public class EquipmentSpecificIndexController extends BaseController {
@Autowired
private EquipmentSpecificIndexService equipmentSpecificIndexService;
@Permission
@ApiOperation(httpMethod = "GET", value = "获取最新告警状态", notes = "获取最新告警状态")
@RequestMapping(value = "/queryInitAlarm", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryInitAlerm(@ApiParam(value = "告警状态", required = true) @RequestParam String status,
@ApiParam(value = "多nameKey,中间英文逗号隔开", required = true) @RequestParam String nameKeys,
@ApiParam(value = "多status,中间英文逗号隔开", required = true) @RequestParam String pollStatus) {
return CommonResponseUtil.success(equipmentSpecificIndexService.queryInitAlarm(status, nameKeys, pollStatus));
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 装备性能指标 Mapper 接口
*
* @author Jianqiang Gao
* @date 2021-01-18
*/
public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecificIndexVo> {
List<EquipmentSpecificIndexVo> findByDetailIdInAndNameKey(@Param("list") List<Object> equipDetailIdList, @Param("nameKey") String nameKey);
List<EquipmentSpecificIndexVo> queryInitAlarm(@Param("status") String status, @Param("list") String[] nameKeys);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.dao.mapper
* @ClassName: PollPointMapper
* @Author: Jianqiang Gao
* @Description: 巡检点Mapper
* @Date: 2021/1/18 17:36
* @Version: 1.0
*/
public interface PollPointMapper extends BaseMapper<PollPointVo> {
List<PollPointVo> queryInitAlarm(@Param("list") String[] pollStatus);
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.impl
* @ClassName: EquipmentSpecificIndexServiceImpl
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexServiceImpl
* @Date: 2021/1/18 16:35
* @Version: 1.0
*/
@Service
public class EquipmentSpecificIndexServiceImpl implements EquipmentSpecificIndexService {
@Autowired
private EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private PollPointMapper pollPointMapper;
@Override
public Map<String, Object> queryInitAlarm(String status, String nameKeys, String pollStatus) {
Map<String, Object> map = new HashMap<>(16);
// 查询设备告警
List<EquipmentSpecificIndexVo> equipmentSpecificAlarmVoList = equipmentSpecificIndexMapper.queryInitAlarm(status, nameKeys.split(","));
map.put("equip", equipmentSpecificAlarmVoList);
// 查询巡检告警
List<PollPointVo> pollPointVoList = pollPointMapper.queryInitAlarm(pollStatus.split(","));
map.put("poll", pollPointVoList);
return map;
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.Map;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.intfc
* @ClassName: EquipmentSpecificIndexService
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexService
* @Date: 2021/1/18 16:34
* @Version: 1.0
*/
public interface EquipmentSpecificIndexService {
Map<String, Object> queryInitAlarm(String status, String nameKeys, String pollStatus);
}
\ No newline at end of file
......@@ -24,7 +24,9 @@ public class EquipmentSpecificIndexVo {
// 性能指标id
private Long equipmentIndexId;
private String name;
private String equipmentIndexName;
private String equipmentIndexUnitName;
......@@ -105,16 +107,45 @@ public class EquipmentSpecificIndexVo {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEquipmentIndexName() {
return equipmentIndexName;
}
public void setEquipmentIndexName(String equipmentIndexName) {
this.equipmentIndexName = equipmentIndexName;
}
public String getEquipmentIndexUnitName() {
return equipmentIndexUnitName;
}
public void setEquipmentIndexUnitName(String equipmentIndexUnitName) {
this.equipmentIndexUnitName = equipmentIndexUnitName;
}
public EquipmentSpecificIndexVo() {
}
public EquipmentSpecificIndexVo(Long equipmentSpecificId, String value, Long equipmentIndexId, String nameKey, String code, String iotCode, String type) {
public EquipmentSpecificIndexVo(long id, Long equipmentSpecificId, String value, Long equipmentIndexId, String name, String equipmentIndexName, String equipmentIndexUnitName, String nameKey, String code, String iotCode, String type) {
this.id = id;
this.equipmentSpecificId = equipmentSpecificId;
this.value = value;
this.equipmentIndexId = equipmentIndexId;
this.name = name;
this.equipmentIndexName = equipmentIndexName;
this.equipmentIndexUnitName = equipmentIndexUnitName;
this.nameKey = nameKey;
this.code = code;
this.iotCode = iotCode;
this.type = type;
}
}
package com.yeejoin.amos.fas.business.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.vo
* @ClassName: EquipmentSpecificAlarm
* @Author: Jianqiang Gao
* @Description: 巡检点Vo
* @Date: 2021/1/18 15:54
* @Version: 1.0
*/
@Data
@Api("巡检点Vo")
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
public class PollPointVo {
@ApiModelProperty("巡检点名称")
private String name;
@ApiModelProperty("巡检点编码")
private String code;
@ApiModelProperty("巡检点状态:0 未纳入巡检,1 合格;2 不合格;3 漏检")
private String status;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper">
<select id="findByDetailIdInAndNameKey"
resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
wsi.`value`
FROM
`wl_equipment_index` wei
RIGHT JOIN wl_equipment_specific_index wsi ON wei.id = wsi.equipment_index_id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
WHERE
wsi.`value` != ''
<if test="nameKey != null and nameKey !=''">
AND wei.name_key = #{nameKey}
</if>
<if test="list != null and list.size() > 0">
AND wes.equipment_detail_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
wsi.id
ORDER BY
wsi.update_date DESC
</select>
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
wed.`name`,
wed.`code`,
wei.name_key
FROM
`wl_equipment_specific_index` wsi
LEFT JOIN wl_equipment_index wei ON wsi.equipment_index_id = wei.id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
<where>
<if test="status != null and status != ''">
AND wsi.`value` = #{status}
</if>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wei.name_key = #{item}
</foreach>
</if>
</where>
GROUP BY
wsi.equipment_specific_id
ORDER BY
wsi.update_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -158,8 +158,8 @@
FROM
(
SELECT
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eq_point_name,
CASE ind.value WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
......@@ -178,10 +178,10 @@
ind.update_date as create_date
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.qr_code = spe.qr_code
left join wl_stock_detail as sto on sto.qr_code = spe.qr_code
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
left join f_risk_source as sce on str.source_id = sce.id
) d
......@@ -221,16 +221,16 @@
<!-- 筛选未绑定的配套设施
-->
<if test="bindStation != null and bindStation == 'false'">
AND (select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) is not true
AND (select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) is not true
</if>
</select>
<select id="queryForEquipmentPage" resultType="map">
select * from (
select
select
fe.*, (
SELECT
'YES'
......@@ -241,28 +241,28 @@
) isBind,
frs.name riskSourceName,
(select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) as bindStation
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) as bindStation
from f_fire_equipment fe
left join f_risk_source frs on frs.id = fe.risk_source_id
where 1=1) tmp
where 1=1) tmp
<where>
<if test="equipClassify!=null">
and tmp.equip_classify in ( ${equipClassify} )
</if>
<if test="equipClassify!=null">
and tmp.equip_classify in ( ${equipClassify} )
</if>
<if test="code!=null">
and tmp.`code` like '%${code}%'
</if>
<if test="name!=null">
and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')
</if>
<!-- 筛选未绑定的配套设施
-->
<if test="bindStation != null and bindStation == 'false'">
AND tmp.bindStation is not true
</if>
<if test="code!=null">
and tmp.`code` like '%${code}%'
</if>
<if test="name!=null">
and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')
</if>
<!-- 筛选未绑定的配套设施
-->
<if test="bindStation != null and bindStation == 'false'">
AND tmp.bindStation is not true
</if>
</where>
LIMIT ${start},${length}
</select>
......@@ -286,24 +286,28 @@
AND se.fire_equipment_id = fe.id
)
</select>
<select id="queryStorageEquips" resultType="map">
SELECT
wed.`name`,
u.`name` AS unit,
sum(wsd.amount) fireEquipmentCount
FROM
wl_stock_detail wsd
LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
WHERE
ws.source_id = #{riskSourceId}
GROUP BY
wsd.equipment_detail_id,
wed.`name`
</select>
<select id="queryStorageEquips" resultType="map">
SELECT
wed.id,
wed.`name`,
u.`name` AS unit,
sum(wsd.amount) fireEquipmentCount
FROM
wl_stock_detail wsd
LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
<where>
<if test="riskSourceId != null">
AND ws.source_id = #{riskSourceId}
</if>
</where>
GROUP BY
wsd.equipment_detail_id,
wed.`name`
</select>
<select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">
SELECT
......@@ -316,7 +320,7 @@
f_equipment eq
LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id
<where>
<if test="id!=null">AND eq.id = #{id}</if>
<if test="id!=null">AND eq.id = #{id}</if>
</where>
</select>
......@@ -339,26 +343,26 @@
</select>
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select
id,
code,
name
from
f_fire_equipment
where
code in
select
id,
code,
name
from
f_fire_equipment
where
code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</select>
<select id="listByType" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select
id,
code,
name
id,
code,
name
from
f_fire_equipment
f_fire_equipment
<where>
<if test="type!=null">
equip_classify = #{type}
......@@ -371,26 +375,26 @@
useGeneratedKeys="true">
insert into f_fire_equipment
(
org_code,
code,
equip_classify,
equip_type,
position3d,
floor3d,
is_indoor,
name,
maintenance_cycle,
manufacturer,
number,
unit,
room,
equip_status,
weight,
risk_source_id
org_code,
code,
equip_classify,
equip_type,
position3d,
floor3d,
is_indoor,
name,
maintenance_cycle,
manufacturer,
number,
unit,
room,
equip_status,
weight,
risk_source_id
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
(
#{item.orgCode},
#{item.code},
#{item.equipClassify},
......@@ -407,7 +411,7 @@
#{item.equipStatus},
#{item.weight},
#{item.riskSourceId}
)
)
</foreach>
</insert>
......@@ -505,7 +509,7 @@
select name from f_fire_equipment where id= #{id}
</select>
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
DELETE fmep FROM `f_fmea_equipment_point` fmep
LEFT JOIN wl_equipment_specific_index esi ON esi.id = fmep.equipment_point_id
WHERE esi.equipment_specific_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
......@@ -594,20 +598,23 @@
ffe.video_id = video.id
) protectObjNames
FROM wl_video video
LEFT JOIN wl_video_source source ON source.video_id =video.id
LEFT JOIN wl_video_source source ON source.video_id =video.id
LEFT JOIN f_risk_source risk ON risk.id = source.source_id
WHERE
<if test="id != null">
video.id = #{id}
</if>
</select>
<select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">
SELECT
wb.`name`,
wb.`code`,
wb.address,
wb.region_id AS riskSourceId
wb.region_id AS riskSourceId,
wb.height,
wb.low,
wb.design_capacity
FROM
wl_building wb
WHERE
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper">
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.PollPointVo">
SELECT
p.`name`,
p.point_no AS `code`,
p.`status`
FROM
`p_point` p
<where>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
p.`status` = #{item}
</foreach>
</if>
</where>
</select>
</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