std_price_info_items.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // 信息价数据
  2. const mongoose = require('mongoose');
  3. const Schema = mongoose.Schema;
  4. const keywordSchema = new Schema({
  5. keyword: {
  6. type: String,
  7. default: ''
  8. }, // 关键字
  9. coe: {
  10. type: String,
  11. default: ''
  12. }, // 系数(关键字效果)
  13. unit: {
  14. type: String,
  15. default: ''
  16. }, // 单位
  17. group: {
  18. type: String,
  19. default: ''
  20. }, // 组别
  21. optionCode: {
  22. type: String,
  23. default: ''
  24. }, // 选项号
  25. }, { _id: false });
  26. const priceInfoItems = new Schema({
  27. ID: String,
  28. libID: String,
  29. classID: { type: String, index: true }, // 分类
  30. code: {
  31. type: String,
  32. default: ''
  33. },
  34. name: {
  35. type: String,
  36. default: ''
  37. },
  38. specs: {
  39. type: String,
  40. default: ''
  41. },
  42. unit: {
  43. type: String,
  44. default: ''
  45. },
  46. taxPrice: {
  47. type: String,
  48. default: ''
  49. }, // 含税价格
  50. noTaxPrice: {
  51. type: String,
  52. default: ''
  53. }, // 不含税价格
  54. // 以下冗余数据为方便前台信息价功能处理
  55. period: String, // 期数 eg: 2020-05
  56. areaID: String, // 地区
  57. compilationID: String, // 费用定额
  58. remark: {
  59. type: String,
  60. default: ''
  61. },
  62. // 别名编码
  63. classCode: {
  64. type: String,
  65. default: ''
  66. },
  67. // 计算式
  68. expString: {
  69. type: String,
  70. default: ''
  71. },
  72. // 月份、价格备注
  73. dateRemark: {
  74. type: String,
  75. default: ''
  76. },
  77. // 关键字
  78. keywordList: {
  79. type: [keywordSchema],
  80. default: []
  81. }
  82. }, { versionKey: false });
  83. priceInfoItems.index({ areaID: 1, period: 1 });
  84. mongoose.model('std_price_info_items', priceInfoItems, 'std_price_info_items');