Commit c5fb067f authored by KeYong's avatar KeYong

Merge branch 'dev_upgrade' of 172.16.10.76:station/YeeAmosFireAutoSysRoot into eqintegration

parents cb670134 342440f5
......@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentParam;
import com.yeejoin.amos.fas.business.vo.EquipCommunicationData;
import com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
......@@ -55,6 +57,8 @@ public interface FireEquipMapper extends BaseMapper {
List<Map> queryForGroupCount(@Param("fireStationId") Long fireStationId);
List<Map> queryStorageEquips(@Param("riskSourceId") Long riskSourceId);
EquipDetailsResponse findEquipDetailsById(@Param("id") Long id);
......@@ -85,4 +89,6 @@ public interface FireEquipMapper extends BaseMapper {
FireEquipment findFireEquipById (@Param("id") Long id);
FireEquipment findVideoById (@Param("id") Long id);
FireStation findFireStationById(@Param("id") Long id);
}
......@@ -147,25 +147,25 @@ public class FireEquipServiceImpl implements IFireEquipService {
switch (fireEquipmentType)
{
case pool:
case hydrant:
Optional<WaterResource> waterResource = this.iWaterResourceDao.findById(id);
if(waterResource.isPresent()){
returnEntity = waterResource.get();
}
break;
FireStation fireStation = fireEquipMapper.findFireStationById(id);
fireStation.setType("2");
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation;
break;
case fireFoamRoom:
FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
fireStation1.setType("2");
fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation1;
break;
case fireChamber:
Optional<FireStation> fireStation1 = iFireStationDao.findById(id);
FireStation fireStation=null;
if(fireStation1.isPresent()){
fireStation=fireStation1.get();
}
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryForGroupCount(id));
returnEntity = fireStation;
FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
fireStation11.setType("1");
fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation11;
break;
case extinguisher:
case hydrant:
case monitorEquipment:
FireEquipment fireEquipment=fireEquipMapper.findFireEquipById(id);
fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode()));
......
......@@ -134,10 +134,6 @@ public class View3dServiceImpl implements IView3dService {
@Autowired
private RemoteSecurityService remoteSecurityService;
@Value("${station.equipment.code}")
private String equipmentCode;
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......
......@@ -75,13 +75,23 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt
#查询装备分类
#消防视频:xfsp
#消防车:2101
#灭火器:3104
#消火栓:3105
#探测器:8501
data.type.fireChamber=2101
#消防小室:9301
data.type.fireChamber=9301
#消防水池:9302
data.type.pool=9302
#消防泡沫间:9305
#消防视频:xfsp
station.equipment.code=2101,3104,3105,8501,9301,9302,9305,xfsp
data.type.fireFoamRoom=9305
#探测器:8501
data.type.monitorEquipment=8501
#灭火器:3104
data.type.extinguisher=3104
#消火栓:3105
data.type.hydrant=3105
......@@ -286,6 +286,24 @@
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="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">
SELECT
......@@ -583,4 +601,16 @@
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
FROM
wl_building wb
WHERE
wb.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -27,7 +27,7 @@
order by rs.id desc
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
......@@ -172,7 +172,7 @@
GROUP BY
ff1.risk_source_id;
</select>
<resultMap id="riskSourceMap" type="com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
......@@ -191,7 +191,7 @@
<result property="omission" column="omission" />
<result property="unplan" column="unplan" />
</resultMap>
<select id="getRiskSources" resultMap="riskSourceMap">
SELECT
rs.id,
......@@ -213,9 +213,9 @@
where rs.org_code = #{compCode}
ORDER BY rs.sort_num,rs.id ASC
</select>
<select id="getRiskSourcesEquipment" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
a.`name`,
......@@ -240,10 +240,10 @@
a.`name`,
a.position3d,
a.parent_id,
a.id
a.id
</select>
<select id="getCheckPointRiskSource" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
......@@ -280,9 +280,9 @@
a.parent_id,
a.id
</select>
<select id="getRiskSourcesFireEquipmentByType" resultMap="riskSourceMap">
SELECT
sum(a.cc) ccount,
......@@ -338,13 +338,13 @@
FROM
`f_risk_source_point_inputitem` rspi
LEFT JOIN p_point pp ON pp.id = rspi.point_id
LEFT JOIN p_input_item pii ON pii.id = rspi.point_inputitem_id
LEFT JOIN p_input_item pii ON pii.id = rspi.point_inputitem_id
WHERE pii.`name` is not NULL
AND rspi.risk_source_id = #{riskSourceId}
GROUP BY riskId,pointId,pointNo,pointName,depName,username,telephone
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
......@@ -540,7 +540,7 @@
</select>
<select id="queryForUnqualified" resultType="map">
SELECT
(
SELECT
......@@ -564,11 +564,11 @@
LEFT JOIN f_fmea fm ON fm.id = pi.fmea_id
WHERE
pi.`state` = 1
AND fm.risk_source_id = #{riskSourceId};
AND fm.risk_source_id = #{riskSourceId};
</select>
<select id="queryForFmeaEquipAlarm" resultType="map">
SELECT
ed.`name` as 'fireEquipmentName',
ei.`name` as 'name'
......@@ -584,15 +584,15 @@
AND fm.risk_source_id = #{riskSourceId}
GROUP BY fireEquipmentName,name
</select>
<select id="queryRiskAreaRpn" resultType="java.util.HashMap">
SELECT
rs.id,
rs.name,
rs.rpn,
rs.rpni,
rs.name,
rs.rpn,
rs.rpni,
rs.risk_level_id as riskLevelId,
rl.`name` as riskLevelName,
rl.`name` as riskLevelName,
rl.level,
rl.color
FROM
......@@ -601,20 +601,20 @@
WHERE rs.parent_id &gt; 0
order by rs.sort_num,rs.id
</select>
<select id="queryRiskSourceSecondLevel" resultType="java.util.HashMap">
SELECT
rs.id,
rs.name,
rs.rpn,
rs.rpni,
rs.name,
rs.rpn,
rs.rpni,
rs.risk_level_id as riskLevelId,
rl.`name` as riskLevelName,
rl.`name` as riskLevelName,
rl.level,
rl.color
FROM
`f_risk_source` rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE
rs.parent_id = (
SELECT
......@@ -642,12 +642,12 @@
rf.id = ${factorId}
)
</select>
<select id="queryContingencyWater" resultType="java.util.HashMap">
<!-- SELECT
<!--SELECT
wr.alarm_level,
wr.max_level,
wr.area,
......@@ -664,7 +664,31 @@
wr.alarm_level,
wr.max_level,
wr.area,
wr.`name` -->
wr.`name`-->
SELECT
*
FROM
(
SELECT
building.height AS alarm_level,
building.warn_height AS max_level,
building.area_measure AS area,
building.CODE AS CODE,
building.NAME AS NAME,
3.6 AS
VALUE
FROM
wl_building building
LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id
WHERE
category.CODE = 93020000
) wr
GROUP BY
wr.alarm_level,
wr.max_level,
wr.area,
wr.`name`
</select>
......@@ -728,7 +752,7 @@
</set>
where id = #{id}
</update>
<select id="getRegionList" parameterType="string" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">
select
rs.id,rs.name,rs.code,rs.parent_id,rs.ue4_location,rs.ue4_rotation,rs.ue4_extent,
......@@ -737,7 +761,7 @@
IF(ISNULL(rs.route_path) || LENGTH(trim(rs.route_path)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
IF(ISNULL(IF(replace(trim(rs.ue4_rotation),'[]','')='',NULL,rs.ue4_rotation))
AND ISNULL(IF(replace(trim(rs.ue4_location),'[]','')='',NULL,rs.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
......@@ -750,7 +774,7 @@
left join f_risk_level rl ON rs.risk_level_id = rl.id
where is_region = 'TRUE' AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode},'-%'))
</select>
<select id="findRegionById" resultType="java.util.HashMap">
select
id,name,code,parent_id as parentId,ue4_location as ue4Location,ue4_rotation as ue4Rotation,ue4_extent as ue4Extent,route_path as routePath,
......@@ -759,7 +783,7 @@
IF(ISNULL(route_path) || LENGTH(trim(route_path)) <![CDATA[ <]]> 1,0,1) as isBind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,ue4_location)),0,1) as isBind,
</otherwise>
</choose>
......@@ -768,7 +792,7 @@
from f_risk_source r
where id=#{id} AND (org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%'))
</select>
<update id="batchSaveRegionUe4" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update f_risk_source
......
......@@ -1466,7 +1466,7 @@
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_id
where substr(cat.code ,1,4) = 8501
where substr(cat.code ,1,4) = '8501'
group By m.code
<if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName}
......@@ -1544,7 +1544,7 @@
left join wl_equipment_category as cat on equ.category_id = cat.id
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
where substr(cat.code ,1,4)= 3105
where substr(cat.code ,1,4)= '3105'
UNION all
select concat('pool-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation,'pool' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode,
......@@ -1647,7 +1647,7 @@
left join wl_equipment_category as cat on equ.category_id = cat.id
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
where substr(cat.code ,1,4) = 3104
where substr(cat.code ,1,4) = '3104'
UNION all
select concat('fireChamber-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireChamber' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
......@@ -1713,7 +1713,7 @@
bu.region_id as riskSourceId
from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9301
where substr(cat.code ,1,4) = '9301'
) as tmp
<where>
<if test="inputText!=null and inputText != ''" >
......
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