Commit 67d69f24 authored by zhengjiawei's avatar zhengjiawei

sql

parent ce6ca1a7
...@@ -1215,9 +1215,7 @@ ...@@ -1215,9 +1215,7 @@
</select> </select>
<select id="retrieveAllCount" resultType="long"> <select id="retrieveAllCount" resultType="long"> select count(1)
select count(1)
from ( from (
select r.name,r.code,'riskSource' as typeCode,r.org_code as orgCode, r.id as riskSourceId 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
...@@ -1277,7 +1275,7 @@ ...@@ -1277,7 +1275,7 @@
spe.code as code, spe.code as code,
'monitorEquipment' as typeCode, 'monitorEquipment' as typeCode,
spe.org_code as orgCode, spe.org_code as orgCode,
risk.source_id as risk_source_id risk.id as risk_source_id
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
...@@ -1286,7 +1284,7 @@ ...@@ -1286,7 +1284,7 @@
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.source_id 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 left join f_risk_source as risk on str.source_id = risk.source_id
where substr(cat.code ,1,4) = 8501 where substr(cat.code ,1,4) = 8501 and risk.source_id is not null
<if test="protectObjName != null and protectObjName != ''"> <if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName} AND f.name = #{protectObjName}
</if> </if>
...@@ -1297,7 +1295,7 @@ ...@@ -1297,7 +1295,7 @@
spe.code as code, spe.code as code,
'fireEquipment' as typeCode, 'fireEquipment' as typeCode,
spe.org_code as orgCode, spe.org_code as orgCode,
risk.source_id as risk_source_id risk.id as risk_source_id
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
...@@ -1306,7 +1304,7 @@ ...@@ -1306,7 +1304,7 @@
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.source_id 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 left join f_risk_source as risk on str.source_id = risk.source_id
where substr(cat.code ,1,4) in (3104,3105) where substr(cat.code ,1,4) in (3104,3105) and risk.source_id is not null
) as tmp ) as tmp
where 1=1 where 1=1
<if test="inputText!=null and inputText != ''" > <if test="inputText!=null and inputText != ''" >
...@@ -1324,7 +1322,6 @@ ...@@ -1324,7 +1322,6 @@
<if test="orgCode!=null"> <if test="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') ) AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if> </if>
</select> </select>
<select id="retrieveAll" resultType="java.util.HashMap"> <select id="retrieveAll" resultType="java.util.HashMap">
...@@ -1461,7 +1458,7 @@ ...@@ -1461,7 +1458,7 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('monitorEquipment-',m.id) as `key`, concat('monitorEquipment-',m.id) as `key`,
risk.source_id as riskSourceId risk.id as riskSourceId
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
...@@ -1471,7 +1468,7 @@ ...@@ -1471,7 +1468,7 @@
left join f_risk_source as risk on str.source_id = risk.source_id 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_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' and risk.source_id is not null
group By m.code group By m.code
<if test="protectObjName != null and protectObjName != ''"> <if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName} AND f.name = #{protectObjName}
...@@ -1541,7 +1538,7 @@ ...@@ -1541,7 +1538,7 @@
'' 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 risk.id as riskSourceId
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
...@@ -1550,7 +1547,7 @@ ...@@ -1550,7 +1547,7 @@
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.source_id 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 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 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,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,
...@@ -1646,7 +1643,7 @@ ...@@ -1646,7 +1643,7 @@
'' as person, '' as person,
det.name as title, det.name as title,
concat('fireEquipment-',spe.id) as `key`, concat('fireEquipment-',spe.id) as `key`,
risk.source_id as riskSourceId risk.id as riskSourceId
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
...@@ -1654,7 +1651,7 @@ ...@@ -1654,7 +1651,7 @@
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.source_id 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 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 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,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,
...@@ -1740,7 +1737,6 @@ ...@@ -1740,7 +1737,6 @@
</if> </if>
</where> </where>
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
<select id="getAllPointInRegions" resultType="java.util.Map"> <select id="getAllPointInRegions" resultType="java.util.Map">
select select
......
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