rpt_template.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Created by Tony on 2016/12/23.
  3. */
  4. var smartcostdb = require('./smartcostdb');
  5. var Schema = smartcostdb.mongoose.Schema;
  6. var RptTemplateSchema = new Schema({
  7. "GROUP_KEY": String,
  8. "ID_KEY": String,
  9. "主信息": Schema.Types.Mixed,
  10. "指标_数据_映射": Schema.Types.Mixed,
  11. "布局框_集合": Array,
  12. "流水式表_信息": Schema.Types.Mixed,
  13. "交叉表_信息": Schema.Types.Mixed,
  14. "无映射离散指标_集合": Schema.Types.Mixed,
  15. "离散参数_集合": Schema.Types.Mixed,
  16. "计算式_集合": Array
  17. });
  18. var Template = smartcostdb.mongoose.model("rpt_templates", RptTemplateSchema);
  19. var RplTplDAO = function(){};
  20. //根据id获取试卷
  21. RplTplDAO.prototype.get = function(grpId, id, callback){
  22. Template.find({GROUP_KEY: grpId, ID_KEY: id}, function(err, templates){
  23. if(templates.length){
  24. callback(false, templates[0]);
  25. }
  26. else{
  27. callback('查找不到报表模板!');
  28. }
  29. })
  30. }
  31. module.exports = new RplTplDAO();