This commit is contained in:
张成
2025-12-12 16:38:48 +08:00
parent 130167acc9
commit 4686a24522
10 changed files with 14626 additions and 50 deletions

153
api/model/company_info.js Normal file
View File

@@ -0,0 +1,153 @@
const Sequelize = require('sequelize');
/**
* 公司信息表模型
* 存储上市公司基本信息
*/
module.exports = (db) => {
const company_info = db.define("company_info", {
// 序号
sequence_number: {
comment: '序号',
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: 0
},
// 证券代码
stock_code: {
comment: '证券代码300890.SZ',
type: Sequelize.STRING(50),
allowNull: true,
defaultValue: ''
},
// 公司中文名称
company_name: {
comment: '公司中文名称',
type: Sequelize.STRING(200),
allowNull: false,
defaultValue: ''
},
// 注册地址
registered_address: {
comment: '注册地址',
type: Sequelize.STRING(500),
allowNull: true,
defaultValue: ''
},
// 省份
province: {
comment: '省份',
type: Sequelize.STRING(50),
allowNull: true,
defaultValue: ''
},
// 区域(区/县)
city: {
comment: '区域(区/县),如:宝山区、杨浦区',
type: Sequelize.STRING(50),
allowNull: true,
defaultValue: ''
},
// 公司电话
phone: {
comment: '公司电话',
type: Sequelize.STRING(100),
allowNull: true,
defaultValue: ''
},
// 公司电子邮件地址
email: {
comment: '公司电子邮件地址',
type: Sequelize.STRING(200),
allowNull: true,
defaultValue: ''
},
// 公司网站
website: {
comment: '公司网站',
type: Sequelize.STRING(200),
allowNull: true,
defaultValue: ''
},
// 是否上市
is_listed: {
comment: '是否上市1=上市0=未上市)',
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0
},
// 推荐等级
recommendation_level: {
comment: '推荐等级excellent=优秀good=良好normal=一般not_recommended=不推荐)',
type: Sequelize.STRING(20),
allowNull: true,
defaultValue: 'normal'
},
// 状态
is_enabled: {
comment: '是否启用1=启用0=禁用)',
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 1
},
// 备注
remark: {
comment: '备注',
type: Sequelize.TEXT,
allowNull: true,
defaultValue: ''
}
}, {
indexes: [
{
unique: false,
fields: ['stock_code']
},
{
unique: false,
fields: ['company_name']
},
{
unique: false,
fields: ['province']
},
{
unique: false,
fields: ['city']
},
{
unique: false,
fields: ['province', 'city']
},
{
unique: false,
fields: ['is_listed']
},
{
unique: false,
fields: ['recommendation_level']
},
{
unique: false,
fields: ['is_enabled']
}
]
});
// company_info.sync({ force: true });
return company_info;
};