Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
50ae7570
Commit
50ae7570
authored
Jul 13, 2020
by
张云飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zyf
parent
cb3d0196
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
ic-name/hanshujisuan.py
+8
-8
No files found.
ic-name/hanshujisuan.py
View file @
50ae7570
...
@@ -51,7 +51,7 @@ print(DB_HOST,DB_HOST,DB_PORT,ES_PORT)
...
@@ -51,7 +51,7 @@ print(DB_HOST,DB_HOST,DB_PORT,ES_PORT)
print
(
type
(
DB_PORT
),
type
(
ES_PORT
))
print
(
type
(
DB_PORT
),
type
(
ES_PORT
))
def
findByType
():
def
findByType
():
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_newcity'
sql
=
'SELECT * FROM gsb_newcity'
# 获取游标
# 获取游标
cursor
=
conn
.
cursor
()
cursor
=
conn
.
cursor
()
...
@@ -132,7 +132,7 @@ def getFrountStrByStr(val, str):
...
@@ -132,7 +132,7 @@ def getFrountStrByStr(val, str):
def
getSensitiveByLike
(
title
):
def
getSensitiveByLike
(
title
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_sensitive WHERE INSTR(title,"{}") or INSTR("{}",title)'
.
format
(
title
,
title
)
sql
=
'SELECT * FROM gsb_sensitive WHERE INSTR(title,"{}") or INSTR("{}",title)'
.
format
(
title
,
title
)
# 获取游标
# 获取游标
cursor
=
conn
.
cursor
()
cursor
=
conn
.
cursor
()
...
@@ -147,7 +147,7 @@ def getSensitiveByLike(title):
...
@@ -147,7 +147,7 @@ def getSensitiveByLike(title):
def
gsbSensitiveMnggetList
(
type
,
pinyin
,
title
):
def
gsbSensitiveMnggetList
(
type
,
pinyin
,
title
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
"SELECT * FROM gsb_sensitive WHERE 1 = 1"
sql
=
"SELECT * FROM gsb_sensitive WHERE 1 = 1"
if
type
!=
None
and
type
!=
""
:
if
type
!=
None
and
type
!=
""
:
sql
+=
" and type ={}"
.
format
(
type
)
sql
+=
" and type ={}"
.
format
(
type
)
...
@@ -168,7 +168,7 @@ def gsbSensitiveMnggetList(type, pinyin, title):
...
@@ -168,7 +168,7 @@ def gsbSensitiveMnggetList(type, pinyin, title):
def
getBrandByLike
(
title
):
def
getBrandByLike
(
title
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_brand WHERE 1 = 1'
sql
=
'SELECT * FROM gsb_brand WHERE 1 = 1'
if
title
!=
None
and
title
!=
""
:
if
title
!=
None
and
title
!=
""
:
sql
+=
" and '{}' like CONCAT('
%
',title,'
%
')"
.
format
(
title
)
sql
+=
" and '{}' like CONCAT('
%
',title,'
%
')"
.
format
(
title
)
...
@@ -185,7 +185,7 @@ def getBrandByLike(title):
...
@@ -185,7 +185,7 @@ def getBrandByLike(title):
def
comNameForBidMnggetList
(
keyword
):
def
comNameForBidMnggetList
(
keyword
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_comnameforbid WHERE 1 = 1'
sql
=
'SELECT * FROM gsb_comnameforbid WHERE 1 = 1'
if
keyword
!=
None
and
keyword
!=
""
:
if
keyword
!=
None
and
keyword
!=
""
:
sql
+=
" and keyword = '{}'"
.
format
(
keyword
)
sql
+=
" and keyword = '{}'"
.
format
(
keyword
)
...
@@ -202,7 +202,7 @@ def comNameForBidMnggetList(keyword):
...
@@ -202,7 +202,7 @@ def comNameForBidMnggetList(keyword):
def
getCityByLike
(
title
,
type
):
def
getCityByLike
(
title
,
type
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_newcity WHERE 1 = 1'
sql
=
'SELECT * FROM gsb_newcity WHERE 1 = 1'
if
type
!=
None
and
type
!=
""
:
if
type
!=
None
and
type
!=
""
:
sql
+=
" and LevelType ={}"
.
format
(
type
)
sql
+=
" and LevelType ={}"
.
format
(
type
)
...
@@ -221,7 +221,7 @@ def getCityByLike(title, type):
...
@@ -221,7 +221,7 @@ def getCityByLike(title, type):
def
getCitys
(
type
,
pinyin
,
title
):
def
getCitys
(
type
,
pinyin
,
title
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'SELECT * FROM gsb_newcity WHERE 1 = 1'
sql
=
'SELECT * FROM gsb_newcity WHERE 1 = 1'
if
type
!=
None
and
type
!=
""
:
if
type
!=
None
and
type
!=
""
:
sql
+=
" and LevelType ={}"
.
format
(
type
)
sql
+=
" and LevelType ={}"
.
format
(
type
)
...
@@ -435,7 +435,7 @@ def getLeveltwo(j):
...
@@ -435,7 +435,7 @@ def getLeveltwo(j):
def
qccdb
(
seltime
,
cityname
,
keyword
,
btname
,
orgname
,
qccjson
):
def
qccdb
(
seltime
,
cityname
,
keyword
,
btname
,
orgname
,
qccjson
):
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
name-config
"
)
conn
=
pymysql
.
connect
(
host
=
DB_HOST
,
port
=
DB_PORT
,
user
=
DB_USER
,
password
=
DB_PWD
,
db
=
"brg-ic
-name
"
)
sql
=
'INSERT INTO qcclog(seltime,cityname,keyword,btname,orgname,qccjson) VALUES ("
%
s","
%
s","
%
s","
%
s","
%
s","
%
s")'
%
(
sql
=
'INSERT INTO qcclog(seltime,cityname,keyword,btname,orgname,qccjson) VALUES ("
%
s","
%
s","
%
s","
%
s","
%
s","
%
s")'
%
(
seltime
,
cityname
,
keyword
,
btname
,
orgname
,
qccjson
)
seltime
,
cityname
,
keyword
,
btname
,
orgname
,
qccjson
)
cursor
=
conn
.
cursor
()
cursor
=
conn
.
cursor
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment