|
@@ -28,12 +28,13 @@ def get_project_models(project_id,building_id):
|
|
"id,name,local_id,local_name,sequence_id,model_id,building_id,project_id " \
|
|
"id,name,local_id,local_name,sequence_id,model_id,building_id,project_id " \
|
|
"from floor " \
|
|
"from floor " \
|
|
"where project_id='%s' " \
|
|
"where project_id='%s' " \
|
|
- "order by sequence_id desc"\
|
|
|
|
- %(project_id)
|
|
|
|
-
|
|
|
|
- #"and ('%s' is null or building_id='%s') " \
|
|
|
|
|
|
+ "and ('%s' is null or building_id='%s') " \
|
|
|
|
+ "order by sequence_id desc" \
|
|
|
|
+ % (project_id, building_id, building_id)
|
|
# "order by sequence_id desc"\
|
|
# "order by sequence_id desc"\
|
|
- # %(project_id,building_id,building_id)
|
|
|
|
|
|
+ # %(project_id)
|
|
|
|
+
|
|
|
|
+
|
|
COMPONENT_KEYS = [
|
|
COMPONENT_KEYS = [
|
|
'id',
|
|
'id',
|
|
'name',
|
|
'name',
|
|
@@ -289,7 +290,7 @@ def get_connected_block_data(project_id,building_id,block_id,system_name,domain)
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|
|
return element_data
|
|
return element_data
|
|
-def get_connected_block_source_data(project_id,building_id,block_id,system_name,domain):
|
|
|
|
|
|
+def get_connected_block_source_data(project_id,building_id,block_id,system_name,domain,is_source):
|
|
'''
|
|
'''
|
|
Get all the connected_block source .
|
|
Get all the connected_block source .
|
|
:param project_id:
|
|
:param project_id:
|
|
@@ -303,7 +304,8 @@ def get_connected_block_source_data(project_id,building_id,block_id,system_name,
|
|
"and mep_system_type='%s'" \
|
|
"and mep_system_type='%s'" \
|
|
"and domain='%s'" \
|
|
"and domain='%s'" \
|
|
"and ('%s' is null or building_id='%s')" \
|
|
"and ('%s' is null or building_id='%s')" \
|
|
- % (project_id,block_id,system_name,domain,building_id,building_id)
|
|
|
|
|
|
+ "and is_source=%s" \
|
|
|
|
+ % (project_id,block_id,system_name,domain,building_id,building_id,is_source)
|
|
KEYS = [
|
|
KEYS = [
|
|
'id',
|
|
'id',
|
|
'project_id',
|
|
'project_id',
|
|
@@ -313,6 +315,7 @@ def get_connected_block_source_data(project_id,building_id,block_id,system_name,
|
|
'mep_system_type',
|
|
'mep_system_type',
|
|
'domain',
|
|
'domain',
|
|
'building_id',
|
|
'building_id',
|
|
|
|
+ 'is_source',
|
|
]
|
|
]
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|