Commit 32ce56a1 authored by ZWT's avatar ZWT

得到的

parent f36ede1a
......@@ -21,8 +21,8 @@ import java.util.Date;
@TableName("THIRD_WEATHER_DATA")
public class ThirdWeatherDataEnt implements Serializable {
@XText("ID")
@TableId(type = IdType.AUTO)
private Long id;
@TableId(type = IdType.ASSIGN_UUID)
private String id;
@XText("太阳直接辐射[W/m2]")
@TableField
......
......@@ -24,7 +24,7 @@ import java.util.Date;
public class ThirdWeatherDataView implements Serializable {
@XText("ID")
@TableField
private Long id;
private String id;
@XText("太阳直接辐射[W/m2]")
@TableField
......
......@@ -88,6 +88,7 @@ public class ThirdApiWeatherDataListener implements ReadListener<ThirdApiWeather
for (ThirdApiWeatherExcelData excel : cachedDataList) {
DateTime time = DateUtil.parseDateTime(excel.getTime());
ThirdWeatherDataView thirdWeatherDataView = ThirdWeatherDataView.builder()
.id(BaseUtils.randomUUIDString())
.dni(excel.getDni())
.ghi(excel.getGhi())
.dhi(excel.getDhi())
......
......@@ -254,6 +254,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
//天气数据处理
List<ThirdWeatherDataView> weatherDataList = XCopyUtils.copyNewList(data, ThirdWeatherDataView.class);
for (ThirdWeatherDataView thirdWeatherDataView : weatherDataList) {
thirdWeatherDataView.setId(BaseUtils.randomUUIDString());
thirdWeatherDataView.setLongitude(longitude);
thirdWeatherDataView.setLatitude(latitude);
thirdWeatherDataView.setUpdateTime(timeUpdated);
......
......@@ -76,11 +76,12 @@
</select>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO THIRD_WEATHER_DATA ( DNI, GHI, DHI, FORECAST_TIME, TEM, RHU, WNS, WND, WNS_GRD, GUST, PRE,
INSERT INTO THIRD_WEATHER_DATA (ID, DNI, GHI, DHI, FORECAST_TIME, TEM, RHU, WNS, WND, WNS_GRD, GUST, PRE,
PRS_QFE, VIS, CLO, UVB, UVI, PHS, WEP, WND_100M, WNS_100M, WNS_GRD_100M, UPDATE_TIME, CREATE_TIME, LONGITUDE,
LATITUDE) VALUES
<foreach collection="list" separator="," item="item">
(
#{item.id},
#{item.dni},
#{item.ghi},
#{item.dhi},
......
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