| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import mysql.connector
- from decimal import Decimal
- import datetime
- DB_CONFIG = {
- 'user': 'root',
- 'password': '84853032',
- 'host': '47.99.60.80',
- 'port': 3306,
- 'database': '2022hs060',
- 'use_pure': True,
- 'connect_timeout': 5
- }
- def check_bq():
- try:
- conn = mysql.connector.connect(**DB_CONFIG)
- cursor = conn.cursor(dictionary=True)
-
- # Check table columns
- print("Checking columns of mp_construction_measure_bq:")
- cursor.execute("DESCRIBE mp_construction_measure_bq")
- cols = cursor.fetchall()
- for col in cols:
- print(f"{col['Field']} - {col['Type']}")
- # Check count for a known completed order
- # User provided ID: 1819285928247525377
- target_id = '1819285928247525377'
- print(f"\nChecking BQs for target order {target_id}:")
- cursor.execute(f"SELECT COUNT(*) as cnt FROM mp_construction_measure_bq WHERE mp_measure_id = '{target_id}'")
- cnt = cursor.fetchone()
- print(f"Count: {cnt['cnt']}")
-
- # Check order existence
- cursor.execute(f"SELECT * FROM mp_measure_order WHERE id = '{target_id}'")
- order = cursor.fetchone()
- if order:
- print(f"Order found. Status: {order['status']}")
- else:
- print("Order NOT found.")
-
- conn.close()
- except Exception as e:
- print(e)
- if __name__ == "__main__":
- check_bq()
|