12345678910111213141516171819202122232425262728293031323334 |
- /**
- * Created by CSL on 2017/5/3.
- * 定额系数关系表。(即附注条件。系数会被定额公用,如同一个分枝下的兄弟定额。)
- */
- var mongoose = require("mongoose");
- var dbm = require("../../../config/db/db_manager");
- var db = dbm.getCfgConnection("rationRepository")
- var rationCoeSchema = mongoose.Schema({
- ID:Number,
- libID: Number,
- rationID: Number,
- //rationCode: String,
- coeIDs: Array
- });
- var rationCoeModel = db.model("rationCoes",rationCoeSchema, "rationCoes")
- var rationCoeDAO = function(){};
- rationCoeDAO.prototype.getRationCoes = function (data, callback) {
- rationCoeModel.findOne({
- "libID": data.libID,
- "rationID": data.rationID,
- "$or": [{"isDeleted": null}, {"isDeleted": false}]
- },
- function (err, doc) {
- if (err) callback(true, "获取定额调整系数错误!", "")
- else callback(false, "获取定额调整系数成功", doc);
- })
- };
- module.exports = new rationCoeDAO();
|