# -*- 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")
        # 内网切换数据库
        connection = pymysql.connect(host="10.17.65.49", port=30017, user="root", password="H-pV2d-1-N0z",
                                     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")
        # 内网切换数据库
        connection = pymysql.connect(host="10.17.65.49", port=30017, user="root", password="H-pV2d-1-N0z",
                                     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')