You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

204 lines
4.0 KiB

import _sequelize from 'sequelize';
const { Model, Sequelize } = _sequelize;
export default class inspection extends Model {
static init(sequelize, DataTypes) {
super.init({
ID: {
autoIncrement: true,
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
UnitId: {
type: DataTypes.INTEGER,
allowNull: false
},
InspectionType: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
InspectionDomain: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
InspectionKind: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
InspectionDate: {
type: DataTypes.DATE,
allowNull: true
},
InspectionEndDate: {
type: DataTypes.DATE,
allowNull: true
},
InspectionStartTime: {
type: DataTypes.TIME,
allowNull: true
},
InspectionEndTime: {
type: DataTypes.TIME,
allowNull: true
},
StorageMode: {
type: DataTypes.INTEGER,
allowNull: true
},
EnvironmentalRate: {
type: DataTypes.INTEGER,
allowNull: true
},
ProfessionalRate: {
type: DataTypes.INTEGER,
allowNull: true
},
HealthRank: {
type: DataTypes.INTEGER,
allowNull: true
},
WorkerType: {
type: DataTypes.INTEGER,
allowNull: true
},
ChecklistResult: {
type: DataTypes.STRING(50),
allowNull: true
},
VisitResult: {
type: DataTypes.STRING(50),
allowNull: true
},
Description: {
type: DataTypes.STRING(50),
allowNull: true
},
LegalAction: {
type: DataTypes.STRING(50),
allowNull: true
},
CreateDate: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: Sequelize.fn('current_timestamp')
},
InspectorID: {
type: DataTypes.INTEGER,
allowNull: true
},
InspectorOrganization: {
type: DataTypes.INTEGER,
allowNull: true
},
NewsId: {
type: DataTypes.STRING(50),
allowNull: true
},
InspectionState: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
IsApproved: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
Index: {
type: DataTypes.TEXT,
allowNull: true
},
OwnerPositionId: {
type: DataTypes.INTEGER,
allowNull: true
},
OwnerNetworkStructureId: {
type: DataTypes.INTEGER,
allowNull: true
},
L1ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L2ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L3ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L4ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L5ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L6ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L7ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L8ID: {
type: DataTypes.INTEGER,
allowNull: true
},
L9ID: {
type: DataTypes.INTEGER,
allowNull: true
},
InspectorName: {
type: DataTypes.STRING(100),
allowNull: true
},
ApprovedDate: {
type: DataTypes.DATE,
allowNull: true
},
ApprovedComment: {
type: DataTypes.TEXT,
allowNull: true
},
HasLegalAction: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
InspectorPositionID: {
type: DataTypes.INTEGER,
allowNull: true
},
GIS_Long: {
type: DataTypes.DOUBLE,
allowNull: true
},
GIS_Lat: {
type: DataTypes.DOUBLE,
allowNull: true
},
Reason: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
}
}, {
sequelize,
tableName: 'inspection',
hasTrigger: true,
timestamps: false,
indexes: [
{
name: "PRIMARY",
unique: true,
using: "BTREE",
fields: [
{ name: "ID" },
]
},
]
});
return inspection;
}
}