#!/usr/bin/env python
# -*- coding:utf-8 -*- 
# Author: hj
# softWare:pycharm
# fileName:crm_change_standard.py
# createTime:2020/7/10 16:11

from DBUtils.PooledDB import PooledDB
import pymysql


MYSQL_HOST = '47.95.76.74'  # 外网地址
PORT = 3306  # 外网端口
USER = 'root'
PASSWORD = 'Gongsibao2018'
DB = 'ent_data'
pool = PooledDB(pymysql, 8, host=MYSQL_HOST, user=USER, passwd=PASSWORD, db=DB, port=PORT)

"""获取公司的标准公司名称"""
def getStandardName(crm_company_name):
    conn = pool.connection()
    cursor = conn.cursor(pymysql.cursors.DictCursor)
    sql = 'select * from tj_provide_company where crm_company_name = "%s"' % crm_company_name
    print(sql)
    cursor.execute(sql)
    customer_info = cursor.fetchall()
    for row in customer_info:
        standard_company_name = row['standard_company_name']
        print(standard_company_name)
        return standard_company_name

# print(getStandardName("一起住好房（北京）网络科技有限公司"))