Commit 51c54e82 authored by ZWT's avatar ZWT

得到的

parent 18488d5e
......@@ -21,8 +21,8 @@ import java.util.Date;
@TableName("WIND_PREDICTION_HISTORY")
public class WindPredictionHistoryEnt implements Serializable {
@XText("ID")
@TableId(type = IdType.AUTO)
private Long id;
@TableId(type = IdType.ASSIGN_UUID)
private String id;
@XText("风电站ID")
@TableField
......
......@@ -24,7 +24,7 @@ import java.util.Date;
public class WindPredictionHistoryView implements Serializable {
@XText("ID")
@TableField
private Long id;
private String id;
@XText("风电站ID")
@TableField
......
......@@ -81,6 +81,7 @@ public class ThirdApiWeatherDataListener2 implements ReadListener<ThirdApiWeathe
break;
}
WindPredictionHistoryView historyView = new WindPredictionHistoryView();
historyView.setId(BaseUtils.randomUUIDString());
historyView.setStationId(stationId);
historyView.setDataTime(dateTime);
historyView.setWindDirection(data.getWnd());
......
......@@ -95,6 +95,7 @@ public class WindPredictionDataListener implements ReadListener<WindPredictionEx
//去重
if (historyList.stream()
.noneMatch(item -> DateUtil.compare(item.getDataTime(), build.getDataTime()) == 0)) {
build.setId(BaseUtils.randomUUIDString());
historyList.add(build);
}
}
......
......@@ -108,6 +108,7 @@ public class WindPredictionHistoryCloudServiceImpl implements IWindPredictionHis
ThirdWindPowerGenerationEnt ent;
for (WindPredictionFutureEnt future : list) {
WindPredictionHistoryView view = new WindPredictionHistoryView();
view.setId(BaseUtils.randomUUIDString());
view.setStationId(future.getStationId());
view.setDataTime(future.getDataTime());
view.setWindDirection(future.getWindDirection());
......
......@@ -62,11 +62,12 @@
</delete>
<insert id="batchInsert" parameterType="list">
INSERT INTO WIND_PREDICTION_HISTORY (STATION_ID, DATA_TIME, WIND_DIRECTION, WIND_SPEED, AIR_TEMPERATURE,
INSERT INTO WIND_PREDICTION_HISTORY (ID, STATION_ID, DATA_TIME, WIND_DIRECTION, WIND_SPEED, AIR_TEMPERATURE,
HUMIDITY, PRESSURE, ACTUAL_WIND_DIRECTION, ACTUAL_WIND_SPEED, ACTUAL_POWER, PREDICTED_POWER, WND_100M,
WNS_100M, WNS_GRD_100M) VALUES
<foreach collection="list" separator="," item="item">
(
#{item.id},
#{item.stationId},
#{item.dataTime},
#{item.windDirection},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment