Browse Source

(*)脚本更新

dev
peng.peng 1 year ago
parent
commit
5bbe885812
  1. 10
      scripts/1.4.1/data/1_insert_road_data/index.js

10
scripts/1.4.1/data/1_insert_road_data/index.js

@ -8,12 +8,12 @@ try {
// const pool = new Pool({ // const pool = new Pool({
// user: 'postgres', // user: 'postgres',
// host: '10.8.30.32', // host: '10.8.30.32',
// database: 'highways4good', // database: 'highwaytest',
// password: '123', // password: '123',
// port: 5432, // port: 5432,
// }) // })
// 测试环境 // // 测试环境
const pool = new Pool({ const pool = new Pool({
user: 'highwayadmin', user: 'highwayadmin',
host: '10.8.40.223', host: '10.8.40.223',
@ -138,14 +138,12 @@ try {
Object.keys(r).forEach(key => { Object.keys(r).forEach(key => {
arr.push(key) arr.push(key)
}) })
if (r.route_name == '中心路—山上村四组路') { if (r.route_name == '中心公路一龚乐路') {
console.log(1) console.log(1)
} }
let isExit = allRoads.find(s => s.route_code == r.route_code && (s.section_no == r.section_no || !s.section_no) && s.route_name == r.route_name) let isExit = allRoads.find(s => s.route_code == r.route_code && (s.section_no == r.section_no || !s.section_no) && s.route_name == r.route_name)
if (isExit) { if (isExit) {
if (del != r.del && spot != r.spot && township_code != isExit.township_code) { villageSql += `UPDATE road SET village_id = ${villageId}, "del" = ${del}, spot = ${spot}, "township_code" = ${township_code ? township_code : `null`} WHERE id = ${isExit.id};\n`
villageSql += `UPDATE road SET village_id = ${villageId}, "del" = ${del}, spot = ${spot}, "township_code" = ${township_code ? township_code : `null`} WHERE id = ${isExit.id};\n`
}
} else { } else {
const { const {
route_name = `null`, route_code = `null`, section_no = `null`, starting_place_name = `null`, route_name = `null`, route_code = `null`, section_no = `null`, starting_place_name = `null`,

Loading…
Cancel
Save