From 3efed3b8037896ca8cfede5cb5072bbfcdce2c23 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Mon, 25 Oct 2021 14:02:19 +0800 Subject: [PATCH] =?UTF-8?q?15=E4=B8=AA=E5=9F=8E=E5=B8=82=E5=B0=8F=E5=8C=BA?= =?UTF-8?q?=E8=9E=8D=E5=90=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ronghe/BigdataCommunityGJRHBatch.groovy | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy index 91c175264..c96c02ae1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/ronghe/BigdataCommunityGJRHBatch.groovy @@ -44,13 +44,7 @@ class BigdataCommunityGJRHBatch extends BaseBatch { public void process(Object args) { //"郑州","长沙","西安", - def citys = CcbCommonUtils.citys; - citys.remove("厦门") - citys.remove("杭州") - citys.remove("郑州") - citys.remove("长沙") - citys.remove("西安") - citys.remove("南京") + def citys = ["厦门","北京","上海","广州","深圳","重庆","郑州","长沙","西安","成都","东莞","佛山","杭州","合肥","南京","青岛","沈阳","苏州","天津","武汉"]//CcbCommonUtils.citys; def rows = [] // addBigdataDistrictFJW() @@ -76,24 +70,26 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } println city +" 小区加载完成 "+districts.size() - addBigdataCommunityGJRH(districts) + addBigdataCommunityGJRH(districts, cityCodeDataMap.get(city)) println city +" 1.小区表完成" - addBigdataCommbuildstruGJ(districts) + addBigdataCommbuildstruGJ(districts, cityCodeDataMap.get(city)) println city +" 2.小区建筑结构表" - addBigdataCommhousetypeGJ(districts) + addBigdataCommhousetypeGJ(districts, cityCodeDataMap.get(city)) println city +" 3.小区房屋类型表" - addBigdataCommbuildyearGj(districts) + addBigdataCommbuildyearGj(districts, cityCodeDataMap.get(city)) println city +" 4.小区建筑年代表" - addBigdataCommfeeGj(districts) + addBigdataCommfeeGj(districts, cityCodeDataMap.get(city)) println city +" 6.小区费用表" - addBigdataCommhouseuseGJ(districts) + addBigdataCommhouseuseGJ(districts, cityCodeDataMap.get(city)) println city +" 7.小区房屋用途表" - addBigdataPositionGJ(districts) + addBigdataPositionGJ(districts, cityCodeDataMap.get(city)) println city + " 8.地理位置表" } } - def addBigdataCommunityGJRH(def districts){ + def addBigdataCommunityGJRH(def districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMUNITY_FJW where CITYID='${cityid}'") sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ @@ -141,7 +137,8 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommbuildstruGJ(def districts){ + def addBigdataCommbuildstruGJ(def districts, def cityid){ + sqlInstance.executeUpdate("delete from BIGDATA_COMMBUILDSTRU_FJW where CITYID='${cityid}'") sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMBUILDSTRU_FJW (CITYID,COMMID,BUILDSTRU,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.buildstru}',${d.remark}," @@ -166,7 +163,9 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } - def addBigdataCommhousetypeGJ(def districts){ + def addBigdataCommhousetypeGJ(def districts, def cityid){ + sqlInstance.executeUpdate("delete from BIGDATA_COMMHOUSETYPE_FJW where CITYID='${cityid}'") + sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMHOUSETYPE_FJW (CITYID,COMMID,HOUSETYPE,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.housetype}',${d.remark}," @@ -190,7 +189,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommbuildyearGj(districts){ + def addBigdataCommbuildyearGj(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMBUILDYEAR_FJW where CITYID='${cityid}'") + sqlInstance.withBatch(batchsize) { stmt -> for(def d : districts){ if(d.buildyear){ @@ -216,7 +218,9 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommfeeGj(districts){ + def addBigdataCommfeeGj(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMFEE_FJW where CITYID='${cityid}'") def sqls = [] for(def d : districts){ @@ -261,7 +265,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataCommhouseuseGJ(districts){ + def addBigdataCommhouseuseGJ(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_COMMHOUSEUSE_FJW where CITYID='${cityid}'") + def sqls = [] for(def d : districts){ def sql = "INSERT INTO BIGDATA_COMMHOUSEUSE_FJW (CITYID,COMMID,HOUSEUSE,HOUSECNT,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES ('${d.cityid}', '${d.commid}','${d.houseuse}',${d.zts},${d.remark}," @@ -302,7 +309,10 @@ class BigdataCommunityGJRHBatch extends BaseBatch { } } - def addBigdataPositionGJ(districts){ + def addBigdataPositionGJ(districts, def cityid){ + + sqlInstance.executeUpdate("delete from BIGDATA_POSITION_FJW where CITYID='${cityid}'") + def sqls = [] def index = 1 for(def d : districts){