You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.1 KiB

1 week ago
# -*- coding: utf-8 -*-
"""票 05:seed 全量状态复位(按名字语义)——F14 开跑前置。"""
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pymysql
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
database='crm', charset='utf8mb4', autocommit=True)
cur = conn.cursor()
# F14 需求:A1/A2/B1/B2/C1/C2=推进2(release/claim/close 操作对象);APL/BPL=公海1(assign/claim-batch)
plan = [
('e2e-A-推进-%', 2), ('e2e-B-推进-%', 2), ('e2e-C-推进-%', 2),
('e2e-A-公海-%', 1), ('e2e-B-公海-%', 1),
('e2e-A-暂缓-%', 3), ('e2e-B-暂缓-%', 3),
('e2e-A-关闭-%', 4), ('e2e-B-关闭-%', 4),
]
for pat, st in plan:
cur.execute('UPDATE opportunity SET opp_status=%s, deleted=0 WHERE opp_name LIKE %s', (st, pat))
print(f'{pat} -> {st} (affected={cur.rowcount})')
cur.execute("SELECT id, opp_name, opp_status FROM opportunity WHERE opp_name LIKE 'e2e-%' ORDER BY create_time")
for r in cur.fetchall():
print(r)
conn.close()