// 信息价数据 const mongoose = require('mongoose'); const Schema = mongoose.Schema; const keywordSchema = new Schema({ keyword: { type: String, default: '' }, // 关键字 coe: { type: String, default: '' }, // 系数(关键字效果) unit: { type: String, default: '' }, // 单位 group: { type: String, default: '' }, // 组别 optionCode: { type: String, default: '' }, // 选项号 }, { _id: false }); const priceInfoItems = new Schema({ ID: String, libID: String, classID: { type: String, index: true }, // 分类 code: { type: String, default: '' }, name: { type: String, default: '' }, specs: { type: String, default: '' }, unit: { type: String, default: '' }, taxPrice: { type: String, default: '' }, // 含税价格 noTaxPrice: { type: String, default: '' }, // 不含税价格 // 以下冗余数据为方便前台信息价功能处理 period: String, // 期数 eg: 2020-05 areaID: String, // 地区 compilationID: String, // 费用定额 remark: { type: String, default: '' }, // 别名编码 classCode: { type: String, default: '' }, // 计算式 expString: { type: String, default: '' }, // 月份、价格备注 dateRemark: { type: String, default: '' }, // 关键字 keywordList: { type: [keywordSchema], default: [] } }, { versionKey: false }); priceInfoItems.index({ areaID: 1, period: 1 }); mongoose.model('std_price_info_items', priceInfoItems, 'std_price_info_items');