Commit 22bcaa40 authored by 张彦钊's avatar 张彦钊

修改测试文件

parent 01ddd56f
......@@ -119,9 +119,10 @@ def location_to_csv():
df.to_csv('/tmp/device/location.csv', index=False)
def meigou_tag_to_csv():
sql = "select service_id,tag_id from meigou_tag"
sql = "select a.service_id,b.name,a.tag_id from api_servicetag a left join api_tag b on a.tag_id = b.id " \
"where b.tag_type <= '3'"
df = pd.DataFrame(list(get_mysql_data(host, port, user, passwd, db, sql)))
df = df.rename(columns={0: "service_id", 1: "tag_id"})
df = df.rename(columns={0: "service_id", 1: "name",2:"tag_id"})
df.to_csv('/tmp/device/meigou_tag.csv', index=False)
......@@ -139,7 +140,7 @@ if __name__ == "__main__":
passwd = "BJQaT9VzDcuPBqkd"
db = "zhengxing"
yconnect = create_engine('mysql+pymysql://root:3SYz54LS9#^9sBvC@172.16.40.170:4000/jerry_test?charset=utf8')
hospital_to_csv()
meigou_tag_to_csv()
print("end")
# host = "172.16.40.170"
......
Markdown is supported
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