Commit 52af9353 authored by zhengjiawei's avatar zhengjiawei

id -》source_id

parent 71eb17f7
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
FROM wl_equipment_specific_alarm wlesa FROM wl_equipment_specific_alarm wlesa
left join wl_equipment_specific wles on wlesa.equipment_specific_id = wles.id left join wl_equipment_specific wles on wlesa.equipment_specific_id = wles.id
left join wl_stock_detail wlsd on wlsd.equipment_specific_id=wles.id left join wl_stock_detail wlsd on wlsd.equipment_specific_id=wles.id
left join wl_warehouse_structure wws on wlsd.warehouse_structure_id = wws.id left join wl_warehouse_structure wws on wlsd.warehouse_structure_id = wws.source_id
left join wl_equipment_detail wled on wles.equipment_detail_id = wled.id left join wl_equipment_detail wled on wles.equipment_detail_id = wled.id
) d ) d
WHERE 1=1 WHERE 1=1
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<if test="equipmentId != null and equipmentId!='null' "> <if test="equipmentId != null and equipmentId!='null' ">
left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id
</if> </if>
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware.source_id
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id left join wl_equipment_detail as det on sto.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
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_category as cate on equ.category_id = cate.id
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
from from
wl_stock_detail as sto wl_stock_detail as sto
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware.source_id
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id left join wl_equipment_detail as det on sto.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
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_category as cate on equ.category_id = cate.id
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
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_index as ein on ind.equipment_index_id = ein.id left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
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.id left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
left join f_risk_source as sce on str.source_id = sce.id left join f_risk_source as sce on str.source_id = sce.id
) d ) d
WHERE WHERE
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.source_id = wsd.warehouse_structure_id
WHERE WHERE
ws.source_id = #{riskSourceId} ws.source_id = #{riskSourceId}
GROUP BY GROUP BY
......
...@@ -1216,23 +1216,24 @@ ...@@ -1216,23 +1216,24 @@
<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
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'
<if test="dataLevel != null and dataLevel != ''"> <if test="dataLevel != null and dataLevel != ''">
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, p.risk_source_id as riskSourceId 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, e.risk_source_id as riskSourceId 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 select
car.name , car.name ,
...@@ -1283,7 +1284,7 @@ ...@@ -1283,7 +1284,7 @@
left join wl_equipment as equ on det.equipment_id = equ.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_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_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 left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
where substr(cat.code ,1,4) = 8501 where substr(cat.code ,1,4) = 8501
<if test="protectObjName != null and protectObjName != ''"> <if test="protectObjName != null and protectObjName != ''">
AND f.name = #{protectObjName} AND f.name = #{protectObjName}
...@@ -1302,16 +1303,16 @@ ...@@ -1302,16 +1303,16 @@
left join wl_equipment as equ on det.equipment_id = equ.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_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_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 left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
where substr(cat.code ,1,4) in (3104,3105) where substr(cat.code ,1,4) in (3104,3105)
) as tmp ) as tmp
where 1=1 where 1=1
<if test="inputText!=null and inputText != ''" > <if test="inputText!=null and inputText != ''" >
AND ( AND (
tmp.code LIKE '%${inputText}%' tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%' OR tmp.name LIKE '%${inputText}%'
) )
</if> </if>
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
AND tmp.typeCode = #{type} AND tmp.typeCode = #{type}
</if> </if>
...@@ -1321,9 +1322,11 @@ ...@@ -1321,9 +1322,11 @@
<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">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
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,
...@@ -1463,7 +1466,7 @@ ...@@ -1463,7 +1466,7 @@
left join wl_equipment as equ on det.equipment_id = equ.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_equipment_category as cat on equ.category_id = cat.id
left join wl_stock_detail as sto on sto.qr_code = m.qr_code left join wl_stock_detail as sto on sto.qr_code = m.qr_code
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.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'
...@@ -1543,7 +1546,7 @@ ...@@ -1543,7 +1546,7 @@
left join wl_equipment as equ on det.equipment_id = equ.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_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_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 left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_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,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation,'pool' as type,bu.org_code as orgCode,
...@@ -1646,7 +1649,7 @@ ...@@ -1646,7 +1649,7 @@
left join wl_equipment as equ on det.equipment_id = equ.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_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_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 left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_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,bu.id as originId,bu.name,bu.code,null as ue4Location,null as ue4Rotation , 'fireChamber' as type,bu.org_code as orgCode,
...@@ -1733,6 +1736,7 @@ ...@@ -1733,6 +1736,7 @@
</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