Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yafangsuo_dataServer
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
yafangsuo_dataServer
Commits
b6b32be9
Commit
b6b32be9
authored
Aug 29, 2023
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ae126d6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
15 deletions
+25
-15
mysqlTableConfig.ts
src/config/mysqlTableConfig.ts
+15
-15
mysqlRouter.ts
src/routers/mysqlRouter.ts
+8
-0
router.ts
src/routers/router.ts
+2
-0
No files found.
src/config/mysqlTableConfig.ts
View file @
b6b32be9
...
@@ -30,7 +30,7 @@ export const TablesConfig = [
...
@@ -30,7 +30,7 @@ export const TablesConfig = [
loginId
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//登录账号
loginId
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//登录账号
pwd
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//密码
pwd
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//密码
token
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
token
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
tokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
}
tokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
,
defaultValue
:
Sequelize
.
NOW
}
},
},
association
:
[]
association
:
[]
},
},
...
@@ -44,30 +44,30 @@ export const TablesConfig = [
...
@@ -44,30 +44,30 @@ export const TablesConfig = [
primaryKey
:
true
,
//表示主键
primaryKey
:
true
,
//表示主键
unique
:
true
//表示该列的值必须唯一
unique
:
true
//表示该列的值必须唯一
},
},
etId
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
1
},
//名册录入类型 1:正式党员、2:入党积极分子、3:预备党员
'
etId
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
1
},
//名册录入类型 1:正式党员、2:入党积极分子、3:预备党员
name
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//姓名
name
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//姓名
sex
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
1
},
//性别 1:男、2:女
sex
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
1
},
//性别 1:男、2:女
birthDate
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
//出生年月
birthDate
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
//出生年月
phone
:
{
type
:
Sequelize
.
STRING
(
11
),
allowNull
:
false
},
//手机号码
phone
:
{
type
:
Sequelize
.
STRING
(
11
),
allowNull
:
false
},
//手机号码
levelOfEducation
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//文化程度
levelOfEducation
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//文化程度
bId
:
{
type
:
Sequelize
.
INTEGER
(
20
),
allowNull
:
false
},
//支部表id 外键
bId
:
{
type
:
Sequelize
.
INTEGER
(
20
),
allowNull
:
false
},
//支部表id 外键
partyJoiningTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
fals
e
},
//入党时间 --正式党员录入
partyJoiningTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
tru
e
},
//入党时间 --正式党员录入
administrativePositionName
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
fals
e
,
defaultValue
:
1
},
//行政职务id 枚举 默认1:普通职员
administrativePositionName
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
tru
e
,
defaultValue
:
1
},
//行政职务id 枚举 默认1:普通职员
partyPositionsName
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
fals
e
,
defaultValue
:
'[]'
},
//党内职务id 枚举 --正式党员录入 [1,2] --多选
partyPositionsName
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
tru
e
,
defaultValue
:
'[]'
},
//党内职务id 枚举 --正式党员录入 [1,2] --多选
departmentName
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
fals
e
,
defaultValue
:
'[]'
},
//所属科室表id 枚举 [1,2] --多选
departmentName
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
tru
e
,
defaultValue
:
'[]'
},
//所属科室表id 枚举 [1,2] --多选
askForTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
fals
e
},
//申请入党时间 --入党积极分子录入、入党申请录入
askForTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
tru
e
},
//申请入党时间 --入党积极分子录入、入党申请录入
listedAsActivistsTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
fals
e
},
//列为积极分子时间 --入党积极分子录入
listedAsActivistsTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
tru
e
},
//列为积极分子时间 --入党积极分子录入
liaison
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
fals
e
,
defaultValue
:
'[]'
},
//联系人 --入党积极分子录入 "" --多选
liaison
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
tru
e
,
defaultValue
:
'[]'
},
//联系人 --入党积极分子录入 "" --多选
talkTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
fals
e
},
//谈话时间 --入党申请录入
talkTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
tru
e
},
//谈话时间 --入党申请录入
partyState
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
fals
e
,
defaultValue
:
1
},
//党员状态 1:在党、2:退党
partyState
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
tru
e
,
defaultValue
:
1
},
//党员状态 1:在党、2:退党
isAdmin
:
{
type
:
Sequelize
.
BOOLEAN
,
allowNull
:
fals
e
,
defaultValue
:
false
},
//是否为管理员
isAdmin
:
{
type
:
Sequelize
.
BOOLEAN
,
allowNull
:
tru
e
,
defaultValue
:
false
},
//是否为管理员
/**小程序登录 */
/**小程序登录 */
loginId
:
{
type
:
Sequelize
.
STRING
(
11
),
allowNull
:
false
},
//登录账号 默认手机号
loginId
:
{
type
:
Sequelize
.
STRING
(
11
),
allowNull
:
false
},
//登录账号 默认手机号
pwd
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//密码 默认手机号后6位
pwd
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//密码 默认手机号后6位
token
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
token
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
tokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
tokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
adminToken
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
adminToken
:{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
adminTokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
adminTokenMs
:{
type
:
Sequelize
.
DATE
,
allowNull
:
false
,
defaultValue
:
Sequelize
.
NOW
},
},
},
association
:
[
association
:
[
{
type
:
"hasOne"
,
check
:
"branch"
},
{
type
:
"hasOne"
,
check
:
"branch"
},
...
@@ -289,8 +289,8 @@ export const TablesConfig = [
...
@@ -289,8 +289,8 @@ export const TablesConfig = [
unique
:
true
//表示该列的值必须唯一
unique
:
true
//表示该列的值必须唯一
},
},
bId
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
,
defaultValue
:
''
},
//支部表id 外键 [1,2] --多选
bId
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
,
defaultValue
:
''
},
//支部表id 外键 [1,2] --多选
primaryIndicators
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//一级指标
primaryIndicators
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//一级指标
枚举
secondaryIndicators
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//二级指标
secondaryIndicators
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//二级指标
枚举
thirdLevelScore
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
0
},
//三级指标分值
thirdLevelScore
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
0
},
//三级指标分值
thirdLevelContent
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
,
defaultValue
:
''
},
//三级指标内容
thirdLevelContent
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
,
defaultValue
:
''
},
//三级指标内容
totalScore
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
0
},
//总分
totalScore
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
0
},
//总分
...
...
src/routers/mysqlRouter.ts
View file @
b6b32be9
...
@@ -46,6 +46,7 @@ async function deleteData(req, res) {
...
@@ -46,6 +46,7 @@ async function deleteData(req, res) {
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
updateManyData
(
req
,
res
)
{
async
function
updateManyData
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
@@ -68,6 +69,8 @@ async function findOneData(req, res) {
...
@@ -68,6 +69,8 @@ async function findOneData(req, res) {
let
result
=
await
findBiz
.
selectOneDataByParam
(
table
,
param
,
column
);
let
result
=
await
findBiz
.
selectOneDataByParam
(
table
,
param
,
column
);
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
findManyData
(
req
,
res
)
{
async
function
findManyData
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
@@ -77,6 +80,8 @@ async function findManyData(req, res) {
...
@@ -77,6 +80,8 @@ async function findManyData(req, res) {
let
result
=
await
findBiz
.
selectDataListByParam
(
table
,
param
,
column
);
let
result
=
await
findBiz
.
selectDataListByParam
(
table
,
param
,
column
);
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
findManyToPageData
(
req
,
res
)
{
async
function
findManyToPageData
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
@@ -87,6 +92,7 @@ async function findManyToPageData(req, res) {
...
@@ -87,6 +92,7 @@ async function findManyToPageData(req, res) {
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
findCountData
(
req
,
res
)
{
async
function
findCountData
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
@@ -97,6 +103,7 @@ async function findCountData(req, res) {
...
@@ -97,6 +103,7 @@ async function findCountData(req, res) {
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
findAggragateData
(
req
,
res
)
{
async
function
findAggragateData
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
@@ -107,6 +114,7 @@ async function findAggragateData(req, res) {
...
@@ -107,6 +114,7 @@ async function findAggragateData(req, res) {
res
.
success
(
result
);
res
.
success
(
result
);
}
}
async
function
findAggragateDataToPage
(
req
,
res
)
{
async
function
findAggragateDataToPage
(
req
,
res
)
{
let
table
=
req
.
tableModel
;
let
table
=
req
.
tableModel
;
...
...
src/routers/router.ts
View file @
b6b32be9
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
*/
*/
import
*
as
mongoRouter
from
'./mongoRouter'
;
import
*
as
mongoRouter
from
'./mongoRouter'
;
import
*
as
mysqlRouter
from
'./mysqlRouter'
;
export
function
setRouter
(
httpServer
){
export
function
setRouter
(
httpServer
){
mongoRouter
.
setRouter
(
httpServer
);
mongoRouter
.
setRouter
(
httpServer
);
mysqlRouter
.
setRouter
(
httpServer
);
}
}
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