# -*- encoding=utf8 -*-


import pymysql

class delByBranchId(object):

    def Delete_branch_by_id(self,id):
        connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
                                     charset="utf8")
        cursor = connection.cursor()
        # 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据
        sql = "DELETE from mcms_branch_info where id = '%s';" % id
        print(sql)
        cursor.execute(sql)
        cursor.execute("commit;")
        print('%s院区数据已删除成功' % id)
        cursor.close()


# delByBranchId().Delete_branch_by_name('11122222')