17 lines
790 B
Python
17 lines
790 B
Python
# -*- coding: utf-8 -*-
|
|
"""只读审计:161/zentao_dev_2026 中所有 user_story 悬空的研发需求。"""
|
|
import io, sys, pymysql
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
DST = dict(host='192.168.1.161', user='devgps', password='dev@2021GPS',
|
|
database='zentao_dev_2026', charset='utf8mb4', connect_timeout=15)
|
|
conn = pymysql.connect(**DST); cur = conn.cursor()
|
|
cur.execute("""SELECT s.id, s.user_story, LEFT(s.title,36), s.deleted
|
|
FROM zt_story s LEFT JOIN zt_story_user u ON u.id = s.user_story
|
|
WHERE s.user_story IS NOT NULL AND s.user_story != 0 AND u.id IS NULL
|
|
ORDER BY s.id""")
|
|
rows = cur.fetchall()
|
|
print(f'悬空引用研发需求数: {len(rows)}')
|
|
for r in rows:
|
|
print(' ', r)
|
|
conn.close()
|