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.
|
|
|
/* eslint-disable*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports = dc => {
|
|
|
|
const DataTypes = dc.ORM;
|
|
|
|
const sequelize = dc.orm;
|
|
|
|
const Report = sequelize.define("report", {
|
|
|
|
id: {
|
|
|
|
index: 1,
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: true,
|
|
|
|
field: "id",
|
|
|
|
autoIncrement: true,
|
|
|
|
unique: "report_id_uindex"
|
|
|
|
},
|
|
|
|
reportType: {
|
|
|
|
index: 2,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: "上报类型 巡查:patrol / 养护:conserve",
|
|
|
|
primaryKey: false,
|
|
|
|
field: "report_type",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
projectType: {
|
|
|
|
index: 3,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert",
|
|
|
|
primaryKey: false,
|
|
|
|
field: "project_type",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
road: {
|
|
|
|
index: 4,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '所属道路',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "road",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
roadSectionStart: {
|
|
|
|
index: 5,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '开始路段',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "road_section_start",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
roadSectionEnd: {
|
|
|
|
index: 6,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '结束路段',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "road_section_end",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
longitude: {
|
|
|
|
index: 7,
|
|
|
|
type: DataTypes.DOUBLE,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '经度',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "longitude",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
latitude: {
|
|
|
|
index: 8,
|
|
|
|
type: DataTypes.DOUBLE,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '纬度',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "latitude",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
content: {
|
|
|
|
index: 9,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '具体内容',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "content",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
scenePic: {
|
|
|
|
index: 10,
|
|
|
|
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: false,
|
|
|
|
field: "scene_pic",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
conserveBeforePic: {
|
|
|
|
index: 11,
|
|
|
|
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: false,
|
|
|
|
field: "conserve_before_pic",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
conserveUnderwayPic: {
|
|
|
|
index: 12,
|
|
|
|
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: false,
|
|
|
|
field: "conserve_underway_pic",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
conserveAfterPic: {
|
|
|
|
index: 13,
|
|
|
|
type: DataTypes.ARRAY(DataTypes.STRING),
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: false,
|
|
|
|
field: "conserve_after_pic",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
userId: {
|
|
|
|
index: 14,
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: null,
|
|
|
|
primaryKey: false,
|
|
|
|
field: "user_id",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
time: {
|
|
|
|
index: 15,
|
|
|
|
type: DataTypes.DATE,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '创建日期',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "time",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
address: {
|
|
|
|
index: 16,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null,
|
|
|
|
comment: '具体位置',
|
|
|
|
primaryKey: false,
|
|
|
|
field: "address",
|
|
|
|
autoIncrement: false
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
tableName: "report",
|
|
|
|
comment: "",
|
|
|
|
indexes: []
|
|
|
|
});
|
|
|
|
dc.models.Report = Report;
|
|
|
|
return Report;
|
|
|
|
};
|