update
This commit is contained in:
+76
-2
@@ -757,7 +757,10 @@ class CommonDatautils {
|
|||||||
|
|
||||||
DBObject q = new BasicDBObject();
|
DBObject q = new BasicDBObject();
|
||||||
q.put("city", city);
|
q.put("city", city);
|
||||||
q.put("region", region);
|
if(region){
|
||||||
|
q.put("region", region);
|
||||||
|
}
|
||||||
|
|
||||||
q.put("name", name);
|
q.put("name", name);
|
||||||
q.put("cat", cat)
|
q.put("cat", cat)
|
||||||
q.put("status", 0)
|
q.put("status", 0)
|
||||||
@@ -788,7 +791,8 @@ class CommonDatautils {
|
|||||||
keys.put(field, 1);
|
keys.put(field, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
def dbsour = DbUtils.seaweed.find(q, keys).batchSize(2000)
|
|
||||||
|
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(2000)
|
||||||
// def dbsour = getDataStoreConnection().find(q, keys).batchSize(2000)
|
// def dbsour = getDataStoreConnection().find(q, keys).batchSize(2000)
|
||||||
def rets = []
|
def rets = []
|
||||||
for(def d : dbsour){
|
for(def d : dbsour){
|
||||||
@@ -1133,6 +1137,26 @@ class CommonDatautils {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static def findNormalDistrict(String city, String region, String name, String cat, List fields){
|
||||||
|
|
||||||
|
DBObject q = new BasicDBObject();
|
||||||
|
q.put("city", city);
|
||||||
|
q.put("cat", cat);
|
||||||
|
q.put("name", name);
|
||||||
|
if(region){
|
||||||
|
q.put("region", region);
|
||||||
|
}
|
||||||
|
q.put("status",0)
|
||||||
|
|
||||||
|
DBObject keys = new BasicDBObject();
|
||||||
|
if(fields){
|
||||||
|
for(def field : fields){
|
||||||
|
keys.put(field, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SEAWEED_COLL.findOne(q, keys);
|
||||||
|
}
|
||||||
|
|
||||||
public static def findDistrictsByCityAndName(String city, String name, String cat){
|
public static def findDistrictsByCityAndName(String city, String name, String cat){
|
||||||
DBObject q = new BasicDBObject();
|
DBObject q = new BasicDBObject();
|
||||||
q.put("city", city);
|
q.put("city", city);
|
||||||
@@ -4238,6 +4262,16 @@ class CommonDatautils {
|
|||||||
return map
|
return map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static def findThirdNetWorkOffices(city, region, name){
|
||||||
|
String sql = "select * from office where city='${city}' and region='${region}' and name='${name}'"
|
||||||
|
def datas = []
|
||||||
|
|
||||||
|
ElasticUtils.executeSqlQuery(sql, { m->
|
||||||
|
datas << m
|
||||||
|
})
|
||||||
|
return datas
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static def findThirdNetWorkOffice(){
|
static def findThirdNetWorkOffice(){
|
||||||
String sql = "select city,region,name,address,location from office where city='烟台' or city='北京'"
|
String sql = "select city,region,name,address,location from office where city='烟台' or city='北京'"
|
||||||
@@ -5173,6 +5207,46 @@ class CommonDatautils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static def queryAllTown(fields){
|
||||||
|
|
||||||
|
def q = new BasicDBObject()
|
||||||
|
q.put("type","乡镇街道")
|
||||||
|
|
||||||
|
def keys = new BasicDBObject()
|
||||||
|
for(def key : fields){
|
||||||
|
keys.put(key,1)
|
||||||
|
}
|
||||||
|
def dbcursor = ADMINISTRATIVE_MAPPING_COLL.find(q, keys).batchSize(5000).addOption(Bytes.QUERYOPTION_NOTIMEOUT)
|
||||||
|
def cityMap = [:]
|
||||||
|
for(def d : dbcursor){
|
||||||
|
def townMap = cityMap.get(d.city)
|
||||||
|
if(!townMap){
|
||||||
|
townMap = [:]
|
||||||
|
cityMap.put(d.city, townMap)
|
||||||
|
}
|
||||||
|
|
||||||
|
def distName = null
|
||||||
|
if(d.mzb_district_name){
|
||||||
|
distName = d.mzb_district_name
|
||||||
|
}else{
|
||||||
|
distName = d.district
|
||||||
|
}
|
||||||
|
if(distName){
|
||||||
|
def list = townMap.get(distName)
|
||||||
|
if(!list){
|
||||||
|
list = []
|
||||||
|
}
|
||||||
|
list << d
|
||||||
|
townMap.put(distName, list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// println "[${city}] 乡镇街道 加载完成 "+new Date().format("yyyy-MM-dd HH:mm:ss")
|
||||||
|
return cityMap
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static def queryFullRegionTownByCity(city, fields){
|
static def queryFullRegionTownByCity(city, fields){
|
||||||
|
|
||||||
def q = new BasicDBObject()
|
def q = new BasicDBObject()
|
||||||
|
|||||||
Reference in New Issue
Block a user