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.
 
 
 
 
 
 

18 lines
817 B

# -*- coding: utf-8 -*-
"""票 05 诊断:F14 seed 商机存活状态。"""
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 = ['748556137065873408', '748556138085089280', '748556125825138688',
'748556132468916224', '748556129620983808', '748556126794022912',
'748556131550363648']
cur.execute('SELECT id, opp_name, opp_status, deleted FROM opportunity WHERE id IN (%s)' %
','.join(ids))
for r in cur.fetchall():
print(r)
cur.execute("SELECT COUNT(*) FROM opportunity WHERE deleted=0")
print('存活商机总数 =', cur.fetchone()[0])
conn.close()