/* eslint-disable*/ 'use strict'; module.exports = dc => { const DataTypes = dc.ORM; const sequelize = dc.orm; const GbCamera = sequelize.define("gbCamera", { id: { type: DataTypes.INTEGER, allowNull: false, defaultValue: null, comment: null, primaryKey: true, field: "id", autoIncrement: true, unique: "gbcamera_id_uindex" }, level: { type: DataTypes.INTEGER, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "level", autoIncrement: false }, parent: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "parent", autoIncrement: false }, streamid: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "streamid", autoIncrement: false }, registerTime: { type: DataTypes.DATEONLY, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "registerTime", autoIncrement: false }, updateTime: { type: DataTypes.DATEONLY, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "updateTime", autoIncrement: false }, online: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "online", autoIncrement: false }, manufactuer: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "manufactuer", autoIncrement: false }, model: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "model", autoIncrement: false }, civilCode: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "civilCode", autoIncrement: false }, adddress: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "adddress", autoIncrement: false }, name: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "name", autoIncrement: false }, addr: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "Addr", autoIncrement: false }, sipip: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "Sipip", autoIncrement: false }, ipctype: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, field: "ipctype", autoIncrement: false } }, { tableName: "gbCamera", comment: "", indexes: [] }); const Nvr = dc.models.Nvr; Nvr.belongsTo(GbCamera, { foreignKey: 'serialNo', targetKey: 'streamid', as: 'gbNvr' }); GbCamera.hasMany(Nvr, { foreignKey: 'serialNo', sourceKey: 'streamid', as: 'gbNvr' }); const Camera = dc.models.Camera; Camera.belongsTo(GbCamera, { foreignKey: 'gbId', targetKey: 'id' }); GbCamera.hasMany(Camera, { foreignKey: 'gbId', sourceKey: 'id' }); dc.models.GbCamera = GbCamera; return GbCamera; };