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,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,
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'
<iftest="dataLevel != null and dataLevel != ''">
<iftest="dataLevel != null and dataLevel != ''">
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,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,
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-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,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,
select concat('monitorEquipment-',m.id) as id,m.id as originId,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
select concat('monitorEquipment-',m.id) as id,m.id as originId,det.name,substr(cat.code ,1,4),'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
IFNULL(group_concat(f.name),'') as protectObjName,
IFNULL(group_concat(f.name),'') as protectObjName,
'' as routeName,
'' as routeName,
'' as person,
'' as person,
m.name as title,
det.name as title,
concat('monitorEquipment-',m.id) as `key`,
concat('monitorEquipment-',m.id) as `key`,
m.risk_source_id as riskSourceId
str.source_id as riskSourceId
from f_fire_equipment m
from wl_equipment_specific m
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join wl_equipment_detail as det on m.equipment_detail_id = det.id
left join f_equipment f on f.id = fe.equipment_id
left join wl_equipment as equ on det.equipment_id = equ.id
where equip_classify = 0
left join wl_equipment_category as cat on equ.category_id = cat.id
group By m.code
left join wl_stock_detail as sto on sto.qr_code = m.qr_code
<iftest="protectObjName != null and protectObjName != ''">
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
AND f.name = #{protectObjName}
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
</if>
left join f_equipment f on f.id = fe.equipment_id
where substr(cat.code ,1,4) = 8501
group By m.code
<iftest="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName}
</if>
UNION all
UNION all
select concat('video-',m.id) as id,m.id as originId,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'video' as type,m.org_code as orgCode,
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,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode,
left join f_equipment_fire_equipment fe on fe.fire_equipment_id = m.id
left join wl_video_source as vis on vi.id = vis.video_id
left join f_equipment f on f.id = fe.equipment_id
left join f_risk_source as sou on sou.id = vis.source_id
where m.equip_classify = 2
UNION all
UNION all
select concat('hydrant-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
select concat('hydrant-',spe.id) as id,spe.id as originId,det.name,substr(cat.code ,1,4) as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9302
UNION all
UNION all
select concat('fireCar-',id) as id,id as originId,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
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,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
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
UNION all
UNION all
select concat('fireEquipment-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
select concat('fireEquipment-',spe.id) as id,spe.id as originId,det.name,substr(cat.code ,1,4) as code,null as ue4Location,null as ue4Rotation,'fireEquipment' as type,spe.org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
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_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
UNION all
UNION all
select concat('fireChamber-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
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,is_indoor as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = 9305
UNION all
UNION all
select concat('fireFoamRoom-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
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,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,