Merge branch 'script_gj' into 'master'
Script gj See merge request !116
This commit is contained in:
+3
-4
@@ -32,8 +32,7 @@ class UpdateHouseRegion {
|
||||
}
|
||||
def run(){
|
||||
def city = "º¼ÖÝ"
|
||||
// findCount(city, 20210101);
|
||||
def rets = findHouseSource(city, 20200101, 20200731)
|
||||
def rets = findHouseSource(city, 20190701, 20191231)
|
||||
batchUpdate(city, rets);
|
||||
}
|
||||
|
||||
@@ -91,7 +90,7 @@ class UpdateHouseRegion {
|
||||
|
||||
def findHouseSource(def city, def startDate, def endDate){
|
||||
final StringBuffer sqlBuffer = new StringBuffer()
|
||||
sqlBuffer.append("SELECT * FROM \"seawater-2020\" WHERE 1=1")
|
||||
sqlBuffer.append("SELECT * FROM \"seawater-2019\" WHERE 1=1")
|
||||
sqlBuffer.append(" and city = '"+city+"'")
|
||||
sqlBuffer.append(" and cat = 'sell'")
|
||||
sqlBuffer.append(" and p_date >="+startDate).append(" and p_date <"+endDate);
|
||||
@@ -109,7 +108,7 @@ class UpdateHouseRegion {
|
||||
def updateHouseRegion2(def url, def region){
|
||||
def header = [:]
|
||||
header["Authorization"] = "Basic ${Base64.getEncoder().encodeToString("developer:5e8edd851d2fdfbd7415232c67367cc3".getBytes("UTF-8"))}".toString()
|
||||
String seawaterUrl = "http://192.168.0.206:9200/seawater-2020/_update_by_query?conflicts=proceed&scroll_size=1000&wait_for_completion=false"
|
||||
String seawaterUrl = "http://192.168.0.206:9200/seawater-2019/_update_by_query?conflicts=proceed&scroll_size=1000&wait_for_completion=false"
|
||||
def body = """
|
||||
{
|
||||
"script": {
|
||||
|
||||
Reference in New Issue
Block a user