Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
80385be8
Commit
80385be8
authored
Oct 13, 2023
by
xiao-hesheng
Browse files
增加删除院区数据库处理类和函数
parent
5c456ab7
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/db/sql/sql_del_branch_info.py
0 → 100644
View file @
80385be8
# -*- 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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment