Commit 15befc78 authored by maoying's avatar maoying

修改iotree接口

parent 75f51940
...@@ -1862,6 +1862,31 @@ ...@@ -1862,6 +1862,31 @@
<select id="retrieve3AllCount" resultType="long"> <select id="retrieve3AllCount" resultType="long">
SELECT COUNT(1) FROM ( SELECT COUNT(1) FROM (
SELECT 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( 'riskSource-', r.id ) AS id,
concat( r.id ) AS originId, concat( r.id ) AS originId,
r.name, r.name,
...@@ -2016,24 +2041,51 @@ ...@@ -2016,24 +2041,51 @@
<select id="retrieve3All" resultType="java.util.HashMap"> <select id="retrieve3All" resultType="java.util.HashMap">
SELECT * FROM ( SELECT * FROM (
SELECT SELECT
concat( 'riskSource-', r.id ) AS id, concat('fireCar-', car.id) AS id,
concat( r.id ) AS originId, concat(car.id) AS originId,
r.name, car.`name`,
r.code, 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, 'riskSource' AS type,
r.org_code as orgCode, r.org_code AS orgCode,
rl.level AS level, rl.`level` AS `level`,
rl.name AS levelStr, rl.`name` AS levelStr,
r.is_indoor AS isIndoor, r.is_indoor AS isIndoor,
'风险点' AS typeName, '风险点' AS typeName,
'riskSource' AS typeCode, 'riskSource' AS typeCode,
r.name AS label, r.`name` AS protectObjName,
r.`name` AS label,
'' 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, r.id AS riskSourceId,
null AS areaId, '' AS areaId,
'' AS room '' AS room
FROM FROM
f_risk_source r f_risk_source r
...@@ -2047,8 +2099,8 @@ ...@@ -2047,8 +2099,8 @@
SELECT SELECT
concat('video-', vi.id) AS id, concat('video-', vi.id) AS id,
concat(vi.id) AS originId, concat(vi.id) AS originId,
vi.name, vi.`name`,
vi.code, vi.`code`,
'video' AS type, 'video' AS type,
vi.org_code AS orgCode, vi.org_code AS orgCode,
'' AS level, '' AS level,
...@@ -2057,12 +2109,13 @@ ...@@ -2057,12 +2109,13 @@
'摄像头' AS typeName, '摄像头' AS typeName,
'video' AS typeCode, 'video' AS typeCode,
vi.`name` AS label, vi.`name` AS label,
vi.`name` AS protectObjName,
'' AS routeName, '' AS routeName,
'' AS person, '' AS person,
vi.`name` AS title, vi.`name` AS title,
concat('video-', vi.id) AS `key`, concat('video-', vi.id) AS `key`,
'' AS riskSourceId, '' AS riskSourceId,
vi.belongAreaId as areaId, vi.belongAreaId AS areaId,
vi.address AS room vi.address AS room
FROM FROM
wl_video AS vi wl_video AS vi
...@@ -2073,32 +2126,32 @@ ...@@ -2073,32 +2126,32 @@
</where> </where>
UNION ALL UNION ALL
SELECT SELECT
concat( 'patrol-', p.id ) AS id, concat('patrol-', p.id) AS id,
concat( p.id ) AS originId, concat(p.id) AS originId,
p.name, p.`name`,
p.`name` AS protectObjName,
p.point_no AS CODE, p.point_no AS CODE,
'patrol' AS type, 'patrol' AS type,
p.org_code as orgCode, p.org_code AS orgCode,
p.status AS level, p.`status` AS LEVEL,
CONCAT( 'level_', p.status ) AS levelStr, CONCAT('level_', p. STATUS) AS levelStr,
p.is_indoor AS isIndoor, p.is_indoor AS isIndoor,
'巡检点' AS typeName, '巡检点' AS typeName,
'patrol' AS typeCode, 'patrol' AS typeCode,
p.name AS label, p.`name` AS label,
p.route_name AS routeName, p.route_name AS routeName,
p.charge_person_id AS person, p.charge_person_id AS person,
CASE CASE
WHEN p.`status` = '0' THEN
WHEN p.status = '0' THEN
'未执行' '未执行'
WHEN p.status = '1' THEN WHEN p.`status` = '1' THEN
'合格' '合格'
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, p.risk_source_id AS riskSourceId,
p.area_id AS areaId, p.area_id AS areaId,
r.full_name AS room r.full_name AS room
...@@ -2113,22 +2166,23 @@ ...@@ -2113,22 +2166,23 @@
</where> </where>
UNION ALL UNION ALL
SELECT SELECT
concat( 'fireEquipment-', m.id ) AS id, concat('fireEquipment-', m.id) AS id,
concat( m.id ) AS originId, concat(m.id) AS originId,
det.name, det.`name`,
m.code AS code, det.`name` AS protectObjName,
m.`code` AS `code`,
'fireEquipment' AS type, 'fireEquipment' AS type,
m.org_code as orgCode, m.org_code AS orgCode,
'' AS level, '' AS level,
concat( 'level_', '' ) AS levelStr, concat('level_', '') AS levelStr,
NULL AS isIndoor, '' AS isIndoor,
'消防设备' AS typeName, '消防设备' AS typeName,
'fireEquipment' AS typeCode, 'fireEquipment' AS typeCode,
det.name AS label, det.`name` AS label,
'' AS routeName, '' AS routeName,
'' AS person, '' AS person,
det.name AS title, det.`name` AS title,
concat( 'fireEquipment-', m.id ) AS `key`, concat('fireEquipment-', m.id) AS `key`,
risk.id AS riskSourceId, risk.id AS riskSourceId,
m.area_id AS areaId, m.area_id AS areaId,
str.full_name AS room str.full_name AS room
......
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