Commit 0235daca by chenjinjing

where条件参数

parent 1b17aabd
......@@ -5,7 +5,7 @@ import { BizError } from "../../util/bizError";
/**
*
* where条件查询参数
* @param param
* %like%:模糊查询 {列名: {"%like%": }}
* %gt%:大于 {列名: {"%gt%": }}
......@@ -20,6 +20,7 @@ import { BizError } from "../../util/bizError";
function analysisParamToWhere(param, column) {
let where = {};
for (let key in param) {
if (typeof param[key] == "object") {
where[key] = {};
for (let whereKey in param[key]){
switch(whereKey) {
......@@ -44,12 +45,11 @@ function analysisParamToWhere(param, column) {
case "%notBetween%":
where[key][Op.notBetween] = param[key]["%notBetween%"];
break;
default:
where[key] = param[key];
break;
}
}
}else {
where[key] = param[key];
}
}
let selectParam:any = {where};
......
......@@ -167,7 +167,6 @@ export const TablesConfig = [
pmId: {type:Sequelize.STRING(100), allowNull:false}, //党员信息表id 外键
payType: {type:Sequelize.INTEGER, allowNull:false, defaultValue:2}, //缴纳状态 1:已缴纳、2:未缴纳
payableMonth: {type:Sequelize.DATE, allowNull:false}, //应交月份
bId: {type:Sequelize.STRING(100), allowNull:false, defaultValue:'[]'}, //支部表id 外键 [1,2] --多选
payTime: {type:Sequelize.DATE, allowNull:true}, //缴费时间
payAmount: {type:Sequelize.INTEGER, allowNull:false}, //缴费金额(元)
},
......
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