#!/usr/bin/python
# -*- coding: UTF-8 -*-
import pymysql
from openpyxl import load_workbook
# sql=" select * from saas_school_type where schoolId=3408260001 "
updateSql=" update saas_school_type set customerService=%s where schoolId=%s "
db = pymysql.connect(host = 'rdsmrrjuqmrrjuq758.mysql.rds.aliyuncs.com', port = 3268, user = 'zl_cicada', passwd = '04zHiliao_01', db = 'kidscare', charset="utf8")
cursor = db.cursor()
# cursor.execute(sql)
# sqlList = cursor.fetchone()
# print(sqlList[0])
wb = load_workbook(filename='/Users/chanming/Desktop/园所匹配客成-1219.xlsx', read_only=True)
ws = wb['Sheet1']
sn={}
for row in ws.rows:
sn[row[0].value]=row[2].value
for key,value in sn.items():
print(key),
print(value)
cursor.execute(updateSql,(value,key))
db.commit()
cursor.close()
db.close()