Selaa lähdekoodia

增加 表删除 以及数据删除 逻辑

hxf 1 vuosi sitten
vanhempi
commit
5dce9109c7

+ 8 - 0
wrdep-biz/src/main/java/com/jiayue/biz/mapper/ProphaseAnemometryDataMapper.java

@@ -66,4 +66,12 @@ public interface ProphaseAnemometryDataMapper extends BaseMapper<ProphaseAnemome
     @Select("SELECT t1.ts,t1.ws_ave,t1.ws_sta,t1.wd_ave,t1.layer_height FROM prophase_anemometry_data t1 where  t1.equipment_id = #{equipmentId} and  t1.ts >= #{startTime} and t1.ts <= #{endTime}")
     List<ProphaseAnemometryData> selectWdAveAndWdAveAndWsSta(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
 
+
+    @Select("delete from anemometry_${equipmentId}_${height} where ts >= #{startTime} and ts <= #{endTime}")
+    void deleteByLayerHeightAndEquipmentId(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime,@Param("height") String height);
+
+
+    @Select("drop table if exists anemometry_${equipmentId}_${height}")
+    void deleteTable(@Param("equipmentId") String equipmentId,@Param("height") String height);
+
 }

+ 8 - 0
wrdep-biz/src/main/java/com/jiayue/biz/mapper/ProphaseAnemometryDataOrgMapper.java

@@ -28,4 +28,12 @@ public interface ProphaseAnemometryDataOrgMapper extends BaseMapper<ProphaseAnem
     @Select("SELECT * FROM prophase_anemometry_data_org t1 where  t1.equipment_id = #{equipmentId} and  t1.ts >= #{startTime} and t1.ts <= #{endTime}")
     List<ProphaseAnemometryData> selectAll(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
 
+    @Select("delete from anemometry_org_${equipmentId}_${height} where ts >= #{startTime} and ts <= #{endTime}")
+    void deleteByLayerHeightAndEquipmentId(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime,@Param("height") String height);
+
+
+    @Select("drop table if exists anemometry_org_${equipmentId}_${height}")
+    void deleteTable(@Param("equipmentId") String equipmentId,@Param("height") String height);
+
+
 }

+ 7 - 0
wrdep-biz/src/main/java/com/jiayue/biz/mapper/ProphaseWeatherDataMapper.java

@@ -52,4 +52,11 @@ public interface ProphaseWeatherDataMapper extends BaseMapper<ProphaseWeatherDat
     @Select("select last (ts) from nerp_db.weather_#{equipmentId}")
     List<Entity> getLastData(@Param("equipmentId") String equipmentId);
 
+
+    @Select("delete from weather_${equipmentId} where ts >= #{startTime} and ts <= #{endTime}")
+    void deleteByLayerHeightAndEquipmentId(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
+
+    @Select("drop table if exists weather_${equipmentId}")
+    void deleteTable(@Param("equipmentId") String equipmentId);
+
 }

+ 6 - 0
wrdep-biz/src/main/java/com/jiayue/biz/mapper/ProphaseWeatherDataOrgMapper.java

@@ -35,4 +35,10 @@ public interface ProphaseWeatherDataOrgMapper extends BaseMapper<ProphaseWeather
     @Select("select * from weather_org_${equipmentId} where equipment_id = #{equipmentId} and ts >= #{startTime} and ts <= #{endTime}")
     List<ProphaseWeatherData> selectPublicData(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
 
+    @Select("delete from weather_org_${equipmentId} where ts >= #{startTime} and ts <= #{endTime}")
+    void deleteByLayerHeightAndEquipmentId(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
+
+    @Select("drop table if exists weather_org_${equipmentId}")
+    void deleteTable(@Param("equipmentId") String equipmentId);
+
 }

+ 0 - 7
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/AnalysisDataImpl.java

@@ -890,33 +890,26 @@ public class AnalysisDataImpl {
                     hashMap.put("time", time1);
                     BigDecimal tAve = conversion("t_ave", row, rows);
                     hashMap.put("tAve", tAve);
-                    CheckDataRecode.map.put("tAve" + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
                     BigDecimal rhAve = conversion("rh_ave", row, rows);
                     hashMap.put("rhAve", rhAve);
-                    CheckDataRecode.map.put("rhAve" + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
                     BigDecimal paAve = conversion("pa_ave", row, rows);
                     hashMap.put("paAve", paAve);
-                    CheckDataRecode.map.put("paAve" + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
                     BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(CalculationUtil.getBigDecimal(tAve)), 2, RoundingMode.HALF_UP)).multiply(CalculationUtil.getBigDecimal(paAve)).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
                     hashMap.put("airDensity", airDensity);
-                    CheckDataRecode.map.put("airDensity" + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
                     for (Map.Entry<String, ArrayList<Double>> entry : wsStaMapList.entrySet()) {
 
                         BigDecimal wsAve = conversion("ws_Ave" + entry.getKey(), row, rows);
                         hashMap.put("wsAve_" + entry.getKey(), wsAve);
-                        CheckDataRecode.map.put("wsAve_" + entry.getKey() + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
 
                         BigDecimal wdAve = conversion("wd_Ave" + entry.getKey(), row, rows);
                         hashMap.put("wdAve_" + entry.getKey(), wdAve);
-                        CheckDataRecode.map.put("wdAve_" + entry.getKey() + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
 
                         hashMap.put("wsSta_" + entry.getKey(), CalculationUtil.calculateSD(entry.getValue()));
-                        CheckDataRecode.map.put("wsSta_" + entry.getKey() + "DeadDataStartTime", new DateTime(sdf.parse(time1)));
                     }
 //                    if(firstBoolean){
 //                        firstMap = hashMap;