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.
26 lines
1.2 KiB
26 lines
1.2 KiB
|
7 days ago
|
# -*- coding: utf-8 -*-
|
||
|
|
"""票 02 修改 3 前置验证:确认 C2(医院护理呼叫系统)owner_dept 非冠军团队,
|
||
|
|
可作为 U02 禁领段替换 B1 的非冠军团队商机。"""
|
||
|
|
import io
|
||
|
|
import sys
|
||
|
|
|
||
|
|
import pymysql
|
||
|
|
|
||
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||
|
|
|
||
|
|
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
|
||
|
|
database='crm', charset='utf8mb4', autocommit=True)
|
||
|
|
cur = conn.cursor()
|
||
|
|
cur.execute('''SELECT o.id, o.opp_name, o.owner_dept_id, o.opp_status
|
||
|
|
FROM opportunity o WHERE o.opp_name LIKE %s AND o.deleted=0''', ('%医院护理呼叫%',))
|
||
|
|
print('C2:', cur.fetchone())
|
||
|
|
cur.execute('''SELECT o.id, o.opp_name, o.owner_dept_id, o.opp_status
|
||
|
|
FROM opportunity o WHERE o.opp_name LIKE %s AND o.deleted=0''', ('%会议系统扩容%',))
|
||
|
|
print('B1:', cur.fetchone())
|
||
|
|
# 冠军团队 deptId(来自 pool_rules 绑定)
|
||
|
|
cur.execute('''SELECT rd.dept_id FROM opportunity_pool_rule r
|
||
|
|
JOIN opportunity_pool_rule_dept rd ON rd.rule_id = r.id
|
||
|
|
WHERE r.rule_name = %s''', ('e2e-seed冠军团队禁领',))
|
||
|
|
print('禁领规则绑定部门:', cur.fetchall())
|
||
|
|
conn.close()
|