|
@@ -16,6 +16,7 @@ from models import *
|
|
|
from utils import *
|
|
|
from utils.spatial import *
|
|
|
from utils.ry_system_util import *
|
|
|
+from utils.video_util import *
|
|
|
import json
|
|
|
import traceback
|
|
|
|
|
@@ -27,7 +28,21 @@ def get_add_data(keyword:str ,db :Session):
|
|
|
return [{"id":i.id,"name":i.name,"dataType":i.dataType,"area":i.area,"longitude":i.longitude,"latitude":i.latitude,"address":i.address} for i in db.execute(sql).all()]
|
|
|
def get_video_data(keyword:str ,db :Session):
|
|
|
sql = text("""SELECT T1.*,T2.dict_label FROM point_data T1 LEFT JOIN (SELECT * FROM `sys_dict_data` WHERE `dict_type`='point_type') T2 on T1.dataType=T2.dict_value where T1.dataType in (30,31,32,33,34) and ( T1.id like '%{keyword}%' or T1.`name` like '%{keyword}%') """.replace("{keyword}",keyword))
|
|
|
- return [{"id":i.id,"name":i.name,"dataType":i.dataType,"area":i.area,"longitude":i.longitude,"latitude":i.latitude,"address":i.address,"dict_label":i.dict_label} for i in db.execute(sql).all()]
|
|
|
+ result = []
|
|
|
+ for i in db.execute(sql).all():
|
|
|
+ tag = []
|
|
|
+ for info in get_video_tag_list(db, i.id):
|
|
|
+ tag_info = get_dict_data_info(db, info.dict_type, info.dict_value)
|
|
|
+ tag.append({"id": info.id,
|
|
|
+ "video_code": i.id,
|
|
|
+ "dict_type": info.dict_type,
|
|
|
+ "dict_value": info.dict_value,
|
|
|
+ "dict_label": tag_info.dict_label,
|
|
|
+ "dict_code": tag_info.dict_code})
|
|
|
+ result.append({"id": i.id, "name": i.name, "dataType": i.dataType, "area": i.area, "longitude": i.longitude,
|
|
|
+ "latitude": i.latitude, "address": i.address, "tag_info":tag}) #"dict_label": i.dict_label,
|
|
|
+
|
|
|
+ return result
|
|
|
def get_point_data(keyword:str ,db :Session):
|
|
|
sql = text("""SELECT T1.*,T2.dict_label FROM point_data T1 LEFT JOIN (SELECT * FROM `sys_dict_data` WHERE `dict_type`='point_type') T2 on T1.dataType=T2.dict_value where (T2.dict_label like '%{keyword}%' or T1.`name` like '%{keyword}%')""".replace("{keyword}",keyword))
|
|
|
return [{"id":i.id,"name":i.name,"dataType":i.dataType,"area":i.area,"longitude":i.longitude,"latitude":i.latitude,"address":i.address,"dict_label":i.dict_label} for i in db.execute(sql).all()]
|