



-- 第一组：

SELECT 
building.id AS "id", 
building.name AS "name", 
building.unique_number AS "unique_number", 
building.level_directory AS "level_directory", 
building.superior_space AS "superior_space", 
building.usable_area AS "usable_area", 
building.construction_area AS "construction_area", 
building.above_ground_floors AS "above_ground_floors", 
building.underground_floors AS "underground_floors", 
building.business_remark AS "business_remark", 
building.address AS "address", 
building.coordinates AS "coordinates", 
building.fireproof_rating AS "fireproof_rating", 
building.earthquake_resistance_rating AS "earthquake_resistance_rating", 
building.pinyin_abbreviation AS "pinyin_abbreviation", 
building.affiliated_hospital AS "affiliated_hospital", 
building.affiliated_campus AS "affiliated_campus", 
building.superior_space_address AS "superior_space_address", 
building.superior_space_number AS "superior_space_number", 
building.total_rooms AS "total_rooms", 
building.owner AS "owner", 
building.creator AS "creator", 
building.creation_time AS "creation_time", 
building.last_modification_time AS "last_modification_time", 
building.last_modifier AS "last_modifier" 
FROM /hxyy/building building 
LIMIT 0, 20000 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;


MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor) 
RETURN floor.floor_number AS "floor_num" 
INTO /temp_floor_count_bec7ff96-36a5-45d0-b0f2-e444e1032e3d-0 
WITH TIMEOUT = 6m
;


{"sql":"SELECT count(DISTINCT temp.floor_num) AS \"floor_count\" FROM /temp_floor_count_bec7ff96-36a5-45d0-b0f2-e444e1032e3d-0 temp LIMIT 0, 20000"}
;


MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room) 
RETURN room.usable_area AS "usable_area" 
INTO /temp_room_area_3a2b1c 
WITH TIMEOUT = 6m
;


{"sql":"SELECT sum(temp.usable_area) AS \"total_usable_area\" FROM /temp_room_area_3a2b1c temp LIMIT 0, 20000"}
;

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room) 
RETURN room.excess_area AS "excess_area" 
INTO /temp_room_excess_area 
WITH TIMEOUT = 6m
;

{"sql":"SELECT sum(temp.excess_area) AS \"total_excess_area\" FROM /temp_room_excess_area temp LIMIT 0, 20000"}
;

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room)
-[:room_personnel_info_to_person_job_number|room_safety_responsible_person_to_person_job_number*1..1]->
(person:/hxyy/person) 
RETURN person.id AS "person_id" 
INTO /temp_person_count_12345 
WITH TIMEOUT = 6m
;

{"sql":"SELECT count(temp.person_id) AS \"person_count\" FROM /temp_person_count_12345 temp LIMIT 0, 20000"}
;

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room) 
RETURN room.using_department AS "department" 
INTO /temp_room_departments 
WITH TIMEOUT = 6m
;

{"sql":"SELECT DISTINCT temp.department AS \"department\" FROM /temp_room_departments temp GROUP BY temp.\"department\" LIMIT 0, 20000"}
;

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_function_partition_superior_space_number*1..1]->
(function_partition:/hxyy/function_partition) 
RETURN function_partition.id AS "id", 
function_partition.name AS "name", 
function_partition.unique_number AS "unique_number", 
function_partition.usable_area AS "usable_area" 
WITH TIMEOUT = 6m
;

-- 第二组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room)
-[:room_personnel_info_to_person_job_number*1..1]->
(person:/hxyy/person) 
RETURN person.job_number AS "job_number", person.name AS "name", person.work_department AS "work_department" 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

-- 第三组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room WHERE excess_area > 0) 
RETURN room.room_number AS "room_number", room.name AS "_hxyy_room_name_0" 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

-- 第四组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room WHERE excess_area > 0)
-[:room_personnel_info_to_person_job_number|room_safety_responsible_person_to_person_job_number*1..1]->
(person:/hxyy/person) 
RETURN room.room_number AS "room_number", 
person.name AS "person_name", 
person.party_and_government_post AS "person_position", 
room.name AS "_hxyy_room_name_0" 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

-- 第五组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room WHERE office_staff_count > 0) 
RETURN room.usable_area AS "usable_area", room.office_staff_count AS "office_staff_count" 
INTO /temp_room_data_a0fcf6ac-ba4a-470e-9416-33cc4b6653ce-0 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

{"sql":"SELECT sum(temp.usable_area) AS \"total_usable_area\", sum(temp.office_staff_count) AS \"total_office_staff\", sum(temp.usable_area) / sum(temp.office_staff_count) AS \"per_capita_area\" FROM /temp_room_data_a0fcf6ac-ba4a-470e-9416-33cc4b6653ce-0 temp LIMIT 0, 20000"}
;

-- 第六组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_function_partition_superior_space_number*1..1]->
(function_partition:/hxyy/function_partition) 
RETURN function_partition.id AS "function_partition_id" 
INTO /temp_function_partition_count_a6cb412b-f104-4319-9d39-28da7f2e51b5-1 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

{"sql":"SELECT count(temp.function_partition_id) AS \"function_partition_count\" FROM /temp_function_partition_count_a6cb412b-f104-4319-9d39-28da7f2e51b5-1 temp LIMIT 0, 20000"}
;

-- 第七组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room) 
RETURN room.using_department AS "department", room.name AS "_hxyy_room_name_0" 
INTO /temp_departments_1847a806-643d-4785-a812-f5764c8893ab-0 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

{"sql":"SELECT DISTINCT temp.department AS \"department\", temp._hxyy_room_name_0 AS \"_hxyy_room_name_0\" FROM /temp_departments_1847a806-643d-4785-a812-f5764c8893ab-0 temp LIMIT 0, 20000"}
;

-- 第八组：

MATCH (building:/hxyy/building)
-[:building_unique_number_to_building_partition_superior_space_number*1..1]->
(building_partition:/hxyy/building_partition)
-[:building_partition_unique_number_to_floor_superior_space_number*1..1]->
(floor:/hxyy/floor)
-[:floor_unique_number_to_floor_partition_superior_space_number*1..1]->
(floor_partition:/hxyy/floor_partition)
-[:floor_partition_unique_number_to_room_superior_space_number*1..1]->
(room:/hxyy/room WHERE space_purpose like '*卫生间*') 
RETURN room.id AS "room_id" 
INTO /temp_rooms_8e3d7f2a-4b5a-4e8f-9f2c-1e3b4c5d6e7f_2565c48c-67d7-459f-a2a5-b9f064c6799b-0 
WITH TIMEOUT = 6m
/**
fork(a)
**/
;

{"sql":"SELECT count(temp.room_id) AS \"room_count\" FROM /temp_rooms_8e3d7f2a-4b5a-4e8f-9f2c-1e3b4c5d6e7f_2565c48c-67d7-459f-a2a5-b9f064c6799b-0 temp LIMIT 0, 20000"}
;

/**
wait(a)
**/
;
