Commit 1089fe4b authored by 高建强's avatar 高建强

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

parents 95e19c5e 66909669
...@@ -1346,6 +1346,10 @@ public class DateUtil { ...@@ -1346,6 +1346,10 @@ public class DateUtil {
int toDay = to.get(Calendar.DAY_OF_YEAR); int toDay = to.get(Calendar.DAY_OF_YEAR);
int year = toYear - fromYear; int year = toYear - fromYear;
int day = toDay - fromDay; int day = toDay - fromDay;
if(day < 0){
day +=365;
year -=1;
}
param.put("year", year); param.put("year", year);
param.put("day", day); param.put("day", day);
return param; return param;
......
...@@ -30,7 +30,7 @@ public class BubbleTipAction implements CustomerAction ...@@ -30,7 +30,7 @@ public class BubbleTipAction implements CustomerAction
//@ExposeAction("气泡提示") //@ExposeAction("气泡提示")
@RuleMethod(methodLabel = "气泡提示", project = "青海风险管控") @RuleMethod(methodLabel = "气泡提示", project = "风险管控")
public void sendBubbleTip(Object bizobj, Boolean showInfo, Object title, String type) public void sendBubbleTip(Object bizobj, Boolean showInfo, Object title, String type)
{ {
BubbleTipResult result = new BubbleTipResult(); BubbleTipResult result = new BubbleTipResult();
......
...@@ -9,7 +9,7 @@ import lombok.Data; ...@@ -9,7 +9,7 @@ import lombok.Data;
/** /**
* @author DELL * @author DELL
*/ */
@RuleFact(value = "检查项",project = "青海风险管控") @RuleFact(value = "检查项",project = "风险管控")
@Data @Data
public class CheckInputItemRo implements Serializable { public class CheckInputItemRo implements Serializable {
/** /**
......
...@@ -7,7 +7,7 @@ import lombok.Data; ...@@ -7,7 +7,7 @@ import lombok.Data;
import java.security.acl.LastOwnerException; import java.security.acl.LastOwnerException;
@RuleFact(value = "消防设备",project = "青海风险管控") @RuleFact(value = "消防设备",project = "风险管控")
@Data @Data
public class FireEquimentDataRo extends BasicsRo public class FireEquimentDataRo extends BasicsRo
{ {
......
...@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact; ...@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data; import lombok.Data;
@RuleFact(value = "巡检点",project = "青海风险管控") @RuleFact(value = "巡检点",project = "风险管控")
@Data @Data
public class ProtalDataRo extends BasicsRo { public class ProtalDataRo extends BasicsRo {
......
...@@ -8,7 +8,7 @@ import com.yeejoin.amos.component.rule.RuleFact; ...@@ -8,7 +8,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data; import lombok.Data;
@RuleFact(value = "风险点",project = "青海风险管控") @RuleFact(value = "风险点",project = "风险管控")
@Data @Data
public class RiskSourceRo extends BasicsRo { public class RiskSourceRo extends BasicsRo {
......
...@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact; ...@@ -7,7 +7,7 @@ import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data; import lombok.Data;
@RuleFact(value = "风险点-关联巡检点",project = "青海风险管控") @RuleFact(value = "风险点-关联巡检点",project = "风险管控")
@Data @Data
public class RiskSourceRuleRo extends BasicsRo { public class RiskSourceRuleRo extends BasicsRo {
......
...@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -40,6 +42,7 @@ public class FireSourceController extends BaseController { ...@@ -40,6 +42,7 @@ public class FireSourceController extends BaseController {
private IWaterResourceService iWaterResourceService; private IWaterResourceService iWaterResourceService;
@Autowired @Autowired
private IEquipmentService iEquipService; private IEquipmentService iEquipService;
private final Logger log = LoggerFactory.getLogger(FireSourceController.class);
@Permission @Permission
@ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备") @ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
...@@ -207,9 +210,15 @@ public class FireSourceController extends BaseController { ...@@ -207,9 +210,15 @@ public class FireSourceController extends BaseController {
@Permission @Permission
@ApiOperation(httpMethod = "GET", value = "消防状态明细信息", notes = "消防状态明细信息") @ApiOperation(httpMethod = "GET", value = "消防状态明细信息", notes = "消防状态明细信息")
@RequestMapping(value = "/info/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/info/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam Long id, public CommonResponse queryForEquipmentList(@ApiParam(value = "设备名称", required = true) @RequestParam String id,
@ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception { @ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception {
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, id)); try{
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, Long.valueOf(id)));
}catch (Exception e) {
log.error(e.getMessage(),e);
return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage());
}
} }
} }
...@@ -690,8 +690,8 @@ public class RiskSourceController extends BaseController { ...@@ -690,8 +690,8 @@ public class RiskSourceController extends BaseController {
@Permission @Permission
@ApiOperation(value = "风险预警详情", notes = "风险预警详情") @ApiOperation(value = "风险预警详情", notes = "风险预警详情")
@GetMapping(value = "/warning/detail", produces = "application/json;charset=UTF-8") @GetMapping(value = "/warning/detail", produces = "application/json;charset=UTF-8")
public CommonResponse earlyWarning(@RequestParam Long riskSourceId) { public CommonResponse earlyWarning(@RequestParam String riskSourceId) {
Map map = riskSourceService.earlyWarning(riskSourceId); Map map = riskSourceService.earlyWarning(Long.valueOf(riskSourceId));
return CommonResponseUtil.success(map); return CommonResponseUtil.success(map);
} }
......
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentParam; ...@@ -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.business.vo.EquipCommunicationData;
import com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse; import com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse;
import com.yeejoin.amos.fas.dao.entity.FireEquipment; import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.HashMap; import java.util.HashMap;
...@@ -56,6 +58,8 @@ public interface FireEquipMapper extends BaseMapper { ...@@ -56,6 +58,8 @@ public interface FireEquipMapper extends BaseMapper {
List<Map> queryForGroupCount(@Param("fireStationId") Long fireStationId); List<Map> queryForGroupCount(@Param("fireStationId") Long fireStationId);
List<Map> queryStorageEquips(@Param("riskSourceId") Long riskSourceId);
EquipDetailsResponse findEquipDetailsById(@Param("id") Long id); EquipDetailsResponse findEquipDetailsById(@Param("id") Long id);
EquipCommunicationData findOneByPointCode(@Param("code") String code); EquipCommunicationData findOneByPointCode(@Param("code") String code);
...@@ -85,4 +89,6 @@ public interface FireEquipMapper extends BaseMapper { ...@@ -85,4 +89,6 @@ public interface FireEquipMapper extends BaseMapper {
FireEquipment findFireEquipById (@Param("id") Long id); FireEquipment findFireEquipById (@Param("id") Long id);
FireEquipment findVideoById (@Param("id") Long id); FireEquipment findVideoById (@Param("id") Long id);
FireStation findFireStationById(@Param("id") Long id);
} }
package com.yeejoin.amos.fas.business.dao.mapper; package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.dao.entity.Equipment; import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment; import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipment; import com.yeejoin.amos.fas.dao.entity.FireEquipment;
...@@ -36,4 +37,6 @@ public interface ImpAndFireEquipMapper extends BaseMapper { ...@@ -36,4 +37,6 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
public Boolean existsAlarmPointByEqpPointIdAndEquipId(@Param("pointId") long pointId, @Param("equipmentId") long equipmentId); public Boolean existsAlarmPointByEqpPointIdAndEquipId(@Param("pointId") long pointId, @Param("equipmentId") long equipmentId);
// Boolean containGroupedPoint(long id); // Boolean containGroupedPoint(long id);
EquipmentSpecificIndexVo findFireEqupmentByCode(String code);
} }
...@@ -147,25 +147,25 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -147,25 +147,25 @@ public class FireEquipServiceImpl implements IFireEquipService {
switch (fireEquipmentType) switch (fireEquipmentType)
{ {
case pool: case pool:
case hydrant: FireStation fireStation = fireEquipMapper.findFireStationById(id);
Optional<WaterResource> waterResource = this.iWaterResourceDao.findById(id); fireStation.setType("2");
if(waterResource.isPresent()){ fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = waterResource.get(); returnEntity = fireStation;
}
break; break;
case fireFoamRoom: case fireFoamRoom:
FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
fireStation1.setType("2");
fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation1;
break;
case fireChamber: case fireChamber:
Optional<FireStation> fireStation1 = iFireStationDao.findById(id); FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
FireStation fireStation=null; fireStation11.setType("1");
if(fireStation1.isPresent()){ fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
fireStation=fireStation1.get(); returnEntity = fireStation11;
}
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryForGroupCount(id));
returnEntity = fireStation;
break; break;
case extinguisher: case extinguisher:
case hydrant:
case monitorEquipment: case monitorEquipment:
FireEquipment fireEquipment=fireEquipMapper.findFireEquipById(id); FireEquipment fireEquipment=fireEquipMapper.findFireEquipById(id);
fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode())); fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode()));
......
...@@ -1025,10 +1025,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1025,10 +1025,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override @Override
@javax.transaction.Transactional @javax.transaction.Transactional
public String processFireEqumtData(AlarmParam deviceData) throws Exception { public String processFireEqumtData(AlarmParam deviceData) throws Exception {
EquipmentSpecificIndexVo equipmentSpecificIndexVo = impAndFireEquipMapper.findFireEqupmentByCode(deviceData.getPointCode());
EquipmentSpecificIndexVo equipmentSpecificIndexVo = new EquipmentSpecificIndexVo(); // new EquipmentSpecificIndexVo();
equipmentSpecificIndexVo.setEquipmentSpecificId(Long.valueOf(deviceData.getPointCode())); // equipmentSpecificIndexVo.setEquipmentSpecificId(Long.valueOf(deviceData.getPointCode()));
equipmentSpecificIndexVo.setType("FIREALARM"); // equipmentSpecificIndexVo.setType("FIREALARM");
TopicEntityVo topicEntity = new TopicEntityVo(); TopicEntityVo topicEntity = new TopicEntityVo();
topicEntity.setMessage(JSON.toJSONString(equipmentSpecificIndexVo)); topicEntity.setMessage(JSON.toJSONString(equipmentSpecificIndexVo));
......
...@@ -126,10 +126,6 @@ public class View3dServiceImpl implements IView3dService { ...@@ -126,10 +126,6 @@ public class View3dServiceImpl implements IView3dService {
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
@Value("${station.equipment.code}")
private String equipmentCode;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) { public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......
...@@ -75,13 +75,23 @@ amos.feign.gennerator.use-gateway=true ...@@ -75,13 +75,23 @@ amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt autoSys.push.type=mqtt
#查询装备分类 #查询装备分类
#消防视频:xfsp
#消防车:2101 #消防车:2101
#灭火器:3104 data.type.fireChamber=2101
#消火栓:3105
#探测器:8501
#消防小室:9301 #消防小室:9301
data.type.fireChamber=9301
#消防水池:9302 #消防水池:9302
data.type.pool=9302
#消防泡沫间:9305 #消防泡沫间:9305
#消防视频:xfsp data.type.fireFoamRoom=9305
station.equipment.code=2101,3104,3105,8501,9301,9302,9305,xfsp #探测器:8501
data.type.monitorEquipment=8501
#灭火器:3104
data.type.extinguisher=3104
#消火栓:3105
data.type.hydrant=3105
...@@ -554,16 +554,36 @@ ...@@ -554,16 +554,36 @@
ALTER TABLE `f_station_info` ADD COLUMN `safety_user_phone_num` varchar(20) NULL COMMENT '安全负责人联系方式'; ALTER TABLE `f_station_info` ADD COLUMN `safety_user_phone_num` varchar(20) NULL COMMENT '安全负责人联系方式';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zjw" id="16062323232111"> <changeSet author="keyong" id="1608279637-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
<columnExists tableName="f_station_info" columnName="safety_user_phone_num" /> <columnExists tableName="f_station_info" columnName="fire_captain_name" />
</not> </not>
</preConditions> </preConditions>
<comment>修改f_station_info表结构</comment> <comment>修改f_station_info表结构</comment>
<sql> <sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_name` varchar(20) NULL COMMENT '驻站消防队队长姓名'; ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_name` varchar(20) NULL COMMENT '驻站消防队队长姓名';
</sql>
</changeSet>
<changeSet author="keyong" id="1608279637-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_station_info" columnName="fire_captain_phone_num" />
</not>
</preConditions>
<comment>修改f_station_info表结构</comment>
<sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_phone_num` varchar(20) NULL COMMENT '驻站消防队队长电话'; ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_phone_num` varchar(20) NULL COMMENT '驻站消防队队长电话';
</sql>
</changeSet>
<changeSet author="keyong" id="1608279637-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_station_info" columnName="fire_captain_user_id" />
</not>
</preConditions>
<comment>修改f_station_info表结构</comment>
<sql>
ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_user_id` varchar(20) NULL COMMENT '驻站消防队队长'; ALTER TABLE `f_station_info` ADD COLUMN `fire_captain_user_id` varchar(20) NULL COMMENT '驻站消防队队长';
</sql> </sql>
</changeSet> </changeSet>
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<if test="startTime!=null"> <if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if> </if>
AND e_value IS NOT NULL AND e_value IS NOT NULL AND e_value != ''
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
...@@ -287,6 +287,24 @@ ...@@ -287,6 +287,24 @@
) )
</select> </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 id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">
SELECT SELECT
eq.`name`, eq.`name`,
...@@ -583,4 +601,16 @@ ...@@ -583,4 +601,16 @@
video.id = #{id} video.id = #{id}
</if> </if>
</select> </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> </mapper>
\ No newline at end of file
...@@ -158,4 +158,15 @@ ...@@ -158,4 +158,15 @@
and ep.id = #{pointId} and ep.id = #{pointId}
</select> </select>
<select id="findFireEqupmentByCode" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
id as equipmentSpecificId,
'FIREALARM' as type
FROM
wl_equipment_specific
WHERE
`code` = #{code}
LIMIT 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -647,7 +647,7 @@ ...@@ -647,7 +647,7 @@
<select id="queryContingencyWater" resultType="java.util.HashMap"> <select id="queryContingencyWater" resultType="java.util.HashMap">
<!-- SELECT <!--SELECT
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, wr.area,
...@@ -664,7 +664,31 @@ ...@@ -664,7 +664,31 @@
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, 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> </select>
......
...@@ -506,12 +506,13 @@ ...@@ -506,12 +506,13 @@
SELECT SELECT
wlesi.id, wlesi.id,
wlesi.`value` status, wlesi.`value` status,
wlesi.create_date changeDate, wlesi.update_date changeDate,
CONCAT(wlei.group_name,wlei.name) label CONCAT(ed.name,' ',wlei.name) label
FROM FROM
wl_equipment_specific_index wlesi wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
left join wl_equipment_specific wles on wlesi.equipment_specific_id = wles.id left join wl_equipment_specific wles on wlesi.equipment_specific_id = wles.id
left join wl_equipment_detail ed on ed.id = wles.equipment_detail_id
WHERE WHERE
wles.org_code=#{orgCode} wles.org_code=#{orgCode}
and wlei.type_code!='BREAKDOWN' and wlei.type_code!='BREAKDOWN'
...@@ -1325,7 +1326,7 @@ ...@@ -1325,7 +1326,7 @@
<select id="retrieveAll" resultType="java.util.HashMap"> <select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select concat('riskSource-',r.id) as id,r.id as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode, from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode, rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1353,7 +1354,8 @@ ...@@ -1353,7 +1354,8 @@
'' as person, '' as person,
r.rpn as title, r.rpn as title,
CONCAT('riskSource-',r.id) as `key`, CONCAT('riskSource-',r.id) as `key`,
r.id as riskSourceId r.id as riskSourceId,
'' as room
from f_risk_source r from f_risk_source r
left join f_risk_level rl ON rl.id = r.risk_level_id left join f_risk_level rl ON rl.id = r.risk_level_id
where r.is_region = 'FALSE' where r.is_region = 'FALSE'
...@@ -1361,7 +1363,7 @@ ...@@ -1361,7 +1363,7 @@
AND rl.level = #{dataLevel} AND rl.level = #{dataLevel}
</if> </if>
UNION all UNION all
select concat('patrol-',p.id) as id,p.id as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode, select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode, p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1394,11 +1396,13 @@ ...@@ -1394,11 +1396,13 @@
when p.status = '3' then '漏检' when p.status = '3' then '漏检'
end as title, end as title,
concat('patrol-',p.id) as `key`, concat('patrol-',p.id) as `key`,
p.risk_source_id as riskSourceId p.risk_source_id as riskSourceId,
r.name as room
from p_point p from p_point p
left join f_risk_source r on r.id = p.risk_source_id
WHERE is_delete = FALSE WHERE is_delete = FALSE
UNION all UNION all
select concat('impEquipment-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode, select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode, 0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1424,12 +1428,14 @@ ...@@ -1424,12 +1428,14 @@
e.name as protectObjName, e.name as protectObjName,
'' as routeName, '' as routeName,
'' as person, '' as person,
name as title, e.name as title,
concat('impEquipment-',e.id) as `key`, concat('impEquipment-',e.id) as `key`,
e.risk_source_id as riskSourceId e.risk_source_id as riskSourceId,
r.name as room
from f_equipment e from f_equipment e
left join f_risk_source r on r.id = e.risk_source_id
UNION all UNION all
select concat('monitorEquipment-',m.id) as id,m.id as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode, select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1457,7 +1463,8 @@ ...@@ -1457,7 +1463,8 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('monitorEquipment-',m.id) as `key`, concat('monitorEquipment-',m.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from wl_equipment_specific m from wl_equipment_specific m
left join wl_equipment_detail as det on m.equipment_detail_id = det.id left join wl_equipment_detail as det on m.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id left join wl_equipment as equ on det.equipment_id = equ.id
...@@ -1466,13 +1473,13 @@ ...@@ -1466,13 +1473,13 @@
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id 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_fire_equipment fe on fe.fire_equipment_id = m.id
left join f_equipment f on f.id = fe.equipment_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 != ''"> <if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName} AND f.name = #{protectObjName}
</if> </if>
group By m.code
UNION all UNION all
select concat('video-',vi.id) as id,vi.id as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode, select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1500,7 +1507,8 @@ ...@@ -1500,7 +1507,8 @@
'' as person, '' as person,
vi.name as title, vi.name as title,
concat('video-',vi.id) as `key`, concat('video-',vi.id) as `key`,
vis.source_id as riskSourceId vis.source_id as riskSourceId,
sou.name as room
from wl_video as vi from wl_video as vi
left join wl_video_source as vis on vi.id = vis.video_id left join wl_video_source as vis on vi.id = vis.video_id
left join f_risk_source as sou on sou.id = vis.source_id left join f_risk_source as sou on sou.id = vis.source_id
...@@ -1508,7 +1516,7 @@ ...@@ -1508,7 +1516,7 @@
group by vi.id group by vi.id
UNION all UNION all
select concat('hydrant-',spe.id) as id,spe.id as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode, select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1536,7 +1544,8 @@ ...@@ -1536,7 +1544,8 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('hydrant-',spe.id) as `key`, concat('hydrant-',spe.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from from
wl_equipment_specific as spe wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
...@@ -1544,9 +1553,9 @@ ...@@ -1544,9 +1553,9 @@
left join wl_equipment_category as cat on equ.category_id = cat.id 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_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 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 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, select concat('pool-',bu.id) as id,concat(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, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1574,12 +1583,13 @@ ...@@ -1574,12 +1583,13 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('pool-',bu.id) as `key`, concat('pool-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9302 where substr(cat.code ,1,4) = 9302
UNION all UNION all
select concat('fireCar-',car.id) as id,car.id as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode, select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1607,12 +1617,13 @@ ...@@ -1607,12 +1617,13 @@
'' as person, '' as person,
car.name as title, car.name as title,
concat('fireCar-',car.id) as `key`, concat('fireCar-',car.id) as `key`,
#{riskSourceId} as riskSourceId #{riskSourceId} as riskSourceId,
'' as room
from wl_car as car from wl_car as car
left join wl_equipment as equ on car.equipment_id = equ.id left join wl_equipment as equ on car.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id left join wl_equipment_category as cat on equ.category_id = cat.id
UNION all UNION all
select concat('fireEquipment-',spe.id) as id,spe.id as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'fireEquipment' as type,spe.org_code as orgCode, select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1639,17 +1650,18 @@ ...@@ -1639,17 +1650,18 @@
'' as routeName, '' as routeName,
'' as person, '' as person,
det.name as title, det.name as title,
concat('fireEquipment-',spe.id) as `key`, concat('extinguisher-',spe.id) as `key`,
str.source_id as riskSourceId str.source_id as riskSourceId,
str.full_name as room
from wl_equipment_specific as spe from wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id 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_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 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 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, select concat('fireChamber-',bu.id) as id,concat(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, 0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1677,12 +1689,13 @@ ...@@ -1677,12 +1689,13 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('fireChamber-',bu.id) as `key`, concat('fireChamber-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9305 where substr(cat.code ,1,4) = 9305
UNION all UNION all
select concat('fireFoamRoom-',bu.id) as id,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireFoamRoom' as type,bu.org_code as orgCode, select concat('fireFoamRoom-',bu.id) as id,concat(bu.id) as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireFoamRoom' as type,bu.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -1710,10 +1723,11 @@ ...@@ -1710,10 +1723,11 @@
'' as person, '' as person,
bu.name as title, bu.name as title,
concat('fireFoamRoom-',bu.id) as `key`, concat('fireFoamRoom-',bu.id) as `key`,
bu.region_id as riskSourceId bu.region_id as riskSourceId,
bu.address as room
from wl_building as bu from wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id 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 ) as tmp
<where> <where>
<if test="inputText!=null and inputText != ''" > <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