Commit 6ac6742d authored by ZWT's avatar ZWT

得到的

parent 7866e87b
......@@ -21,8 +21,8 @@ import java.util.Date;
@TableName("WEATHER_BUREAU_DATA")
public class WeatherBureauDataEnt implements Serializable {
@XText("ID")
@TableId(type = IdType.AUTO)
private Long id;
@TableId(type = IdType.ASSIGN_UUID)
private String id;
@XText("记录时间")
@TableField
......
......@@ -24,7 +24,7 @@ import java.util.Date;
public class WeatherBureauDataView implements Serializable {
@XText("ID")
@TableField
private Long id;
private String id;
@XText("记录时间")
@TableField
......
......@@ -555,6 +555,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
//去重
if (batchList.stream()
.noneMatch(item -> DateUtil.compare(item.getDataTime(), view.getDataTime()) == 0 && CharSequenceUtil.equals(item.getAreaCode(), view.getAreaCode()))) {
view.setId(BaseUtils.randomUUIDString());
batchList.add(view);
}
}
......
......@@ -58,6 +58,7 @@
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO WEATHER_BUREAU_DATA (
ID,
DATA_TIME,
WEATHER_ICON,
AIR_TEMPERATURE,
......@@ -71,6 +72,7 @@
) VALUES
<foreach collection="list" separator="," item="item">
(
#{item.id},
#{item.dataTime},
#{item.weatherIcon},
#{item.airTemperature},
......
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