select r.name,r.code,'riskSource' as typeCode,r.org_code as orgCode
select r.name,r.code,'riskSource' as typeCode,r.org_code as orgCode, r.id as riskSourceId
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'
...
@@ -1186,14 +1186,14 @@
...
@@ -1186,14 +1186,14 @@
AND rl.level = #{dataLevel}
AND rl.level = #{dataLevel}
</if>
</if>
UNION all
UNION all
select p.name,p.point_no as code,'patrol' as typeCode,p.org_code as orgCode
select p.name,p.point_no as code,'patrol' as typeCode,p.org_code as orgCode, p.risk_source_id as riskSourceId
from p_point p
from p_point p
WHERE is_delete = FALSE
WHERE is_delete = FALSE
UNION all
UNION all
select name,code,'impEquipment' as typeCode,org_code as orgCode
select name,code,'impEquipment' as typeCode,org_code as orgCode, e.risk_source_id as riskSourceId
from f_equipment e
from f_equipment e
UNION all
UNION all
select m.name,m.code,'monitorEquipment' as typeCode,m.org_code as orgCode
select m.name,m.code,'monitorEquipment' as typeCode,m.org_code as orgCode, m.risk_source_id as riskSourceId
from f_fire_equipment m
from f_fire_equipment m
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
...
@@ -1202,29 +1202,29 @@
...
@@ -1202,29 +1202,29 @@
AND f.name = #{protectObjName}
AND f.name = #{protectObjName}
</if>
</if>
UNION all
UNION all
select name,code,'video' as typeCode,org_code as orgCode
select name,code,'video' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_fire_equipment where equip_classify = 2
from f_fire_equipment where equip_classify = 2
UNION all
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
select name,code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_water_resource where type = 1
from f_water_resource where type = 1
UNION all
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
select name,code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_water_resource where type = 2
from f_water_resource where type = 2
UNION all
UNION all
select name,car_num as code,'fireEquipment' as typeCode,org_code as orgCode
select name,car_num as code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_fire_car
from f_fire_car
UNION all
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
select name,code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_fire_equipment where equip_classify = 3
from f_fire_equipment where equip_classify = 3
UNION all
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
select name,code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_fire_station where type = 2
from f_fire_station where type = 2
UNION all
UNION all
select name,code,'fireEquipment' as typeCode,org_code as orgCode
select name,code,'fireEquipment' as typeCode,org_code as orgCode, risk_source_id as riskSourceId
from f_fire_station where type = 1
from f_fire_station where type = 1
) as tmp
) as tmp
where 1=1
where 1=1
<iftest="inputText!=null">
<iftest="inputText!=null and inputText != ''">
AND (
AND (
tmp.code LIKE '%${inputText}%'
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
...
@@ -1233,6 +1233,9 @@
...
@@ -1233,6 +1233,9 @@
<iftest="type!=null and type!=''">
<iftest="type!=null and type!=''">
AND tmp.typeCode = #{type}
AND tmp.typeCode = #{type}
</if>
</if>
<iftest="riskSourceId != null">
AND tmp.riskSourceId = #{riskSourceId}
</if>
<iftest="orgCode!=null">
<iftest="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if>
</if>
...
@@ -1267,7 +1270,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1267,7 +1270,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' 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
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'
...
@@ -1307,7 +1311,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1307,7 +1311,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
when p.status = '2' then '不合格'
when p.status = '2' then '不合格'
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
from p_point p
from p_point p
WHERE is_delete = FALSE
WHERE is_delete = FALSE
UNION all
UNION all
...
@@ -1338,7 +1343,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1338,7 +1343,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('impEquipment-',e.id) as `key`
concat('impEquipment-',e.id) as `key`,
e.risk_source_id as riskSourceId
from f_equipment e
from f_equipment e
UNION all
UNION all
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,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
...
@@ -1368,7 +1374,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1368,7 +1374,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
m.name as title,
m.name as title,
concat('monitorEquipment-',m.id) as `key`
concat('monitorEquipment-',m.id) as `key`,
m.risk_source_id as riskSourceId
from f_fire_equipment m
from f_fire_equipment m
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
...
@@ -1405,7 +1412,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1405,7 +1412,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
m.name as title,
m.name as title,
concat('video-',m.id) as `key`
concat('video-',m.id) as `key`,
m.risk_source_id as riskSourceId
from f_fire_equipment m
from f_fire_equipment m
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
...
@@ -1439,7 +1447,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1439,7 +1447,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('hydrant-',id) as `key`
concat('hydrant-',id) as `key`,
risk_source_id as riskSourceId
from f_water_resource where type = 1
from f_water_resource where type = 1
UNION all
UNION all
select concat('pool-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
select concat('pool-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
...
@@ -1469,7 +1478,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1469,7 +1478,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('pool-',id) as `key`
concat('pool-',id) as `key`,
risk_source_id as riskSourceId
from f_water_resource where type = 2
from f_water_resource where type = 2
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-',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,
...
@@ -1499,7 +1509,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1499,7 +1509,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('fireCar-',id) as `key`
concat('fireCar-',id) as `key`,
risk_source_id as riskSourceId
from f_fire_car
from f_fire_car
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-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
...
@@ -1529,7 +1540,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1529,7 +1540,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('fireEquipment-',id) as `key`
concat('fireEquipment-',id) as `key`,
risk_source_id as riskSourceId
from f_fire_equipment where equip_classify = 3
from f_fire_equipment where equip_classify = 3
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-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
...
@@ -1559,7 +1571,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1559,7 +1571,8 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('fireChamber-',id) as `key`
concat('fireChamber-',id) as `key`,
risk_source_id as riskSourceId
from f_fire_station where type = 2
from f_fire_station where type = 2
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-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
...
@@ -1589,11 +1602,12 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1589,11 +1602,12 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
'' as routeName,
'' as routeName,
'' as person,
'' as person,
name as title,
name as title,
concat('fireFoamRoom-',id) as `key`
concat('fireFoamRoom-',id) as `key`,
risk_source_id as riskSourceId
from f_fire_station where type = 1
from f_fire_station where type = 1
) as tmp
) as tmp
<where>
<where>
<iftest="inputText!=null">
<iftest="inputText!=null and inputText != ''">
AND (
AND (
tmp.code LIKE '%${inputText}%'
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
...
@@ -1602,6 +1616,9 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
...
@@ -1602,6 +1616,9 @@ from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue
<iftest="type!=null and type!=''">
<iftest="type!=null and type!=''">
AND tmp.typeCode = #{type}
AND tmp.typeCode = #{type}
</if>
</if>
<iftest="riskSourceId != null">
AND tmp.riskSourceId = #{riskSourceId}
</if>
<iftest="orgCode!=null">
<iftest="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )