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
0235daca
Commit
0235daca
authored
Aug 31, 2023
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
where条件参数
parent
1b17aabd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
findData.ts
src/biz/mysql/findData.ts
+5
-5
mysqlTableConfig.ts
src/config/mysqlTableConfig.ts
+0
-1
No files found.
src/biz/mysql/findData.ts
View file @
0235daca
...
@@ -5,7 +5,7 @@ import { BizError } from "../../util/bizError";
...
@@ -5,7 +5,7 @@ import { BizError } from "../../util/bizError";
/**
/**
*
*
where条件查询参数
* @param param
* @param param
* %like%:模糊查询 {列名: {"%like%": }}
* %like%:模糊查询 {列名: {"%like%": }}
* %gt%:大于 {列名: {"%gt%": }}
* %gt%:大于 {列名: {"%gt%": }}
...
@@ -20,6 +20,7 @@ import { BizError } from "../../util/bizError";
...
@@ -20,6 +20,7 @@ import { BizError } from "../../util/bizError";
function
analysisParamToWhere
(
param
,
column
)
{
function
analysisParamToWhere
(
param
,
column
)
{
let
where
=
{};
let
where
=
{};
for
(
let
key
in
param
)
{
for
(
let
key
in
param
)
{
if
(
typeof
param
[
key
]
==
"object"
)
{
where
[
key
]
=
{};
where
[
key
]
=
{};
for
(
let
whereKey
in
param
[
key
]){
for
(
let
whereKey
in
param
[
key
]){
switch
(
whereKey
)
{
switch
(
whereKey
)
{
...
@@ -44,12 +45,11 @@ function analysisParamToWhere(param, column) {
...
@@ -44,12 +45,11 @@ function analysisParamToWhere(param, column) {
case
"%notBetween%"
:
case
"%notBetween%"
:
where
[
key
][
Op
.
notBetween
]
=
param
[
key
][
"%notBetween%"
];
where
[
key
][
Op
.
notBetween
]
=
param
[
key
][
"%notBetween%"
];
break
;
break
;
default
:
where
[
key
]
=
param
[
key
];
break
;
}
}
}
}
}
else
{
where
[
key
]
=
param
[
key
];
}
}
}
let
selectParam
:
any
=
{
where
};
let
selectParam
:
any
=
{
where
};
...
...
src/config/mysqlTableConfig.ts
View file @
0235daca
...
@@ -167,7 +167,6 @@ export const TablesConfig = [
...
@@ -167,7 +167,6 @@ export const TablesConfig = [
pmId
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//党员信息表id 外键
pmId
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
},
//党员信息表id 外键
payType
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
2
},
//缴纳状态 1:已缴纳、2:未缴纳
payType
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
2
},
//缴纳状态 1:已缴纳、2:未缴纳
payableMonth
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
//应交月份
payableMonth
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
false
},
//应交月份
bId
:
{
type
:
Sequelize
.
STRING
(
100
),
allowNull
:
false
,
defaultValue
:
'[]'
},
//支部表id 外键 [1,2] --多选
payTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
true
},
//缴费时间
payTime
:
{
type
:
Sequelize
.
DATE
,
allowNull
:
true
},
//缴费时间
payAmount
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//缴费金额(元)
payAmount
:
{
type
:
Sequelize
.
INTEGER
,
allowNull
:
false
},
//缴费金额(元)
},
},
...
...
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