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.

22 lines
1.1 KiB

7 days ago
# -*- coding: utf-8 -*-
"""票 05:复活 F14 seed 商机(被此前清场软删)+ 状态复位推进中(2)。"""
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()
ids = ['748556125825138688', '748556126794022912', '748556129620983808',
'748556131550363648', '748556132468916224', '748556137065873408',
'748556138085089280']
idlist = ','.join(ids)
cur.execute(f'UPDATE opportunity SET deleted=0 WHERE id IN ({idlist}) AND deleted=1')
print('revived:', cur.rowcount)
# F14 各用例期望 seed 商机初始=推进中(2)(C1 曾被 close 留在 4)
cur.execute(f'UPDATE opportunity SET opp_status=2 WHERE id IN ({idlist}) AND opp_status NOT IN (1,2)')
print('status reset to 2:', cur.rowcount)
cur.execute(f'SELECT id, opp_name, opp_status, deleted FROM opportunity WHERE id IN ({idlist})')
for r in cur.fetchall():
print(r)
conn.close()