/**
 * Created by zhang on 2019/12/10.
 */

let mongoose = require('mongoose');
let Schema = mongoose.Schema;

let gljListSchema =new Schema({
    ID:{type: String},
    GLJID:Number,
    projectGLJID:Number,
    name:String,
    displayName:String,
    code:String,
    specs:String,
    unit:String,
    type:Number,
    // 加权系数
    coe: Number,
    from:{type: String,default:'std'}//std, cpt  来自标准工料机库、补充工料机库
},{versionKey:false,_id: false});


let com_electrovalenceSchema = {//综合电价
    ID:{type:String,index: true},
    unit_price_file_id: Number,
    gljList:[gljListSchema]
};

mongoose.model("com_electrovalence", new Schema(com_electrovalenceSchema, {versionKey: false, collection: "com_electrovalence"}));