Commit 39be1b02 by 岳巧源

sql modify

parent bcd55da6
...@@ -114,3 +114,30 @@ db=liexin_purchase ...@@ -114,3 +114,30 @@ db=liexin_purchase
采购---------------- 采购----------------
--------------------------------------------------线上
[db_crmv2]
host=trading-master.ichunt.db
user=LxCrmUserV2
passwd="xUTmu0XsdUqoZIim2yV2"
db=liexin_crm
-------------------------------------
[db_liexin]
host=172.18.137.21
user=huntdbuser
passwd='mLssy2@@!!@$#yy'
db=hunt2016
----------------------------------------
[db_purchase]
host=trading-master.ichunt.db
user=PurUxts
passwd=sxmsgxt0t2025067A03AtIljs
db=liexin_purchase
-------------------------
import json import json
import mysql.connector import mysql.connector
import pymysql
import requests import requests
import logging import logging
# 线上地址需要更改 # 线上地址需要更改
dev_url = "http://united_data.liexindev.net/sync/Address/updateAddress" #测试环境url dev_url = "http://united_data.ichunt.net/sync/Address/updateAddress" #测试环境url
prod_url = "" #生产环境 prod_url = "" #生产环境
#日志配置 #日志配置
...@@ -16,12 +17,29 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve ...@@ -16,12 +17,29 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve
def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str: def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str:
db = mysql.connector.connect( # db = mysql.connector.connect(
host="232.db.liexindev.me", # host="232.db.liexindev.me",
user="liexin", # user="liexin",
password="liexin#zsyM", # password="liexin#zsyM",
database="liexin" # database="liexin"
) # )
conf = {
'host': "172.18.137.21",
'port': 3306,
'user': "huntdbuser",
'password': "mLssy2@@!!@$#yy",
'db': "hunt2016",
'charset': 'utf8'
}
# conf = {
# 'host': "232.db.liexindev.me",
# 'port': 3306,
# 'user': "liexin",
# 'password': "liexin#zsyM",
# 'db': "liexin",
# 'charset': 'utf8'
# }
db = pymysql.connect(**conf)
sql1 = "select region_name from lie_region where region_id = " + str(province) sql1 = "select region_name from lie_region where region_id = " + str(province)
sql2 = "select region_name from lie_region where region_id = " + str(city) sql2 = "select region_name from lie_region where region_id = " + str(city)
sql3 = "select region_name from lie_region where region_id = " + str(district) sql3 = "select region_name from lie_region where region_id = " + str(district)
...@@ -56,12 +74,21 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det ...@@ -56,12 +74,21 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det
######################################################################### #########################################################################
def crm(): def crm():
db = mysql.connector.connect( # db = mysql.connector.connect(
host="master.db2.liexindev.me", # host="trading-master.ichunt.db",
user="liexin_crmv2", # user="LxCrmUserV2",
password="liexin_crmv2#zsyM", # password="xUTmu0XsdUqoZIim2yV2",
database="liexin_crmv2" # database="liexin_crm"
) # )
conf = {
'host': "trading-master.ichunt.db",
'port': 3306,
'user': "LxCrmUserV2",
'password': "xUTmu0XsdUqoZIim2yV2",
'db': "liexin_crm",
'charset': 'utf8'
}
db = pymysql.connect(**conf)
cursor = db.cursor() cursor = db.cursor()
cursor.execute( cursor.execute(
"select com_name, business_license_src, creator_id, creator_name, id, com_addr from lie_company where com_category in (0, 1)") "select com_name, business_license_src, creator_id, creator_name, id, com_addr from lie_company where com_category in (0, 1)")
......
import json import json
import mysql.connector import mysql.connector
import pymysql
import requests import requests
import logging import logging
# 线上地址需要更改 # 线上地址需要更改
dev_url = "http://united_data.liexindev.net/sync/Address/updateAddress" #测试环境url dev_url = "http://united_data.ichunt.net/sync/Address/updateAddress" #测试环境url
prod_url = "" #生产环境 prod_url = "" #生产环境
#日志配置 #日志配置
...@@ -16,12 +17,15 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve ...@@ -16,12 +17,15 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve
def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str: def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str:
db = mysql.connector.connect( conf = {
host="232.db.liexindev.me", 'host': "172.18.137.21",
user="liexin", 'port': 3306,
password="liexin#zsyM", 'user': "huntdbuser",
database="liexin" 'password': "mLssy2@@!!@$#yy",
) 'db': "hunt2016",
'charset': 'utf8'
}
db = pymysql.connect(**conf)
sql1 = "select region_name from lie_region where region_id = " + str(province) sql1 = "select region_name from lie_region where region_id = " + str(province)
sql2 = "select region_name from lie_region where region_id = " + str(city) sql2 = "select region_name from lie_region where region_id = " + str(city)
sql3 = "select region_name from lie_region where region_id = " + str(district) sql3 = "select region_name from lie_region where region_id = " + str(district)
...@@ -54,12 +58,15 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det ...@@ -54,12 +58,15 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det
###################################################### ######################################################
def liexin(): def liexin():
db = mysql.connector.connect( conf = {
host="232.db.liexindev.me", 'host': "172.18.137.21",
user="liexin", 'port': 3306,
password="liexin#zsyM", 'user': "huntdbuser",
database="liexin" 'password': "mLssy2@@!!@$#yy",
) 'db': "hunt2016",
'charset': 'utf8'
}
db = pymysql.connect(**conf)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("select tax_title, business_license, tax_id, user_sn, company_address, consignee_province, consignee_city, consignee_district, consignee_address, uc_id from lie_taxinfo") cursor.execute("select tax_title, business_license, tax_id, user_sn, company_address, consignee_province, consignee_city, consignee_district, consignee_address, uc_id from lie_taxinfo")
result = cursor.fetchall() result = cursor.fetchall()
......
import json import json
import mysql.connector import mysql.connector
import pymysql
import requests import requests
import logging import logging
# 线上地址需要更改 # 线上地址需要更改
dev_url = "http://united_data.liexindev.net/sync/Address/updateAddress" #测试环境url dev_url = "http://united_data.ichunt.net/sync/Address/updateAddress" #测试环境url
prod_url = "" #生产环境 prod_url = "" #生产环境
#日志配置 #日志配置
...@@ -16,12 +17,15 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve ...@@ -16,12 +17,15 @@ logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(leve
def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str: def get_user_detail_address_by_code(province: int, city: int, district: int, detail_address: str) -> str:
db = mysql.connector.connect( conf = {
host="232.db.liexindev.me", 'host': "172.18.137.21",
user="liexin", 'port': 3306,
password="liexin#zsyM", 'user': "huntdbuser",
database="liexin" 'password': "mLssy2@@!!@$#yy",
) 'db': "hunt2016",
'charset': 'utf8'
}
db = pymysql.connect(**conf)
sql1 = "select region_name from lie_region where region_id = " + str(province) sql1 = "select region_name from lie_region where region_id = " + str(province)
sql2 = "select region_name from lie_region where region_id = " + str(city) sql2 = "select region_name from lie_region where region_id = " + str(city)
sql3 = "select region_name from lie_region where region_id = " + str(district) sql3 = "select region_name from lie_region where region_id = " + str(district)
...@@ -52,12 +56,15 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det ...@@ -52,12 +56,15 @@ def get_user_detail_address_by_code(province: int, city: int, district: int, det
def pur(): def pur():
db = mysql.connector.connect( conf = {
host="master.db2.liexindev.me", 'host': "trading-master.ichunt.db",
user="liexin_purchase", 'port': 3306,
password="liexin_purchase#zsyM", 'user': "PurUxts",
database="liexin_purchase" 'password': "sxmsgxt0t2025067A03AtIljs",
) 'db': "liexin_purchase",
'charset': 'utf8'
}
db = pymysql.connect(**conf)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("select end_cust_cn, end_cust_en, create_uid, create_name, end_cust_id, com_addr from lie_end_cust_info") cursor.execute("select end_cust_cn, end_cust_en, create_uid, create_name, end_cust_id, com_addr from lie_end_cust_info")
result = cursor.fetchall() result = cursor.fetchall()
......
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 sign in to comment