Commit 15befc78 authored by maoying's avatar maoying

修改iotree接口

parent 75f51940
......@@ -1862,6 +1862,31 @@
<select id="retrieve3AllCount" resultType="long">
SELECT COUNT(1) FROM (
SELECT
concat('fireCar-', car.id) AS id,
concat(car.id) AS originId,
car.`name`,
car.car_num AS `code`,
'fireCar' AS type,
car.org_code AS orgCode,
0 AS level,
'level_0' AS levelStr,
'' AS isIndoor,
'消防车' AS typeName,
'fireEquipment' AS typeCode,
car.`name` AS label,
'' AS routeName,
'' AS areaId,
'' AS person,
car.`name` AS title,
concat('fireCar-', car.id) AS `key`,
'' AS riskSourceId,
'' AS room
FROM
wl_car AS car
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
SELECT
concat( 'riskSource-', r.id ) AS id,
concat( r.id ) AS originId,
r.name,
......@@ -2016,25 +2041,52 @@
<select id="retrieve3All" resultType="java.util.HashMap">
SELECT * FROM (
SELECT
concat( 'riskSource-', r.id ) AS id,
concat( r.id ) AS originId,
r.name,
r.code,
'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,
r.name AS label,
'' AS routeName,
'' AS person,
r.rpn AS title,
CONCAT( 'riskSource-', r.id ) AS `key`,
r.id AS riskSourceId,
null AS areaId,
'' AS room
concat('fireCar-', car.id) AS id,
concat(car.id) AS originId,
car.`name`,
car.car_num AS `code`,
'fireCar' AS type,
car.org_code AS orgCode,
0 AS level,
'level_0' AS levelStr,
'' AS isIndoor,
'消防车' AS typeName,
'fireEquipment' AS typeCode,
car.`name` AS label,
car.`name` AS protectObjName,
'' AS routeName,
'' AS areaId,
'' AS person,
car.`name` AS title,
concat('fireCar-', car.id) AS `key`,
'' AS riskSourceId,
'' AS room
FROM
wl_car AS car
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
SELECT
concat('riskSource-', r.id) AS id,
concat(r.id) AS originId,
r.`name`,
r.`code`,
'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,
r.`name` AS protectObjName,
r.`name` AS label,
'' AS routeName,
'' AS person,
r.rpn AS title,
CONCAT('riskSource-', r.id) AS `key`,
r.id AS riskSourceId,
'' AS areaId,
'' AS room
FROM
f_risk_source r
LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
......@@ -2047,8 +2099,8 @@
SELECT
concat('video-', vi.id) AS id,
concat(vi.id) AS originId,
vi.name,
vi.code,
vi.`name`,
vi.`code`,
'video' AS type,
vi.org_code AS orgCode,
'' AS level,
......@@ -2056,14 +2108,15 @@
'' AS isIndoor,
'摄像头' AS typeName,
'video' AS typeCode,
vi.`name` AS label,
'' AS routeName,
'' AS person,
vi.`name` AS title,
concat('video-', vi.id) AS `key`,
'' AS riskSourceId,
vi.belongAreaId as areaId,
vi.address AS room
vi.`name` AS label,
vi.`name` AS protectObjName,
'' AS routeName,
'' AS person,
vi.`name` AS title,
concat('video-', vi.id) AS `key`,
'' AS riskSourceId,
vi.belongAreaId AS areaId,
vi.address AS room
FROM
wl_video AS vi
<where>
......@@ -2073,35 +2126,35 @@
</where>
UNION ALL
SELECT
concat( 'patrol-', p.id ) AS id,
concat( p.id ) AS originId,
p.name,
p.point_no AS CODE,
'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.name AS label,
p.route_name AS routeName,
p.charge_person_id AS person,
CASE
WHEN p.status = '0' THEN
'未执行'
WHEN p.status = '1' THEN
'合格'
WHEN p.status = '2' THEN
'不合格'
WHEN p.status = '3' THEN
'漏检'
END AS title,
concat( 'patrol-', p.id ) AS `key`,
p.risk_source_id AS riskSourceId,
p.area_id AS areaId,
r.full_name AS room
concat('patrol-', p.id) AS id,
concat(p.id) AS originId,
p.`name`,
p.`name` AS protectObjName,
p.point_no AS CODE,
'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.`name` AS label,
p.route_name AS routeName,
p.charge_person_id AS person,
CASE
WHEN p.`status` = '0' THEN
'未执行'
WHEN p.`status` = '1' THEN
'合格'
WHEN p.`status` = '2' THEN
'不合格'
WHEN p.`status` = '3' THEN
'漏检'
END AS title,
concat('patrol-', p.id) AS `key`,
p.risk_source_id AS riskSourceId,
p.area_id AS areaId,
r.full_name AS room
FROM
p_point p
LEFT JOIN wl_warehouse_structure r ON r.id = p.risk_source_id
......@@ -2113,25 +2166,26 @@
</where>
UNION ALL
SELECT
concat( 'fireEquipment-', m.id ) AS id,
concat( m.id ) AS originId,
det.name,
m.code AS code,
'fireEquipment' AS type,
m.org_code as orgCode,
'' AS level,
concat( 'level_', '' ) AS levelStr,
NULL AS isIndoor,
'消防设备' AS typeName,
'fireEquipment' AS typeCode,
det.name AS label,
'' AS routeName,
'' AS person,
det.name AS title,
concat( 'fireEquipment-', m.id ) AS `key`,
risk.id AS riskSourceId,
m.area_id AS areaId,
str.full_name AS room
concat('fireEquipment-', m.id) AS id,
concat(m.id) AS originId,
det.`name`,
det.`name` AS protectObjName,
m.`code` AS `code`,
'fireEquipment' AS type,
m.org_code AS orgCode,
'' AS level,
concat('level_', '') AS levelStr,
'' AS isIndoor,
'消防设备' AS typeName,
'fireEquipment' AS typeCode,
det.`name` AS label,
'' AS routeName,
'' AS person,
det.`name` AS title,
concat('fireEquipment-', m.id) AS `key`,
risk.id AS riskSourceId,
m.area_id AS areaId,
str.full_name AS room
FROM
wl_equipment_specific m
LEFT JOIN wl_equipment_detail AS det ON m.equipment_detail_id = det.id
......
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