|
@@ -134,7 +134,7 @@ class monitorTools:
|
|
|
|
|
|
#高质量库bidding-mongo 每周统计入库数量
|
|
#高质量库bidding-mongo 每周统计入库数量
|
|
def bidding_ai(self):
|
|
def bidding_ai(self):
|
|
- collection = MongoUtil.get_coon(host='127.0.0.1:27088', database='qfw',collection='bidding_ai',authuser='viewdata',authpass='viewdata')
|
|
|
|
|
|
+ collection = MongoUtil.get_coon(host='127.0.0.1:27088', database='qfw_ai',collection='bidding',authuser='viewdata',authpass='viewdata')
|
|
query = { "comeintime": {"$gte": start_date, "$lt": end_date}}
|
|
query = { "comeintime": {"$gte": start_date, "$lt": end_date}}
|
|
count=MongoSentence.count(collection,query)
|
|
count=MongoSentence.count(collection,query)
|
|
print("高质量库bidding-mongo 每周统计入库数量",count)
|
|
print("高质量库bidding-mongo 每周统计入库数量",count)
|
|
@@ -175,10 +175,16 @@ class monitorTools:
|
|
# 'database': 'jianyu_subjectdb',
|
|
# 'database': 'jianyu_subjectdb',
|
|
# 'charset': 'utf8mb4'
|
|
# 'charset': 'utf8mb4'
|
|
# }
|
|
# }
|
|
|
|
+
|
|
|
|
+ now = datetime.now()
|
|
|
|
+ end_date = now.strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
+ start_date = (datetime.now() - timedelta(days=7)).strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
+
|
|
# SQL 查询
|
|
# SQL 查询
|
|
- mysql_query = f"SELECT COUNT(*) FROM dwd_f_nzj_baseinfo WHERE create_time >={start_date} AND create_time <={end_date}"
|
|
|
|
|
|
+ mysql_query = "SELECT COUNT(*) FROM dwd_f_nzj_baseinfo WHERE createtime >= %s AND createtime <= %s"
|
|
|
|
+ params = (start_date, end_date)
|
|
conn=MysqlUtil.connect_to_mysql(host='192.168.3.149',port='4000',user='datagroup',password='Dgrpdb#2024@36',database='jianyu_subjectdb')
|
|
conn=MysqlUtil.connect_to_mysql(host='192.168.3.149',port='4000',user='datagroup',password='Dgrpdb#2024@36',database='jianyu_subjectdb')
|
|
- count=MysqlUtil.execute_sql(conn,mysql_query)
|
|
|
|
|
|
+ count=MysqlUtil.execute_sql(conn,mysql_query,params)
|
|
print("拟在建baseinfo-mysql每周统计入库数量", count)
|
|
print("拟在建baseinfo-mysql每周统计入库数量", count)
|
|
return count
|
|
return count
|
|
|
|
|