Commit 83f9ddcf by lixinming

Merge branch 'master' of http://123.207.147.179:8888/node_server/yuyiDataServer

# Conflicts:
#	src/config/mysqlTableConfig.ts
parents 6ff96973 bfa96f72
......@@ -23,13 +23,16 @@
"nodemailer": "^6.1.1",
"qs": "^6.11.0",
"request": "^2.88.0",
"sequelize": "^6.32.1",
"sequelize": "^6.37.7",
"svg-captcha": "^1.3.12",
"tencentcloud-sdk-nodejs": "^4.0.562",
"ws": "^5.2.2",
"xml2js": "^0.4.23"
},
"devDependencies": {},
"devDependencies": {
"patch-package": "^8.0.0",
"typescript": "^5.8.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
......
......@@ -4,10 +4,11 @@
<mysqldb>
<!-- 本地mysql配置 -->
<mysqlHost>192.168.0.105</mysqlHost>
<!-- <mysqlHost>127.0.0.1</mysqlHost> -->
<mysqlPort>3306</mysqlPort>
<mysqlUser>root</mysqlUser>
<mysqlPwd>123456</mysqlPwd>
<dataBase>yuyi</dataBase>.
<dataBase>yuyi</dataBase>
<!-- 服务器mysql配置 -->
<!-- <mysqlHost>127.0.0.1</mysqlHost>
<mysqlPort>3306</mysqlPort>
......
......@@ -7,6 +7,7 @@ import { BizError } from "../util/bizError";
/**
* where条件查询参数
* @param param
* %or%: 或者条件 [{"列名": 条件}, {"列名":条件}]
* %like%:模糊查询 {列名: {"%like%": }}
* %gt%:大于 {列名: {"%gt%": }}
* %gte%:大于等于 {列名: {"%gte%": }}
......@@ -16,6 +17,7 @@ import { BizError } from "../util/bizError";
* %notBetween%:查询不在范围内数据 {列名: {"%notBetween%": ["开始参数", "结束参数"]}} ---NOT BETWEEN 开始参数 AND 结束参数
* %orderDesc%: order by DESC {"%orderDesc%": "列名"}
* %limit%: {"%limit%": 数量}
* %literal%: 拼接查询sql条件,多表联查使用时记得指定子表字段 {"%literal%": `sql语句`} 例如:enterprise_fuhua.startTime BETWEEN "" and "" and (state != "" or state == "")
* @param column
* @returns
*/
......@@ -23,9 +25,12 @@ function analysisParamToWhere(param, column) {
let where = {};
let order = [];
let group = "";
let literal = "";
let limit = 0;
for (let key in param) {
if (typeof param[key] == "object") {
if (key == "%or%") {
where[Op.or] = param["%or%"];
} else if (typeof param[key] == "object") {
where[key] = {};
for (let whereKey in param[key]){
switch(whereKey) {
......@@ -59,9 +64,12 @@ function analysisParamToWhere(param, column) {
case "%ne%"://不等于
where[key][Op.ne] = param[key]["%ne%"];
break;
case "%regexp%":
where[key][Op.regexp] = param[key]["%regexp%"];
break;
}
}
}else {
} else {
switch (key) {
case "%orderDesc%":
order = [[Sequelize.col(param[key]), "DESC"]];
......@@ -75,6 +83,9 @@ function analysisParamToWhere(param, column) {
case "%group%":
group = param[key];
break;
case "%literal%":
literal = param["%literal%"];
break;
default: where[key] = param[key];
}
}
......@@ -85,6 +96,7 @@ function analysisParamToWhere(param, column) {
if (order && order.length) selectParam.order = order;
if (limit) selectParam.limit = limit;
if (group) selectParam.group = group;
if (literal) selectParam.where = Sequelize.literal(literal);
return selectParam;
}
......
......@@ -26,6 +26,7 @@ export const TablesConfig = [
synopsis: {type:Sequelize.STRING(255)}, //简介
totalArea: {type:Sequelize.STRING(255)}, //总面积
zaifuArea: {type:Sequelize.STRING(255)}, //在孵面积
rentRate: {type:Sequelize.STRING(255)},//后台填报-出租率
ziyonArea: {type:Sequelize.STRING(255)}, //自用面积
parkArea: {type:Sequelize.STRING(255)},//新增园区面积
enterpriseNum: {type:Sequelize.INTEGER},//新增企业数量
......@@ -79,6 +80,7 @@ export const TablesConfig = [
endTime: {type:Sequelize.DATE}, //租赁结束日期
rentFreeStart: {type:Sequelize.DATE}, //免租期开始
rentFreeEnd: {type:Sequelize.DATE}, //免租期结束
building: {type:Sequelize.STRING(50)}, //楼号
roomNumber: {type:Sequelize.STRING(50)}, //室号
rent: {type:Sequelize.DECIMAL(18, 2)}, //每月租金
notes: {type:Sequelize.STRING(255)}, //备注
......@@ -104,7 +106,7 @@ export const TablesConfig = [
userName: {type:Sequelize.STRING(50), allowNull:false}, //用户名称
phone: {type:Sequelize.STRING(255), allowNull:false}, //手机号
pwd: {type:Sequelize.STRING(255), allowNull:false}, //密码
eId: {type:Sequelize.STRING(255), allowNull:false}, //关联企业id
eId: {type:Sequelize.STRING(255), allowNull:true}, //关联企业id
token: {type:Sequelize.STRING(255), allowNull:true}, //token
tokenMs: { type:Sequelize.DATE, allowNull:true},
email: {type:Sequelize.STRING(255), allowNull:true}, //新增邮箱
......@@ -405,6 +407,58 @@ export const TablesConfig = [
target:{type:Sequelize.STRING(255)},//标签
closeTimeMs:{type:Sequelize.DATE},//关闭时间
isPermanent:{type:Sequelize.INTEGER},//是否永久有效 0=否 1=是
policyType:{type:Sequelize.INTEGER},//类型 1=财政补贴 2=资质申报 3=政策扶持
},
association: []
},
{
tableNamecn:'入孵申请审批表',
tableName:'approval_history',
schema:{
approvalId:{
type:Sequelize.STRING(255),//表示属性的数据类型
allowNul1:false,//表示当前列是否允许为空,false表示该列不能为空
primaryKey:true,//表示主键
unique:true ,//表示该列的值必须唯一
},
eId:{type:Sequelize.STRING(255),allowNull:false},//关联企业id
changeType:{type:Sequelize.INTEGER},//审批类型:1=入申请 2=入孵材料上传
changestate:{type:Sequelize.INTEGER},//操作审核状态 =否 1=是 2-驳回 3=重新提交
createTimeMs :{type:Sequelize.DATE},//日志时间
},
association:[]
},
//孵化器入驻信息表
{
tableNameCn: '入驻信息表',
tableName: 'info_enter',
schema: {
info_enterId: {
type:Sequelize.STRING(255), //表示属性的数据类型
allowNull:false, //表示当前列是否允许为空, false表示该列不能为空
primaryKey:true, //表示主键
unique:true //表示该列的值必须唯一
},
building: {type: Sequelize.STRING(255)},//楼号(1,3,4)
occupancyRate: {type: Sequelize.STRING(255)},//入驻率
enteredEnterprises: {type: Sequelize.STRING(255)},//入驻企业
},
association: []
},
//运营推广信息表
{
tableNameCn: '运营推广信息表',
tableName: 'info_operation_promotion',
schema: {
opId: {
type:Sequelize.STRING(255), //表示属性的数据类型
allowNull:false, //表示当前列是否允许为空, false表示该列不能为空
primaryKey:true, //表示主键
unique:true //表示该列的值必须唯一
},
promotionType:{type: Sequelize.INTEGER},//推广类型 枚举 线上推广、线下推广
promotionApp:{type: Sequelize.INTEGER},//推广应用 枚举 抖音、小红书......
promotionNum:{type: Sequelize.INTEGER},//推广次数
},
association: []
},
......@@ -692,6 +746,21 @@ export const TablesConfig = [
},
association: []
},
// {
// tableNameCn:'招投标信息',// todo
// tableName:'tendering ',
// schema:{
// tenderId: {
// type:Sequelize.STRING(255), //表示属性的数据类型
// allowNull:false, //表示当前列是否允许为空, false表示该列不能为空
// primaryKey:true, //表示主键
// unique:true //表示该列的值必须唯一
// },
// eId:{type:Sequelize.STRING(255), allowNull:false}, //关联企业id
// },
// association: []
// },
{
tableNameCn:'企业基础信息表',
tableName:'enterprise',
......@@ -703,6 +772,7 @@ export const TablesConfig = [
unique:true //表示该列的值必须唯一
},
enterpriseName: {type:Sequelize.STRING(255), allowNull:false}, //企业名称
pinyinName: {type:Sequelize.STRING(255)}, //企业名称拼音首字母
uscc: {type:Sequelize.STRING(18), allowNull:false}, //统一信用代码
zhuCeHao:{type:Sequelize.STRING(100)},//注册号
zuZhiJiGouDaiMa: {type:Sequelize.STRING(18)}, //组织机构代码
......@@ -735,8 +805,8 @@ export const TablesConfig = [
shuiWuJu:{type:Sequelize.STRING(255)},//税务局
jingYingFanWei:{type:Sequelize.TEXT},//经营范围
//状态标识
register:{type:Sequelize.INTEGER},//是否通过申请 0=否 1=是
state:{type:Sequelize.INTEGER},//是否通过入孵审核 0=否 1=是
register:{type:Sequelize.INTEGER},//入孵申请状态 0=未审核 1=已驳回 2=已通过
state:{type:Sequelize.INTEGER},//入孵材料审核状态 0=未审核 1=已驳回 2=已通过
//临时填充信息用的验证码
randomCode:{type:Sequelize.STRING(255)}
},
......@@ -769,23 +839,11 @@ export const TablesConfig = [
{type:"hasMany", check:"dishonesty", goreignKey:"eId"},
{type:"hasMany", check:"break_the_law", goreignKey:"eId"},
{type:"hasMany", check:"overseas_investment", goreignKey:"eId"},
{type:"hasMany", check:"approval_history", goreignKey:"eId"},
{type:"hasMany", check:"info_enter", goreignKey:"eId"},
{type:"hasMany", check:"info_operation_promotion", goreignKey:"eId"},
]
},
// {
// tableNameCn:'招投标信息',// todo
// tableName:'tendering ',
// schema:{
// tenderId: {
// type:Sequelize.STRING(255), //表示属性的数据类型
// allowNull:false, //表示当前列是否允许为空, false表示该列不能为空
// primaryKey:true, //表示主键
// unique:true //表示该列的值必须唯一
// },
// eId:{type:Sequelize.STRING(255), allowNull:false}, //关联企业id
// },
// association: []
// },
{
tableNameCn:'管理后台用户',
tableName:'adminUser',
......@@ -806,4 +864,3 @@ export const TablesConfig = [
},
];
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