12345678910111213141516171819202122232425262728293031 |
- import os
- import sys
- from datetime import datetime, timedelta
- sys.path.append(os.getcwd())
- from common import MysqlHelper
- class sqlCollect():
- """
- 视频信息写入库中
- """
- @classmethod
- def update_task_tencent_material(cls, video_id, oss_object_key):
- insert_sql = f"""UPDATE ad_put_tencent_material_upload_handle SET video_after_path = '{oss_object_key}', processe_node = 1 WHERE video_id = {video_id};"""
- MysqlHelper.update_values(
- sql=insert_sql
- )
- """
- 判断该任务id是否用过
- """
- @classmethod
- def is_video_id(cls):
- current_time = datetime.now()
- formatted_time = current_time.strftime("%Y-%m-%d")
- sql = f"""SELECT video_id, video_before_path FROM ad_put_tencent_material_upload_handle WHERE processe_node = '0' AND update_time LIKE '{formatted_time}%' AND is_delete = 0;"""
- data = MysqlHelper.get_values(sql)
- return data
|