소스 검색

甘肃日天气数据
变成
星图15天+星图120小时+曦谋

xiaowang 1 개월 전
부모
커밋
5ed3fd3b19
1개의 변경된 파일3개의 추가작업 그리고 10개의 파일을 삭제
  1. 3 10
      src/main/java/com/example/getweather/service/GetWeatherGeovisearth.java

+ 3 - 10
src/main/java/com/example/getweather/service/GetWeatherGeovisearth.java

@@ -22,7 +22,6 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.Statement;
 import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
 import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -522,15 +521,9 @@ public class GetWeatherGeovisearth {
             mergedList.sort(Comparator.comparing(HeFengDay::getTs));
             for (HeFengDay item : mergedList) {
                 String insertSQL = "INSERT INTO hefeng_day_unit_" + areaCode + " USING hefeng_day_unit TAGS('" + areaCode + "')  " +
-                        "(ts,wind_speed_day,wind_speed_m_day,wind_scale_day,wind_360_Day,precip,text_day,temp_max,temp_min,humidity,dswrf) values('"
-                        + item.getTs() + "', " + item.getWindSpeedDay() + ", " + item.getWindSpeedMDay() + ", " + item.getWindScaleDay() + ", " + item.getWind360Day() + ", "
-                        + item.getPrecip() + ", '" + item.getTextDay() + "', " + item.getTempMax() + ", " + item.getTempMin() + ", " + item.getHumidity() + ", "
-                        + item.getDswrf() + ")";
-                SimpleDateFormat simpleFormatter = new SimpleDateFormat("yyyy-MM-dd");
-                String insertSnap = "INSERT INTO weather_day_snap_" + areaCode + "_" + simpleFormatter.format(new Date()) + " USING hefeng_day_unit TAGS('" + areaCode + "','" + simpleFormatter.format(new Date()) + "')  " +
-                        "(ts,wind_speed_day,wind_speed_m_day,wind_scale_day,wind_360_Day,precip,text_day,temp_max,temp_min,humidity,dswrf) values('"
-                        + item.getTs() + "', " + item.getWindSpeedDay() + ", " + item.getWindSpeedMDay() + ", " + item.getWindScaleDay() + ", " + item.getWind360Day() + ", "
-                        + item.getPrecip() + ", '" + item.getTextDay() + "', " + item.getTempMax() + ", " + item.getTempMin() + ", " + item.getHumidity() + ", "
+                        "(ts,wind_speed_day,wind_speed_m_day,wind_scale_day,wind_scale_night,wind_360_Day,wind_360_night,precip,text_day,text_night,temp_max,temp_min,humidity,pressure,dswrf) values('"
+                        + item.getTs() + "', " + item.getWindSpeedDay() + ", " + item.getWindSpeedMDay() + ", " + item.getWindScaleDay() + ", " + item.getWindScaleNight() + ", " + item.getWind360Day() + ", " + item.getWind360Night() + ", "
+                        + item.getPrecip() + ", '" + item.getTextDay() + "', '" + item.getTextNight() + "', " + item.getTempMax() + ", " + item.getTempMin() + ", " + item.getHumidity() + ", " + item.getPressure() + ", "
                         + item.getDswrf() + ")";
                 int affectedRows = ps.executeUpdate(insertSQL);
             }