修改MySQL版本
This commit is contained in:
+8
-2
@@ -24,7 +24,10 @@ class Seawater2SeabirdSyncBatch extends BaseBatch {
|
|||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
|
|
||||||
CommonUtils.findAllCity().each { city ->
|
CommonUtils.findAllCity().each { city ->
|
||||||
ElasticUtils.executeSqlQuery("select * from latest_seawater where city = '${city}' and cat = 'sell' and p_date > 20250601",{Map house->
|
def endDate = DateUtil.truncateDay(new Date()).format("yyyy-MM-dd")
|
||||||
|
def startDate = DateUtil.add(DateUtil.truncateDay(new Date()), -1).format("yyyy-MM-dd")
|
||||||
|
String sql = "select * from latest_seawater where city = '${city}' and cat = 'sell' and m_date >= '${startDate}' and m_date < '${endDate}'".toString()
|
||||||
|
ElasticUtils.executeSqlQuery(sql,{Map house->
|
||||||
def seabird = new BasicDBObject()
|
def seabird = new BasicDBObject()
|
||||||
seabird.put("city", city)
|
seabird.put("city", city)
|
||||||
seabird.put("cat", house.cat)
|
seabird.put("cat", house.cat)
|
||||||
@@ -44,7 +47,10 @@ class Seawater2SeabirdSyncBatch extends BaseBatch {
|
|||||||
seabird.put("direction", house.direction)
|
seabird.put("direction", house.direction)
|
||||||
seabird.put("status", 0)
|
seabird.put("status", 0)
|
||||||
seabird.put("publish_date", DateUtil.parseDate(house.p_date.toString(), "yyyyMMdd"))
|
seabird.put("publish_date", DateUtil.parseDate(house.p_date.toString(), "yyyyMMdd"))
|
||||||
DbUtils.seabird.save(seabird)
|
if(DbUtils.seabird.findOne(new BasicDBObject("url", house.url)) == null){
|
||||||
|
println(seabird)
|
||||||
|
DbUtils.seabird.save(seabird)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user