You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
763 B
Python
32 lines
763 B
Python
from website.handler import BaseHandler
|
|
from sqlalchemy import text
|
|
from typing import Any
|
|
|
|
# 获取企业模型数量
|
|
def get_enterprise_model_count(id: int) -> int:
|
|
|
|
return 0
|
|
|
|
|
|
# 获取企业设备数量
|
|
def get_enterprise_device_count(id: int) -> int:
|
|
return 0
|
|
|
|
|
|
# 获取所有企业实体数量
|
|
def get_enterprise_entity_count(engine: Any) -> int:
|
|
with engine.connect() as conn:
|
|
count_sql_text = "select count(id) from enterprise "
|
|
count = conn.execute(text(count_sql_text)).fetchone()
|
|
if count:
|
|
return count[0]
|
|
|
|
return 0
|
|
|
|
# 获取所有企业模型数量
|
|
def get_enterprise_model_count() -> int:
|
|
return 0
|
|
|
|
# 获取所有企业设备数量
|
|
def get_enterprise_device_count() -> int:
|
|
return 0 |