diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index f4e2cbd1..51d653e3 100644 --- a/api/app/lib/controllers/data/index.js +++ b/api/app/lib/controllers/data/index.js @@ -7,90 +7,75 @@ async function dataExport (ctx) { try { const models = ctx.fs.dc.models; const { userId } = ctx.fs.api - const { ids } = ctx.query; + const { exp, ids, roadLevel, municipalType } = ctx.query; - const fileList = [ - { - n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['村'], - }, - { - n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['县'], - }, + if (!exp) { + throw '参数错误'; + } + + const modalList = [ { n: '道路', - tableName: 'road', - defaultKey: ['level'], - defaultValue: ['乡'], + k: 'road', + tableName: 'Road', }, { n: '桥梁', - tableName: 'bridge' - }, - { - n: '运政车辆', - tableName: 'municipal_vehicle', - defaultKey: ['type'], - defaultValue: ['出租车'], + k: 'bridge', + tableName: 'Bridge' }, { n: '运政车辆', - tableName: 'municipal_vehicle', - defaultKey: ['type'], - defaultValue: ['危货'], + k: 'vehicle', + tableName: 'MunicipalVehicle', }, { n: '运政业户', - tableName: 'municipal_business', - defaultKey: ['type'], - defaultValue: ['出租车'], - }, - { - n: '运政业户', - tableName: 'municipal_business', - defaultKey: ['type'], - defaultValue: ['危货'], - }, - { - n: '工程一览', - tableName: 'project', - defaultKey: ['done', 'type'], - defaultValue: [false, 'road'], + k: 'business', + tableName: 'MunicipalBusiness', }, { n: '工程一览', - tableName: 'project', - defaultKey: ['done', 'type'], - defaultValue: [false, 'bridge'], + k: 'project', + tableName: 'Project', }, { n: '治超', - tableName: 'overspeed', + k: 'overspeed', + tableName: 'Overspeed', }, { n: '公交线路', - tableName: 'bus_line', + k: 'busLine', + tableName: 'BusLine', }, { n: '公交车辆', - tableName: 'bus_car', + k: 'busCar', + tableName: 'BusCar', }, ] + const modalOption = modalList.find(item => item.k == exp); + if (!modalOption) { + throw '参数错误'; + } + let findOption = { where: {} } if (ids) { findOption.where.id = { $in: ids.split(',') } } + if (roadLevel) { + findOption.where.level = roadLevel + } + if (municipalType) { + findOption.where.type = municipalType + } - const exportData = await models.BusCar.findAll(findOption) - const tableAttributes = models.BusCar.tableAttributes + const exportData = await models[modalOption.tableName].findAll(findOption) + const tableAttributes = models[modalOption.tableName].tableAttributes let header = [] for (let k in tableAttributes) { if (k != 'id') { @@ -103,7 +88,7 @@ async function dataExport (ctx) { } header.sort((a, b) => { return a.index - b.index }) - const fileName = `摄像头信息列表_${moment().format('YYYYMMDDHHmmss')}` + '.csv' + const fileName = `${modalOption.n}_${moment().format('YYYYMMDDHHmmss')}` + '.csv' const filePath = await xlsxDownload.simpleExcelDown({ data: exportData, header, fileName: fileName }) const fileData = fs.readFileSync(filePath); diff --git a/api/app/lib/models/project.js b/api/app/lib/models/project.js index b20bdfb8..7fab6aa0 100644 --- a/api/app/lib/models/project.js +++ b/api/app/lib/models/project.js @@ -2,123 +2,135 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Project = sequelize.define("project", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "project_id_uindex" - }, - entryName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "项目名称", - primaryKey: false, - field: "entry_name", - autoIncrement: false - }, - projectMileage: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "工程里程", - primaryKey: false, - field: "project_mileage", - autoIncrement: false - }, - investment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "投资", - primaryKey: false, - field: "investment", - autoIncrement: false - }, - buildUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "建设单位", - primaryKey: false, - field: "build_unit", - autoIncrement: false - }, - constructionControlUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "监理单位", - primaryKey: false, - field: "construction_control_unit", - autoIncrement: false - }, - designUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "设计单位", - primaryKey: false, - field: "design_unit", - autoIncrement: false - }, - constructionUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "施工单位", - primaryKey: false, - field: "construction_unit", - autoIncrement: false - }, - supervisorAndSupervisor: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "监督负责人及监督人员", - primaryKey: false, - field: "supervisor_and_supervisor", - autoIncrement: false - }, - projectProgress: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "项目进展情况", - primaryKey: false, - field: "project_progress", - autoIncrement: false - }, - done: { - type: DataTypes.BOOLEAN, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "done", - autoIncrement: false - }, - type: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: "类型 道路:road / 桥梁:bridge", - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "project", - comment: "", - indexes: [] - }); - dc.models.Project = Project; - return Project; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Project = sequelize.define("project", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "project_id_uindex" + }, + entryName: { + index: 2, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "项目名称", + primaryKey: false, + field: "entry_name", + autoIncrement: false + }, + projectMileage: { + index: 3, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "工程里程", + primaryKey: false, + field: "project_mileage", + autoIncrement: false + }, + investment: { + index: 4, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "投资", + primaryKey: false, + field: "investment", + autoIncrement: false + }, + buildUnit: { + index: 5, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建设单位", + primaryKey: false, + field: "build_unit", + autoIncrement: false + }, + constructionControlUnit: { + index: 6, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "监理单位", + primaryKey: false, + field: "construction_control_unit", + autoIncrement: false + }, + designUnit: { + index: 7, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "设计单位", + primaryKey: false, + field: "design_unit", + autoIncrement: false + }, + constructionUnit: { + index: 8, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "施工单位", + primaryKey: false, + field: "construction_unit", + autoIncrement: false + }, + supervisorAndSupervisor: { + index: 9, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "监督负责人及监督人员", + primaryKey: false, + field: "supervisor_and_supervisor", + autoIncrement: false + }, + projectProgress: { + index: 10, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "项目进展情况", + primaryKey: false, + field: "project_progress", + autoIncrement: false + }, + done: { + index: 11, + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "done", + autoIncrement: false + }, + type: { + index: 12, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "类型 道路:road / 桥梁:bridge", + primaryKey: false, + field: "type", + autoIncrement: false + } + }, { + tableName: "project", + comment: "", + indexes: [] + }); + dc.models.Project = Project; + return Project; }; \ No newline at end of file diff --git a/api/app/lib/models/publicity.js b/api/app/lib/models/publicity.js index 0cd30ded..62a1c77a 100644 --- a/api/app/lib/models/publicity.js +++ b/api/app/lib/models/publicity.js @@ -6,6 +6,7 @@ module.exports = dc => { const sequelize = dc.orm; const Publicity = sequelize.define("publicity", { id: { + index: 1, type: DataTypes.INTEGER, allowNull: false, defaultValue: null, @@ -16,6 +17,7 @@ module.exports = dc => { unique: "publicity_id_uindex" }, name: { + index: 2, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -25,6 +27,7 @@ module.exports = dc => { autoIncrement: false }, video: { + index: 3, type: DataTypes.ARRAY(DataTypes.INTEGER), allowNull: true, defaultValue: null, @@ -34,6 +37,7 @@ module.exports = dc => { autoIncrement: false }, enable: { + index: 4, type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, diff --git a/api/app/lib/models/report.js b/api/app/lib/models/report.js index 9377fdda..2eaa09b6 100644 --- a/api/app/lib/models/report.js +++ b/api/app/lib/models/report.js @@ -6,6 +6,7 @@ module.exports = dc => { const sequelize = dc.orm; const Report = sequelize.define("report", { id: { + index: 1, type: DataTypes.INTEGER, allowNull: false, defaultValue: null, @@ -16,6 +17,7 @@ module.exports = dc => { unique: "report_id_uindex" }, reportType: { + index: 2, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -25,6 +27,7 @@ module.exports = dc => { autoIncrement: false }, projectType: { + index: 3, type: DataTypes.STRING, allowNull: false, defaultValue: null, @@ -34,6 +37,7 @@ module.exports = dc => { autoIncrement: false }, road: { + index: 4, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -43,6 +47,7 @@ module.exports = dc => { autoIncrement: false }, roadSectionStart: { + index: 5, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -52,6 +57,7 @@ module.exports = dc => { autoIncrement: false }, roadSectionEnd: { + index: 6, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -61,6 +67,7 @@ module.exports = dc => { autoIncrement: false }, longitude: { + index: 7, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, @@ -70,6 +77,7 @@ module.exports = dc => { autoIncrement: false }, latitude: { + index: 8, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, @@ -79,6 +87,7 @@ module.exports = dc => { autoIncrement: false }, content: { + index: 9, type: DataTypes.STRING, allowNull: true, defaultValue: null, @@ -88,6 +97,7 @@ module.exports = dc => { autoIncrement: false }, scenePic: { + index: 10, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -97,6 +107,7 @@ module.exports = dc => { autoIncrement: false }, conserveBeforePic: { + index: 11, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -106,6 +117,7 @@ module.exports = dc => { autoIncrement: false }, conserveUnderwayPic: { + index: 12, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -115,6 +127,7 @@ module.exports = dc => { autoIncrement: false }, conserveAfterPic: { + index: 13, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -124,6 +137,7 @@ module.exports = dc => { autoIncrement: false }, userId: { + index: 14, type: DataTypes.INTEGER, allowNull: true, defaultValue: null, @@ -133,6 +147,7 @@ module.exports = dc => { autoIncrement: false }, time: { + index: 15, type: DataTypes.DATE, allowNull: false, defaultValue: null, @@ -142,6 +157,7 @@ module.exports = dc => { autoIncrement: false }, address: { + index: 16, type: DataTypes.STRING, allowNull: true, defaultValue: null, diff --git a/api/app/lib/models/road.js b/api/app/lib/models/road.js index d4dad07e..d1d58d7f 100644 --- a/api/app/lib/models/road.js +++ b/api/app/lib/models/road.js @@ -2,708 +2,785 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Road = sequelize.define("road", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "road_id_uindex" - }, - routeName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路线名称", - primaryKey: false, - field: "route_name", - autoIncrement: false - }, - routeCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路线代码", - primaryKey: false, - field: "route_code", - autoIncrement: false - }, - sectionNo: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路段序号", - primaryKey: false, - field: "section_no", - autoIncrement: false - }, - townshipCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "乡镇编码", - primaryKey: false, - field: "township_code", - autoIncrement: false - }, - startingPlaceName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "起点地名", - primaryKey: false, - field: "starting_place_name", - autoIncrement: false - }, - startStation: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "起点桩号", - primaryKey: false, - field: "start_station", - autoIncrement: false - }, - categoryOfStartingPointAndDividingPoint: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "起点分界点类别", - primaryKey: false, - field: "category_of_starting_point_and_dividing_point", - autoIncrement: false - }, - stopPlaceName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "止点地名", - primaryKey: false, - field: "stop_place_name", - autoIncrement: false - }, - categoryOfDeadCenterAndDividingPoint: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "止点分界点类别", - primaryKey: false, - field: "category_of_dead_center_and_dividing_point", - autoIncrement: false - }, - stopStation: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "止点桩号", - primaryKey: false, - field: "stop_station", - autoIncrement: false - }, - sectionType: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路段类型", - primaryKey: false, - field: "section_type", - autoIncrement: false - }, - routeCodeBeforeRoadNetworkAdjustment: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路网调整前路线编码", - primaryKey: false, - field: "route_code_before_road_network_adjustment", - autoIncrement: false - }, - serialNumberOfOriginalSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段序号", - primaryKey: false, - field: "serial_number_of_original_section", - autoIncrement: false - }, - startingStakeNumberOfTheOriginalRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段起点桩号", - primaryKey: false, - field: "starting_stake_number_of_the_original_road_section", - autoIncrement: false - }, - endingPointStakeNoOfTheOriginalRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "原路段止点桩号", - primaryKey: false, - field: "ending_point_stake_no_of_the_original_road_section", - autoIncrement: false - }, - routeLevel: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路线等级", - primaryKey: false, - field: "route_level", - autoIncrement: false - }, - natureOfRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路段性质", - primaryKey: false, - field: "nature_of_road_section", - autoIncrement: false - }, - completionTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "建成时间", - primaryKey: false, - field: "completion_time", - autoIncrement: false - }, - reconstructionTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "改建时间", - primaryKey: false, - field: "reconstruction_time", - autoIncrement: false - }, - natureOfConstruction: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "建设性质", - primaryKey: false, - field: "nature_of_construction", - autoIncrement: false - }, - gbmAndCivilizedModelRoad: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "GBM及文明样板路", - primaryKey: false, - field: "gbm_and_civilized_model_road", - autoIncrement: false - }, - landforms: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "地貌", - primaryKey: false, - field: "landforms", - autoIncrement: false - }, - natureOfCharges: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "收费性质", - primaryKey: false, - field: "nature_of_charges", - autoIncrement: false - }, - tollStation: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "所属收费站", - primaryKey: false, - field: "toll_station", - autoIncrement: false - }, - numberOfCulverts: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "涵洞数量", - primaryKey: false, - field: "number_of_culverts", - autoIncrement: false - }, - technicalLevel: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "技术等级", - primaryKey: false, - field: "technical_level", - autoIncrement: false - }, - pavementType: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路面类型", - primaryKey: false, - field: "pavement_type", - autoIncrement: false - }, - pavementWidth: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路面宽度", - primaryKey: false, - field: "pavement_width", - autoIncrement: false - }, - subgradeWidth: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路基宽度", - primaryKey: false, - field: "subgrade_width", - autoIncrement: false - }, - laneCharacteristics: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "车道特征", - primaryKey: false, - field: "lane_characteristics", - autoIncrement: false - }, - whetherItIsOpenToTrafficInSunnyOrRainyDays: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "是否晴雨通车", - primaryKey: false, - field: "whether_it_is_open_to_traffic_in_sunny_or_rainy_days", - autoIncrement: false - }, - designSpeedPerHour: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "设计时速", - primaryKey: false, - field: "design_speed_per_hour", - autoIncrement: false - }, - urbanManagementSectionOrNot: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "是否城管路段", - primaryKey: false, - field: "urban_management_section_or_not", - autoIncrement: false - }, - managementAndMaintenanceUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "管养单位", - primaryKey: false, - field: "management_and_maintenance_unit", - autoIncrement: false - }, - roadAdministrationUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "路政管理单位", - primaryKey: false, - field: "road_administration_unit", - autoIncrement: false - }, - alimentation: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "列养情况", - primaryKey: false, - field: "alimentation", - autoIncrement: false - }, - sourceOfListedMaintenanceFunds: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "列养资金来源", - primaryKey: false, - field: "source_of_listed_maintenance_funds", - autoIncrement: false - }, - curingTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "养护时间", - primaryKey: false, - field: "curing_time", - autoIncrement: false - }, - greeningMileage: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "可绿化里程", - primaryKey: false, - field: "greening_mileage", - autoIncrement: false - }, - greeningMileaged: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "已绿化里程", - primaryKey: false, - field: "greening_mileaged", - autoIncrement: false - }, - typeOfRepeatedRoadSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "重复道路路段类型", - primaryKey: false, - field: "type_of_repeated_road_section", - autoIncrement: false - }, - serialNumberOfRepeatedSection: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "重复路段序号", - primaryKey: false, - field: "serial_number_of_repeated_section", - autoIncrement: false - }, - repeatedSectionRouteCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "重复路段路线编码", - primaryKey: false, - field: "repeated_section_route_code", - autoIncrement: false - }, - plannedFundCategory: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划资金类别", - primaryKey: false, - field: "planned_fund_category", - autoIncrement: false - }, - plannedYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划年度", - primaryKey: false, - field: "planned_year", - autoIncrement: false - }, - planDocumentNo: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划文号", - primaryKey: false, - field: "plan_document_no", - autoIncrement: false - }, - planItemUniqueCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目唯一编码", - primaryKey: false, - field: "plan_item_unique_code", - autoIncrement: false - }, - plannedProjectRouteCode: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目路线编码", - primaryKey: false, - field: "planned_project_route_code", - autoIncrement: false - }, - planProjectName: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目名称", - primaryKey: false, - field: "plan_project_name", - autoIncrement: false - }, - plannedProjectType: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目类型", - primaryKey: false, - field: "planned_project_type", - autoIncrement: false - }, - completionStatus: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工情况", - primaryKey: false, - field: "completion_status", - autoIncrement: false - }, - yearOfCompletion: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工年度", - primaryKey: false, - field: "year_of_completion", - autoIncrement: false - }, - plannedFundCategoryOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划资金类别_1", - primaryKey: false, - field: "planned_fund_category__one", - autoIncrement: false - }, - plannedYearOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划年度_1", - primaryKey: false, - field: "planned_year__one", - autoIncrement: false - }, - planDocumentNoOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划文号_1", - primaryKey: false, - field: "plan_document_no__one", - autoIncrement: false - }, - planItemUniqueCodeOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目唯一编码_1", - primaryKey: false, - field: "plan_item_unique_code__one", - autoIncrement: false - }, - planProjectNameOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "计划项目名称_1", - primaryKey: false, - field: "plan_project_name__one", - autoIncrement: false - }, - completionStatusOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工情况_1", - primaryKey: false, - field: "completion_status__one", - autoIncrement: false - }, - yearOfCompletionOne: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "完工年度_1", - primaryKey: false, - field: "year_of_completion__one", - autoIncrement: false - }, - stationRange: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "桩号范围", - primaryKey: false, - field: "station_range", - autoIncrement: false - }, - reportingUnit: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "填报单位", - primaryKey: false, - field: "reporting_unit", - autoIncrement: false - }, - reasonForChange: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "变更原因", - primaryKey: false, - field: "reason_for_change", - autoIncrement: false - }, - changeTime: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "变更时间", - primaryKey: false, - field: "change_time", - autoIncrement: false - }, - lastRepairAndMaintenanceYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "最近一次修复养护年度", - primaryKey: false, - field: "last_repair_and_maintenance_year", - autoIncrement: false - }, - whetherMaintenanceManagedHighway: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "是否按干线公路管理接养", - primaryKey: false, - field: "whether_maintenance_managed_highway", - autoIncrement: false - }, - remarks: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "备注", - primaryKey: false, - field: "remarks", - autoIncrement: false - }, - routeCodeOfLastYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "上年路线编码", - primaryKey: false, - field: "route_code_of_last_year", - autoIncrement: false - }, - routeNameOfLastYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "上年路线名称", - primaryKey: false, - field: "route_name_of_last_year", - autoIncrement: false - }, - startingStationOfLastYear: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "上年起点桩号", - primaryKey: false, - field: "starting_station_of_last_year", - autoIncrement: false - }, - lastYearsEndingPointStakeNumber: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "上年止点桩号", - primaryKey: false, - field: "last_years_ending_point_stake_number", - autoIncrement: false - }, - graphicMileage: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "图形里程", - primaryKey: false, - field: "graphic_mileage", - autoIncrement: false - }, - chainageMileage: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "桩号里程", - primaryKey: false, - field: "chainage_mileage", - autoIncrement: false - }, - districtcounty: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "所在区县", - primaryKey: false, - field: "districtcounty", - autoIncrement: false - }, - locationCity: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "所在地市", - primaryKey: false, - field: "location_city", - autoIncrement: false - }, - level: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: null, - primaryKey: false, - field: "level", - autoIncrement: false - }, - surfaceThickness: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, - comment: "面层厚度", - primaryKey: false, - field: "surface_thickness", - autoIncrement: false - } - }, { - tableName: "road", - comment: "", - indexes: [] - }); - dc.models.Road = Road; - return Road; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Road = sequelize.define("road", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "road_id_uindex" + }, + routeName: { + index: 2, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线名称", + primaryKey: false, + field: "route_name", + autoIncrement: false + }, + routeCode: { + index: 3, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线代码", + primaryKey: false, + field: "route_code", + autoIncrement: false + }, + sectionNo: { + index: 4, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段序号", + primaryKey: false, + field: "section_no", + autoIncrement: false + }, + townshipCode: { + index: 5, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "乡镇编码", + primaryKey: false, + field: "township_code", + autoIncrement: false + }, + startingPlaceName: { + index: 6, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点地名", + primaryKey: false, + field: "starting_place_name", + autoIncrement: false + }, + startStation: { + index: 7, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点桩号", + primaryKey: false, + field: "start_station", + autoIncrement: false + }, + categoryOfStartingPointAndDividingPoint: { + index: 8, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "起点分界点类别", + primaryKey: false, + field: "category_of_starting_point_and_dividing_point", + autoIncrement: false + }, + stopPlaceName: { + index: 9, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点地名", + primaryKey: false, + field: "stop_place_name", + autoIncrement: false + }, + categoryOfDeadCenterAndDividingPoint: { + index: 10, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点分界点类别", + primaryKey: false, + field: "category_of_dead_center_and_dividing_point", + autoIncrement: false + }, + stopStation: { + index: 11, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "止点桩号", + primaryKey: false, + field: "stop_station", + autoIncrement: false + }, + sectionType: { + index: 12, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段类型", + primaryKey: false, + field: "section_type", + autoIncrement: false + }, + routeCodeBeforeRoadNetworkAdjustment: { + index: 13, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路网调整前路线编码", + primaryKey: false, + field: "route_code_before_road_network_adjustment", + autoIncrement: false + }, + serialNumberOfOriginalSection: { + index: 14, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段序号", + primaryKey: false, + field: "serial_number_of_original_section", + autoIncrement: false + }, + startingStakeNumberOfTheOriginalRoadSection: { + index: 15, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段起点桩号", + primaryKey: false, + field: "starting_stake_number_of_the_original_road_section", + autoIncrement: false + }, + endingPointStakeNoOfTheOriginalRoadSection: { + index: 16, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "原路段止点桩号", + primaryKey: false, + field: "ending_point_stake_no_of_the_original_road_section", + autoIncrement: false + }, + routeLevel: { + index: 17, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路线等级", + primaryKey: false, + field: "route_level", + autoIncrement: false + }, + natureOfRoadSection: { + index: 18, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路段性质", + primaryKey: false, + field: "nature_of_road_section", + autoIncrement: false + }, + completionTime: { + index: 19, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建成时间", + primaryKey: false, + field: "completion_time", + autoIncrement: false + }, + reconstructionTime: { + index: 20, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "改建时间", + primaryKey: false, + field: "reconstruction_time", + autoIncrement: false + }, + natureOfConstruction: { + index: 21, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "建设性质", + primaryKey: false, + field: "nature_of_construction", + autoIncrement: false + }, + gbmAndCivilizedModelRoad: { + index: 22, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "GBM及文明样板路", + primaryKey: false, + field: "gbm_and_civilized_model_road", + autoIncrement: false + }, + landforms: { + index: 23, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "地貌", + primaryKey: false, + field: "landforms", + autoIncrement: false + }, + natureOfCharges: { + index: 24, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "收费性质", + primaryKey: false, + field: "nature_of_charges", + autoIncrement: false + }, + tollStation: { + index: 25, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所属收费站", + primaryKey: false, + field: "toll_station", + autoIncrement: false + }, + numberOfCulverts: { + index: 26, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "涵洞数量", + primaryKey: false, + field: "number_of_culverts", + autoIncrement: false + }, + technicalLevel: { + index: 27, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "技术等级", + primaryKey: false, + field: "technical_level", + autoIncrement: false + }, + pavementType: { + index: 28, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面类型", + primaryKey: false, + field: "pavement_type", + autoIncrement: false + }, + pavementWidth: { + index: 29, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路面宽度", + primaryKey: false, + field: "pavement_width", + autoIncrement: false + }, + subgradeWidth: { + index: 30, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路基宽度", + primaryKey: false, + field: "subgrade_width", + autoIncrement: false + }, + laneCharacteristics: { + index: 31, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "车道特征", + primaryKey: false, + field: "lane_characteristics", + autoIncrement: false + }, + whetherItIsOpenToTrafficInSunnyOrRainyDays: { + index: 32, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否晴雨通车", + primaryKey: false, + field: "whether_it_is_open_to_traffic_in_sunny_or_rainy_days", + autoIncrement: false + }, + designSpeedPerHour: { + index: 33, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "设计时速", + primaryKey: false, + field: "design_speed_per_hour", + autoIncrement: false + }, + urbanManagementSectionOrNot: { + index: 34, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否城管路段", + primaryKey: false, + field: "urban_management_section_or_not", + autoIncrement: false + }, + managementAndMaintenanceUnit: { + index: 35, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "管养单位", + primaryKey: false, + field: "management_and_maintenance_unit", + autoIncrement: false + }, + roadAdministrationUnit: { + index: 36, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "路政管理单位", + primaryKey: false, + field: "road_administration_unit", + autoIncrement: false + }, + alimentation: { + index: 37, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养情况", + primaryKey: false, + field: "alimentation", + autoIncrement: false + }, + sourceOfListedMaintenanceFunds: { + index: 38, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "列养资金来源", + primaryKey: false, + field: "source_of_listed_maintenance_funds", + autoIncrement: false + }, + curingTime: { + index: 39, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "养护时间", + primaryKey: false, + field: "curing_time", + autoIncrement: false + }, + greeningMileage: { + index: 40, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "可绿化里程", + primaryKey: false, + field: "greening_mileage", + autoIncrement: false + }, + greeningMileaged: { + index: 41, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "已绿化里程", + primaryKey: false, + field: "greening_mileaged", + autoIncrement: false + }, + typeOfRepeatedRoadSection: { + index: 42, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复道路路段类型", + primaryKey: false, + field: "type_of_repeated_road_section", + autoIncrement: false + }, + serialNumberOfRepeatedSection: { + index: 43, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段序号", + primaryKey: false, + field: "serial_number_of_repeated_section", + autoIncrement: false + }, + repeatedSectionRouteCode: { + index: 44, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "重复路段路线编码", + primaryKey: false, + field: "repeated_section_route_code", + autoIncrement: false + }, + plannedFundCategory: { + index: 45, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划资金类别", + primaryKey: false, + field: "planned_fund_category", + autoIncrement: false + }, + plannedYear: { + index: 46, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划年度", + primaryKey: false, + field: "planned_year", + autoIncrement: false + }, + planDocumentNo: { + index: 47, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划文号", + primaryKey: false, + field: "plan_document_no", + autoIncrement: false + }, + planItemUniqueCode: { + index: 48, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目唯一编码", + primaryKey: false, + field: "plan_item_unique_code", + autoIncrement: false + }, + plannedProjectRouteCode: { + index: 49, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目路线编码", + primaryKey: false, + field: "planned_project_route_code", + autoIncrement: false + }, + planProjectName: { + index: 50, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目名称", + primaryKey: false, + field: "plan_project_name", + autoIncrement: false + }, + plannedProjectType: { + index: 51, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目类型", + primaryKey: false, + field: "planned_project_type", + autoIncrement: false + }, + completionStatus: { + index: 52, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工情况", + primaryKey: false, + field: "completion_status", + autoIncrement: false + }, + yearOfCompletion: { + index: 53, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工年度", + primaryKey: false, + field: "year_of_completion", + autoIncrement: false + }, + plannedFundCategoryOne: { + index: 54, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划资金类别_1", + primaryKey: false, + field: "planned_fund_category__one", + autoIncrement: false + }, + plannedYearOne: { + index: 55, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划年度_1", + primaryKey: false, + field: "planned_year__one", + autoIncrement: false + }, + planDocumentNoOne: { + index: 56, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划文号_1", + primaryKey: false, + field: "plan_document_no__one", + autoIncrement: false + }, + planItemUniqueCodeOne: { + index: 57, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目唯一编码_1", + primaryKey: false, + field: "plan_item_unique_code__one", + autoIncrement: false + }, + planProjectNameOne: { + index: 58, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "计划项目名称_1", + primaryKey: false, + field: "plan_project_name__one", + autoIncrement: false + }, + completionStatusOne: { + index: 59, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工情况_1", + primaryKey: false, + field: "completion_status__one", + autoIncrement: false + }, + yearOfCompletionOne: { + index: 60, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "完工年度_1", + primaryKey: false, + field: "year_of_completion__one", + autoIncrement: false + }, + stationRange: { + index: 61, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "桩号范围", + primaryKey: false, + field: "station_range", + autoIncrement: false + }, + reportingUnit: { + index: 62, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "填报单位", + primaryKey: false, + field: "reporting_unit", + autoIncrement: false + }, + reasonForChange: { + index: 63, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更原因", + primaryKey: false, + field: "reason_for_change", + autoIncrement: false + }, + changeTime: { + index: 64, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "变更时间", + primaryKey: false, + field: "change_time", + autoIncrement: false + }, + lastRepairAndMaintenanceYear: { + index: 65, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "最近一次修复养护年度", + primaryKey: false, + field: "last_repair_and_maintenance_year", + autoIncrement: false + }, + whetherMaintenanceManagedHighway: { + index: 66, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否按干线公路管理接养", + primaryKey: false, + field: "whether_maintenance_managed_highway", + autoIncrement: false + }, + remarks: { + index: 67, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "备注", + primaryKey: false, + field: "remarks", + autoIncrement: false + }, + routeCodeOfLastYear: { + index: 68, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线编码", + primaryKey: false, + field: "route_code_of_last_year", + autoIncrement: false + }, + routeNameOfLastYear: { + index: 69, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年路线名称", + primaryKey: false, + field: "route_name_of_last_year", + autoIncrement: false + }, + startingStationOfLastYear: { + index: 70, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年起点桩号", + primaryKey: false, + field: "starting_station_of_last_year", + autoIncrement: false + }, + lastYearsEndingPointStakeNumber: { + index: 71, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "上年止点桩号", + primaryKey: false, + field: "last_years_ending_point_stake_number", + autoIncrement: false + }, + graphicMileage: { + index: 72, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "图形里程", + primaryKey: false, + field: "graphic_mileage", + autoIncrement: false + }, + chainageMileage: { + index: 73, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "桩号里程", + primaryKey: false, + field: "chainage_mileage", + autoIncrement: false + }, + districtcounty: { + index: 74, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在区县", + primaryKey: false, + field: "districtcounty", + autoIncrement: false + }, + locationCity: { + index: 75, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "所在地市", + primaryKey: false, + field: "location_city", + autoIncrement: false + }, + level: { + index: 76, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "level", + autoIncrement: false + }, + surfaceThickness: { + index: 77, + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "面层厚度", + primaryKey: false, + field: "surface_thickness", + autoIncrement: false + } + }, { + tableName: "road", + comment: "", + indexes: [] + }); + dc.models.Road = Road; + return Road; }; \ No newline at end of file diff --git a/api/app/lib/models/statistic.js b/api/app/lib/models/statistic.js index b7e0b248..9e811f1a 100644 --- a/api/app/lib/models/statistic.js +++ b/api/app/lib/models/statistic.js @@ -2,51 +2,55 @@ 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const Statistic = sequelize.define("statistic", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true, - unique: "vehicle_id_uindex" - }, - name: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "name", - autoIncrement: false - }, - count: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: "0", - comment: null, - primaryKey: false, - field: "count", - autoIncrement: false - }, - type: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "type", - autoIncrement: false - } - }, { - tableName: "statistic", - comment: "", - indexes: [] - }); - dc.models.Statistic = Statistic; - return Statistic; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Statistic = sequelize.define("statistic", { + id: { + index: 1, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "vehicle_id_uindex" + }, + name: { + index: 2, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "name", + autoIncrement: false + }, + count: { + index: 3, + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: "0", + comment: null, + primaryKey: false, + field: "count", + autoIncrement: false + }, + type: { + index: 4, + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "type", + autoIncrement: false + } + }, { + tableName: "statistic", + comment: "", + indexes: [] + }); + dc.models.Statistic = Statistic; + return Statistic; }; \ No newline at end of file diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js index c93074d5..e741521e 100644 --- a/api/sequelize-automate.config.js +++ b/api/sequelize-automate.config.js @@ -18,6 +18,7 @@ module.exports = { timestamps: false, }, }, + // !!! 所有 model 都有自定义脚本所不能生成的内容 执行此脚本需谨慎 options: { type: 'freesun', // 指定 models 代码风格 camelCase: true, // Models 文件中代码是否使用驼峰命名 @@ -27,7 +28,7 @@ module.exports = { typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` tables: null, // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 - skipTables: ['report', 'publicity'], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 + skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 attrLength: false, // 在生成模型的字段中 是否生成 如 var(128)这种格式,公司一般使用 String ,则配置为 false