# -*- encoding=utf8 -*-


import pymysql

class delKindGoodsinfo(object):

    def delKindGoodsinfo(self):
        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_goods_kind_collection where kind_id=(select id from mcms_goods_kind where kind_name='9999_2');"
        print(sql)
        cursor.execute(sql)
        cursor.execute("commit;")
        print('耗材分类下的产品删除完毕' )
        cursor.close()
    def delkind(self):
        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_goods_kind where kind_code in('9999','9999_2');"
        print(sql)
        cursor.execute(sql)
        cursor.execute("commit;")
        print('耗材分类删除完毕')



# delByBranchId().Delete_branch_by_name('11122222')