feat: 根目录文档、脚本、gitignore

This commit is contained in:
2026-10-08 16:15:33 +08:00
commit e98660ce4e
284 changed files with 26838 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
"""排查 200 库 story 9209:上传 MD 落到附件问题(只读查询,绝不写入)"""
import io, sys, pymysql
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
conn = pymysql.connect(host='192.168.3.200', user='root', password='PX4fTAAsJ#T!1',
database='zentao_dev', charset='utf8mb4', connect_timeout=15)
cur = conn.cursor()
def show(title, sql, args=None):
print(f"\n===== {title} =====")
cur.execute(sql, args or ())
cols = [d[0] for d in cur.description]
print(' | '.join(cols))
for row in cur.fetchall():
print(' | '.join('NULL' if v is None else str(v) for v in row))
# 1) 需求本体(含二期扩展列,先看有哪些列)
show("zt_story 9209 全部列", "SHOW COLUMNS FROM zt_story")
show("zt_story 9209 本体", "SELECT * FROM zt_story WHERE id=9209")
# 2) 附件记录:9209 相关的所有 zt_file
show("zt_file objectID=9209 全类型",
"SELECT id, objectType, objectID, title, extension, size, addedBy, addedDate, url, extra, deleted FROM zt_file WHERE objectID=9209 ORDER BY id DESC")
# 3) 对照组:9130(历史验证过的)的 file 记录类型分布
show("zt_file 近期 ai 上传的 md 记录(全库对照)",
"SELECT id, objectType, objectID, title, extension, addedBy, addedDate, url FROM zt_file WHERE extension='md' ORDER BY id DESC LIMIT 20")
# 4) zt_story_expand 9209
try:
show("zt_story_expand 9209", "SELECT * FROM zt_story_expand WHERE story=9209 OR id=9209 LIMIT 5")
except Exception as e:
print("zt_story_expand 查询失败:", e)
conn.close()