Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sanshi
zmops-test
Commits
b732df2d
Commit
b732df2d
authored
Dec 04, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经验手册涉及数据库
parent
1b9acb0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
Administrator.xml
.idea/dictionaries/Administrator.xml
+1
-0
experience_tag.py
WorkData/Argus/experience_tag.py
+56
-0
No files found.
.idea/dictionaries/Administrator.xml
View file @
b732df2d
...
...
@@ -80,6 +80,7 @@
<w>
sortid
</w>
<w>
sortorder
</w>
<w>
tablename
</w>
<w>
tagid
</w>
<w>
templated
</w>
<w>
templateid
</w>
<w>
templateids
</w>
...
...
WorkData/Argus/experience_tag.py
0 → 100644
View file @
b732df2d
# -*- coding: utf_8 -*-
# 表名: experience_tag
# 作者: 陈磊
# 时间: 2019-12-03
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy
import
Column
,
Integer
,
VARCHAR
,
SMALLINT
,
DATETIME
,
DECIMAL
,
BigInteger
,
FLOAT
,
NUMERIC
,
TEXT
from
sqlalchemy.orm.exc
import
MultipleResultsFound
,
NoResultFound
from
sqlalchemy
import
or_
from
WorkUtils.UtilsLog
import
UtilsLog
from
WorkUtils.UtilsDataBase
import
UtilsDataBase
import
time
Base
=
declarative_base
()
class
ExperienceTag
(
Base
):
"""
经验手册与标签关系
"""
__tablename__
=
"experience_tag"
id
=
Column
(
BigInteger
,
primary_key
=
True
)
experienceid
=
Column
(
BigInteger
,
comment
=
"经验手册ID"
)
tagid
=
Column
(
BigInteger
,
comment
=
"标记ID"
)
class
DataExperienceTag
(
object
):
def
__init__
(
self
):
self
.
log
=
UtilsLog
()
self
.
log
.
info
(
self
.
__class__
)
self
.
table
=
ExperienceTag
def
select_all_from_allKeys
(
self
,
session
,
experienceid
=
None
):
"""
:param session: 指针
:param experienceid:
:return: 查询结果
"""
self
.
log
.
debug
(
"查询数据库:"
)
try
:
base
=
UtilsDataBase
()
base
.
add_param
(
_key
=
"experienceid"
,
value
=
experienceid
)
sql_rep
=
session
.
query
(
self
.
table
)
.
filter_by
(
**
base
.
param
)
.
all
()
self
.
log
.
debug
(
sql_rep
)
session
.
close
()
return
sql_rep
except
UtilsDataBase
()
.
errors
as
error
:
self
.
log
.
error
(
"异常:"
)
self
.
log
.
error
(
error
)
session
.
close
()
return
error
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