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
...
@@ -1467,12 +1474,12 @@
...
@@ -1467,12 +1474,12 @@
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
<iftest="protectObjName != null and protectObjName != ''">
<iftest="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
...
@@ -1546,7 +1555,7 @@
...
@@ -1546,7 +1555,7 @@
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,8 +1650,9 @@
...
@@ -1639,8 +1650,9 @@
'' 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
...
@@ -1649,7 +1661,7 @@
...
@@ -1649,7 +1661,7 @@
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,7 +1723,8 @@
...
@@ -1710,7 +1723,8 @@
'' 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