37 lines
830 B
Python
37 lines
830 B
Python
"""查询保密承诺书相关的模板记录"""
|
|
import pymysql
|
|
|
|
DB_CONFIG = {
|
|
'host': '152.136.177.240',
|
|
'port': 5012,
|
|
'user': 'finyx',
|
|
'password': '6QsGK6MpePZDE57Z',
|
|
'database': 'finyx',
|
|
'charset': 'utf8mb4'
|
|
}
|
|
|
|
TENANT_ID = 615873064429507639
|
|
|
|
conn = pymysql.connect(**DB_CONFIG)
|
|
cursor = conn.cursor(pymysql.cursors.DictCursor)
|
|
|
|
cursor.execute("""
|
|
SELECT id, name, file_path, parent_id
|
|
FROM f_polic_file_config
|
|
WHERE tenant_id = %s AND name LIKE %s
|
|
ORDER BY name
|
|
""", (TENANT_ID, '%保密承诺书%'))
|
|
|
|
results = cursor.fetchall()
|
|
print(f"找到 {len(results)} 条记录:\n")
|
|
for r in results:
|
|
print(f"ID: {r['id']}")
|
|
print(f"名称: {r['name']}")
|
|
print(f"文件路径: {r['file_path']}")
|
|
print(f"父节点ID: {r['parent_id']}")
|
|
print()
|
|
|
|
cursor.close()
|
|
conn.close()
|
|
|