Commit 80385be8 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

增加删除院区数据库处理类和函数

parent 5c456ab7
# -*- encoding=utf8 -*-
import pymysql
class delByBranchId(object):
def Delete_branch_by_name(self,id):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Gyxc.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)
# delByBranchId().Delete_branch_by_name('11122222')
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment