新增置信度同步至85

This commit is contained in:
Jian Shen
2022-05-23 11:45:50 +08:00
parent edf9694804
commit a9e7c4fa4b
@@ -27,14 +27,14 @@ class OracleDistrictBasePrice2Mongo85 {
static final DBCollection communityBasePriceConn = MongoUtils.getCollectionByName("business", "community_base_price_gj", "192.168.0.85", 28017)
static main(args) {
def sql = "SELECT cityname, distname, commid, commname, confi_rate FROM community_base_price_gj WHERE YEAR_MONTH='202205'"
def sql = "SELECT cityname, distname, commid, commname, confidence FROM community_base_price_gj WHERE YEAR_MONTH='202205'"
def count = 0
sqlInstance.eachRow(sql, { r ->
def city = r['cityname']
def region = RegionData.formatRegion(city, r['distname'])
DBObject dbObject = new BasicDBObject("_id", r['commid'])
if (r['confi_rate'] != null) {
def credit = new BigDecimal(r['confi_rate']).setScale(2, BigDecimal.ROUND_HALF_UP).toDouble()
if (r['confidence'] != null) {
def credit = new BigDecimal(r['confidence']).setScale(2, BigDecimal.ROUND_HALF_UP).toDouble()
DBObject updateObject = new BasicDBObject("city", city).append("region", region)
.append("name", r['commname'])
.append("credit", credit)