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
...
...
@@ -1471,7 +1468,7 @@
left join f_risk_source as risk on str.source_id = risk.source_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' and risk.source_id is not null
group By m.code
<iftest="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName}
...
...
@@ -1541,7 +1538,7 @@
'' as person,
det.name as title,
concat('hydrant-',spe.id) as `key`,
str.source_id as riskSourceId
risk.id as riskSourceId
from
wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
...
...
@@ -1550,7 +1547,7 @@
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.source_id
left join f_risk_source as risk on str.source_id = risk.source_id
where substr(cat.code ,1,4)= '3105'
where substr(cat.code ,1,4)= '3105' and risk.source_id is not null
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,
...
...
@@ -1646,7 +1643,7 @@
'' as person,
det.name as title,
concat('fireEquipment-',spe.id) as `key`,
risk.source_id as riskSourceId
risk.id as riskSourceId
from wl_equipment_specific as spe
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
...
...
@@ -1654,7 +1651,7 @@
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.source_id
left join f_risk_source as risk on str.source_id = risk.source_id
where substr(cat.code ,1,4) = '3104'
where substr(cat.code ,1,4) = '3104' and risk.source_id is not null
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,