diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/seaweed/CountSeaweed.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/seaweed/CountSeaweed.groovy new file mode 100644 index 000000000..ff7f7d322 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/seaweed/CountSeaweed.groovy @@ -0,0 +1,36 @@ +package com.fangjia.script.temp.shenjian.seaweed + +import com.fangjia.script.util.DbUtils +import com.mongodb.BasicDBObject +import com.mongodb.DBObject + +/** + * @author shenjian + * @since 2021/6/4 + */ +class CountSeaweed { + static void main(String[] args) { + def cities = ["重庆", "达州", "曲靖", "昆明", "大理", "迪庆州", "福安", "平潭", "三明", "石狮", "柳州", "苏州"] + for (def city : cities) { + DBObject q = new BasicDBObject(); + q.put("city", city); + q.put("cat", "district"); + q.put("visible", 0); + if (city == "福安") { + city = "宁德" + q.put("city", city) + q.put("region", "福安") + } else if (city == "平潭") { + city = "福州" + q.put("city", city) + q.put("region", "平潭") + } else if (city == "石狮") { + city = "泉州" + q.put("city", city) + q.put("region", "石狮") + } + println(city + " " + DbUtils.seaweed.count(q)) + } + + } +}