Commit 9e3b445b authored by 赵威's avatar 赵威

update db

parent 763a67e3
......@@ -70,8 +70,8 @@ def _get_all_by_project(name):
where api_tag.name = '{}')
""".format(name)
zhengxing_conn = pymysql.connect(host="172.16.30.141",
user="work",
password="BJQaT9VzDcuPBqkd",
user="zx_str",
password="ZXueX58pStrage",
database="zhengxing",
charset="utf8")
zhengxing_cursor = zhengxing_conn.cursor()
......
......@@ -90,7 +90,7 @@ def get_all_search_word_synonym_tags():
"left join api_wordrelsynonym b on a.id = b.wordrel_id " \
"left join api_tag c on b.word=c.name " \
"where c.tag_type+0<'4'+0 and c.is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['keyword'] not in result_dict:
......@@ -106,7 +106,7 @@ def get_all_word_synonym_words():
try:
sql = "select a.keyword, b.word from api_wordrel a " \
"left join api_wordrelsynonym b on a.id = b.wordrel_id "
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['keyword'] not in result_dict:
......@@ -125,7 +125,7 @@ def get_all_synonym_tags():
try:
sql = "select a.word, b.id from api_wordrelsynonym a left join api_tag b " \
"on a.word=b.name where b.tag_type+0<'4'+0 and b.is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['word'] not in result_dict:
......@@ -143,7 +143,7 @@ def get_all_api_tags():
"""
try:
sql = "select name, id from api_tag where tag_type in ('1', '2', '3', '5') and is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['name'] not in result_dict:
......@@ -171,7 +171,7 @@ def get_all_tag_tag_type():
"""
try:
sql = "select id,tag_type from api_tag where tag_type+0<'4'+0 and is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
result_dict[data['id']] = data['tag_type']
......@@ -186,7 +186,7 @@ def get_all_3tag_2tag():
" left join api_tag b on a.parent_id=b.id " \
"where a.child_id in (select id from api_tag where tag_type='3' and is_online=1) " \
"and b.tag_type='2' and b.is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['child_id'] not in result_dict:
......@@ -204,7 +204,7 @@ def get_all_tag_parent_tag():
" left join api_tag b on a.parent_id=b.id " \
"where a.child_id in (select id from api_tag where tag_type+0<'4'+0 and is_online=1) " \
"and b.tag_type+0<'4'+0 and b.is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
if data['child_id'] not in result_dict:
......@@ -219,7 +219,7 @@ def get_all_tag_parent_tag():
def get_all_tags_name():
try:
sql = "select id, name from api_tag where tag_type+0<'4'+0 and is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'zx_str', 'ZXueX58pStrage', 'zhengxing', sql)
result_dict = dict()
for data in mysql_results:
result_dict[data['id']] = data['name']
......
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