# -*- coding: utf-8 -*-
# 数据库测试
# 作者: 陈磊
# 时间: 2019-10-21


from WorkData.Argus.hosts import DataHosts


from WorkUtils.UtilsDataBase import UtilsDataBase


# url = "192.168.1.180"
# port = 3306
# user = "root"
# password = "root"

url = "10.0.0.155"
port = 3306
user = "root"
password = "123456"

base = "argus"
# base = "mmt-after"
s = UtilsDataBase().conn_mysql(db_url=url, db_port=port, db_user=user, db_pw=password, db_base=base)

DataHosts().insert_one(session=s, host_name="测试", )
# for x, y in enumerate(r):
#     print(y.name)




# DataCustomerWxData().insert_one(
#     session=s, customer_id=115216, _type=1, appid="test", openid="1"
# )
# for x in range(1, 51):
#
#     print(x)
#     DataUserInfo().insert_one(session=s, _id=b+str(base_phone+x), name="cl测试"+str(x), _type="1", mobile=base_phone+x, agent_no="MMTCl"+str(base_phone+x),
#                               up_user_id="00003ace77a84250ab8ef19600010002", up_up_user_id="1464ae4e42c14a4786d5cffa2cb1c73b")

# DataUserInfo().insert_one(session=s, _id=str(b)+str(base_phone), name="下级代理2", _type="2", mobile=base_phone, agent_no="MMTCL"+str(base_phone),
#                           up_user_id="00003ace77a84250ab8ef19600010001", up_up_user_id="1c5230248b9e4c3f8c006cee401980a1")
# r = DataUserInfo().select_one_from_phone(session=s, mobile=15151969022)
# print(r.id)

# DataAfterComplain().select_group_by(session=s)