Kaynağa Gözat

添加火运去重

Redeem 1 hafta önce
ebeveyn
işleme
6057e3e5ad
33 değiştirilmiş dosya ile 605 ekleme ve 3800 silme
  1. 12 12
      pom.xml
  2. 15 0
      src/main/java/com/steerinfo/abnormalHandler/dto/ActualRecord.java
  3. 15 0
      src/main/java/com/steerinfo/abnormalHandler/dto/DuplicateFirstGroup.java
  4. 9 0
      src/main/java/com/steerinfo/abnormalHandler/dto/DuplicatePrediction.java
  5. 18 0
      src/main/java/com/steerinfo/abnormalHandler/dto/FirstRecord.java
  6. 10 0
      src/main/java/com/steerinfo/abnormalHandler/dto/RailwayActualDuplicateGroup.java
  7. 13 0
      src/main/java/com/steerinfo/abnormalHandler/dto/RailwayActualRecord.java
  8. 11 0
      src/main/java/com/steerinfo/abnormalHandler/dto/RailwayFirstDuplicateGroup.java
  9. 8 2
      src/main/java/com/steerinfo/abnormalHandler/scheduler/StatusSyncScheduler.java
  10. 162 25
      src/main/java/com/steerinfo/abnormalHandler/service/StatusSyncService.java
  11. 6 70
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.java
  12. 32 1500
      src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.xml
  13. 20 77
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.java
  14. 40 636
      src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.xml
  15. 2 0
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/mapper/MeterWorkMonitorMapper.java
  16. 68 0
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/mapper/MeterWorkMonitorMapper.xml
  17. 0 67
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorRtdbBootstrap.java
  18. 0 219
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorRtdbRepository.java
  19. 0 446
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorTupleCodec.java
  20. 0 30
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/scheduler/MeterWorkMonitorSyncScheduler.java
  21. 0 4
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/IMeterWorkMonitorService.java
  22. 0 39
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/MeterWorkMonitorSyncService.java
  23. 0 151
      src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/impl/MeterWorkMonitorServiceImpl.java
  24. 13 0
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.java
  25. 113 0
      src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.xml
  26. 0 17
      src/main/java/com/steerinfo/meterwork/rtdb/RtdbClientConfiguration.java
  27. 0 189
      src/main/java/com/steerinfo/meterwork/rtdb/RtdbClientPool.java
  28. 0 130
      src/main/java/com/steerinfo/meterwork/rtdb/RtdbPoolProperties.java
  29. 32 7
      src/main/resources/application-dev.properties
  30. 0 9
      src/main/resources/application-prod.properties
  31. 0 9
      src/main/resources/application.properties
  32. 6 6
      src/main/resources/bootstrap.yml
  33. 0 155
      src/main/resources/jg_wzjl_scheduled_job-prod.properties

+ 12 - 12
pom.xml

@@ -121,18 +121,18 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <!-- 排除 classes 目录下的这两个配置文件 -->
-                        <exclude>**/application.properties</exclude>
-                        <exclude>**/application-prod.properties</exclude>
-                        <exclude>**/application-dev.properties</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-jar-plugin</artifactId>-->
+<!--                <configuration>-->
+<!--                    <excludes>-->
+<!--                        &lt;!&ndash; 排除 classes 目录下的这两个配置文件 &ndash;&gt;-->
+<!--                        <exclude>**/application.properties</exclude>-->
+<!--                        <exclude>**/application-prod.properties</exclude>-->
+<!--                        <exclude>**/application-dev.properties</exclude>-->
+<!--                    </excludes>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
 
         </plugins>
         <pluginManagement>

+ 15 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/ActualRecord.java

@@ -0,0 +1,15 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ActualRecord {
+    private String actualNo;
+    private String predictionNo;
+    private String actualFirst1No;
+    private String actualFirst2No;
+    private Date createTime;
+    private String valueFlag;
+}

+ 15 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/DuplicateFirstGroup.java

@@ -0,0 +1,15 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+@Data
+public class DuplicateFirstGroup {
+    private String createTimeSec;
+    private String predictionNo;
+    private String carNo;
+    private String baseSpotNo;
+    private Double meterWeight;
+    private String forwardingUnitNo;
+    private String receivingUintNo;
+    private Integer count;
+}

+ 9 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/DuplicatePrediction.java

@@ -0,0 +1,9 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+@Data
+public class DuplicatePrediction {
+    private String predictionNo;
+    private Integer count;
+}

+ 18 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/FirstRecord.java

@@ -0,0 +1,18 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FirstRecord {
+
+    private String actualFirstNo;
+    private String predictionNo;
+    private String carNo;
+    private String baseSpotNo;
+    private Double meterWeight;
+    private Date createTime;
+    private String forwardingUnitNo;
+    private String receivingUintNo;
+}

+ 10 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/RailwayActualDuplicateGroup.java

@@ -0,0 +1,10 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+@Data
+public class RailwayActualDuplicateGroup {
+    private String railwayNo;
+    private String actualList;       // "ACT001,ACT002,ACT003"
+    private String maxCreateTime;    // 只是为了按时间排序,实际用不上
+}

+ 13 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/RailwayActualRecord.java

@@ -0,0 +1,13 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class RailwayActualRecord {
+    private String actualNo;
+    private String railwayNo;
+    private String createTime;
+    private String valueFlag;
+}

+ 11 - 0
src/main/java/com/steerinfo/abnormalHandler/dto/RailwayFirstDuplicateGroup.java

@@ -0,0 +1,11 @@
+package com.steerinfo.abnormalHandler.dto;
+
+import lombok.Data;
+
+@Data
+public class RailwayFirstDuplicateGroup {
+    private String railwayNo;
+    private Integer tonnage;
+    private Integer cnt;
+    private String actualList;   // 逗号分隔的 ACTUAL_FIRST_NO 列表
+}

+ 8 - 2
src/main/java/com/steerinfo/abnormalHandler/scheduler/StatusSyncScheduler.java

@@ -13,7 +13,6 @@ import org.springframework.stereotype.Component;
  */
 @Component
 @Slf4j
-@ConditionalOnProperty(name = "meter.status.sync.enabled", havingValue = "true", matchIfMissing = false)
 public class StatusSyncScheduler {
 
     @Autowired
@@ -24,7 +23,14 @@ public class StatusSyncScheduler {
      */
     @Scheduled(cron = "${meter.status.sync.cron:0 */3 * * * ?}")
     public void scheduledSync() {
-        log.info("========== 开始执行状态同步定时任务 ==========");
+        log.info("========== 开始执行状态监测定时任务 ==========");
         statusSyncService.doSync();
     }
+
+    @Scheduled(cron = "${meter.status.sync.cron:0 */2 * * * ?}")
+    public void scheduledRemove() {
+        log.info("========== 开始执行重复事件监测定时任务 ==========");
+        statusSyncService.deduplicateRailwayActual();
+        statusSyncService.deduplicateRailwayFirst();
+    }
 }

+ 162 - 25
src/main/java/com/steerinfo/abnormalHandler/service/StatusSyncService.java

@@ -1,6 +1,8 @@
 package com.steerinfo.abnormalHandler.service;
 
+import com.steerinfo.abnormalHandler.dto.*;
 import com.steerinfo.abnormalHandler.mapper.StatusSyncMapper;
+import com.steerinfo.meterwork.meterworkcaractual.mapper.MeterWorkCarActualMapper;
 import com.steerinfo.meterwork.meterworkcaractualfirst.mapper.MeterWorkCarActualFirstMapper;
 import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
 import com.steerinfo.meterwork.meterworkrailwayactfirst.mapper.MeterWorkRailwayActFirstMapper;
@@ -16,9 +18,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 @Service
 @Slf4j
@@ -30,12 +30,17 @@ public class StatusSyncService {
     @Autowired
     private MeterWorkCarActualFirstMapper meterWorkCarActualFirstMapper;
 
+    @Autowired
+    private MeterWorkCarActualMapper meterWorkCarActualMapper;
+
     @Autowired
     private PreTrackScaleMapper preTrackScaleMapper;
 
     @Autowired
     private MeterWorkRailwayActFirstMapper meterWorkRailwayActFirstMapper;
 
+
+
     @Autowired
     private PreRailwayScaleMapper preRailwayScaleMapper;
 
@@ -65,6 +70,11 @@ public class StatusSyncService {
         // 最后是预报表状态不对,已经未使用了,但是预报表还是正使用或者已使用,返回的是预报编号
 //        List<String> trainRule4List  = meterWorkRailwayActFirstMapper.selectRule4PredictionNos();
 
+        // ============================================================
+        // 查询重复的汽运一次数据、二次数据
+        List<Map<String, Objects>> actualFirstNoMap = meterWorkCarActualFirstMapper.selectReActualFirstNoMap();
+
+        List<Map<String, Objects>> actualNoMap = meterWorkCarActualFirstMapper.selectReActualNoMap();
 
         // 2. 日志记录每条规则查到多少条
         // ============================================================
@@ -119,28 +129,6 @@ public class StatusSyncService {
             log.info("【汽运规则3】无待处理数据,跳过");
         }
 
-//        // ---- 汽运规则4:预报表 '正使用(1)/已使用(2)' → '未使用(4)' ----
-//        if (!carRule4List.isEmpty()) {
-//            int[] result = executeUpdates(carRule4List,
-//                    id -> meterWorkCarActualFirstMapper.updatePredictionByRule4(id),
-//                    "汽运规则4", "预报表 已使用/正使用→未使用");
-//            totalSuccess += result[0];
-//            totalFail += result[1];
-//        } else {
-//            log.info("【汽运规则4】无待处理数据,跳过");
-//        }
-
-        // ---- 汽运规则5:一次表 '已结净(2)' → '有效(1)'(回退) ----
-//        if (!carRule5List.isEmpty()) {
-//            int[] result = executeUpdates(carRule5List,
-//                    id -> meterWorkCarActualFirstMapper.updateFirstByRule5(id),
-//                    "汽运规则5", "一次表 已结净→有效(回退)");
-//            totalSuccess += result[0];
-//            totalFail += result[1];
-//        } else {
-//            log.info("【汽运规则5】无待处理数据,跳过");
-//        }
-
         // ---- 火运规则1 ----
         if (!trainRule1List.isEmpty()) {
             int[] result = executeUpdates(trainRule1List,
@@ -221,6 +209,155 @@ public class StatusSyncService {
         return updateFunc.apply(id);
     }
 
+    /**
+     * 火运洁净表去重
+     */
+    /**
+     * 火运洁净表去重(简化版,不做二次排序)
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void deduplicateRailwayActual() {
+        log.info("========== 火运洁净表去重 ==========");
+        // 1. 查询重复组
+        List<RailwayActualDuplicateGroup> groups = meterWorkRailwayActFirstMapper.selectDuplicateRailwayActualGroups();
+        if (groups == null || groups.isEmpty()) {
+            log.info("火运洁净表:无重复数据");
+            return;
+        }
+        log.info("火运洁净表:发现 {} 个重复分组", groups.size());
+        int totalInvalidated = 0;
+        for (RailwayActualDuplicateGroup group : groups) {
+            // 2. 拆分 ACTUAL_LIST(已经是按 CREATE_TIME DESC 排好的)
+            //    例如 "ACT003,ACT002,ACT001"
+            String[] actualArray = group.getActualList().split(",");
+            if (actualArray.length <= 1) {
+                continue;
+            }
+            // 3. 保留最后一个(CREATE_TIME 最早的),
+            //    作废前面所有(CREATE_TIME 更晚的)
+            String keepActualNo = actualArray[actualArray.length - 1];
+            log.info("分组 {}: 共 {} 条,保留 {}", group.getRailwayNo(), actualArray.length, keepActualNo);
+            for (int i = 0; i < actualArray.length - 1; i++) {
+                String actualNo = actualArray[i];
+                int rows = meterWorkRailwayActFirstMapper.invalidateRailwayActualRecord(actualNo);
+                if (rows > 0) {
+                    totalInvalidated++;
+                    log.info("作废: {},保留: {}", actualNo, keepActualNo);
+                }
+            }
+        }
+
+        log.info("火运洁净表去重完成,总作废 {} 条", totalInvalidated);
+    }
+
+//    @Transactional
+//    public void deduplicateActual() {
+//        log.info("========== 洁净表去重 ==========");
+//        List<DuplicatePrediction> duplicates = meterWorkCarActualMapper.selectDuplicatePredictions();
+
+//        log.info("发现 {} 个重复预报号", duplicates.size());
+//        for (DuplicatePrediction dup : duplicates) {
+//            List<ActualRecord> records = meterWorkCarActualMapper.selectActualRecordsByPrediction(dup.getPredictionNo());
+//            if (records == null || records.size() <= 1) continue;
+//            // 第一条是保留的,其余作废
+//            String keepNo = records.get(0).getActualNo();
+//            log.info("预报号 {}: 共{}条,保留 {}", dup.getPredictionNo(), records.size(), keepNo);
+//
+//            for (int i = 1; i < records.size(); i++) {
+//                String actualNo = records.get(i).getActualNo();
+//                int rows = meterWorkCarActualMapper.invalidateActualRecord(actualNo);
+//                if (rows > 0) {
+//                    log.info("作废洁净记录: {}", actualNo);
+//                }
+//            }
+//        }
+//    }
+
+    // ===== 一次表去重 =====
+//    @Transactional
+//    public void deduplicateFirst() {
+//        log.info("========== 一次表去重 ==========");
+//        List<DuplicateFirstGroup> groups = meterWorkCarActualFirstMapper.selectDuplicateFirstGroups();
+//        if (groups == null || groups.isEmpty()) {
+//            log.info("一次表:无重复分组");
+//            return;
+//        }
+//        log.info("发现 {} 个重复分组", groups.size());
+//
+//        for (DuplicateFirstGroup group : groups) {
+//            List<FirstRecord> records = meterWorkCarActualFirstMapper.selectFirstRecordsByGroup(
+//                    group.getCreateTimeSec(),
+//                    group.getPredictionNo(),
+//                    group.getCarNo(),
+//                    group.getBaseSpotNo(),
+//                    group.getMeterWeight(),
+//                    group.getForwardingUnitNo(),
+//                    group.getReceivingUintNo()
+//            );
+//
+//            if (records == null || records.size() <= 1) continue;
+//
+//            int remaining = records.size();
+//            log.info("重复组: 预报={}, 车号={}, 重量={}, 共{}条",
+//                    group.getPredictionNo(), group.getCarNo(), group.getMeterWeight(), remaining);
+//
+//            for (FirstRecord record : records) {
+//                if (remaining <= 1) break;
+//                // 判断是否在洁净表中被引用
+//                int boundCount = meterWorkCarActualFirstMapper.countActualBoundByFirstNo(record.getActualFirstNo());
+//                if (boundCount > 0) {
+//                    log.debug("保留: {}(已绑定洁净表)", record.getActualFirstNo());
+//                    continue;
+//                }
+//                // 未绑定 → 作废
+//                int rows = meterWorkCarActualFirstMapper.invalidateFirstRecord(record.getActualFirstNo());
+//                if (rows > 0) {
+//                    remaining--;
+//                    log.info("作废: {}(未绑定),剩余: {}", record.getActualFirstNo(), remaining);
+//                }
+//            }
+//
+//            if (remaining > 1) {
+//                log.warn("【预警】重复组剩余{}条全部已绑定,无法自动处理: 预报={}",
+//                        remaining, group.getPredictionNo());
+//            }
+//        }
+//    }
+
+    @Transactional
+    public void deduplicateRailwayFirst() {
+        log.info("========== 火运一次表去重 ==========");
+        // 1. 查询重复组
+        List<RailwayFirstDuplicateGroup> groups =
+                meterWorkRailwayActFirstMapper.selectDuplicateRailwayFirstGroups();
+        if (groups == null || groups.isEmpty()) {
+            log.info("火运一次表:无重复数据");
+            return;
+        }
+        log.info("火运一次表:发现 {} 个重复分组", groups.size());
+        int totalInvalidated = 0;
+        for (RailwayFirstDuplicateGroup group : groups) {
+            // 2. 拆分 ACTUAL_LIST(按 CREATE_TIME ASC 排好序的)
+            String[] actualArray = group.getActualList().split(",");
+            if (actualArray.length <= 1) {
+                continue;
+            }
+            // 3. 保留第一个(CREATE_TIME 最早的),作废后面的
+            String keepActualFirstNo = actualArray[0];
+            log.info("预报号 {}: 共 {} 条重复记录,保留 {}",
+                    group.getRailwayNo(), actualArray.length, keepActualFirstNo);
+            for (int i = 1; i < actualArray.length; i++) {
+                String actualFirstNo = actualArray[i];
+                int rows = meterWorkRailwayActFirstMapper.invalidateRailwayFirstRecord(actualFirstNo);
+                if (rows > 0) {
+                    totalInvalidated++;
+                    log.info("作废: {}(保留 {})", actualFirstNo, keepActualFirstNo);
+                }
+            }
+        }
+        log.info("火运一次表去重完成,总作废 {} 条", totalInvalidated);
+    }
+
     /**
      * 函数式接口
      */

+ 6 - 70
src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.java

@@ -1,9 +1,11 @@
 package com.steerinfo.meterwork.meterworkcaractual.mapper;
 
+import com.steerinfo.abnormalHandler.dto.ActualRecord;
+import com.steerinfo.abnormalHandler.dto.DuplicatePrediction;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
-import feign.Param;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
 import java.util.HashMap;
@@ -14,75 +16,9 @@ import java.util.Objects;
 @Mapper
 public interface MeterWorkCarActualMapper extends IBaseMapper<MeterWorkCarActual, String> {
 
-    List<MeterWorkCarActual> selectView(Map<Objects,String> map);
-    //一次皮重结净
-    MeterWorkCarActual manualAdd(@Param( value = "actualFirstNo") String actualFirstNo, @Param( value = "dataNo")String dataNo);
+    List<DuplicatePrediction> selectDuplicatePredictions();
 
-    //一次皮重结净
-    MeterWorkCarActual manualAddPre(@Param( value = "actualFirstNo") String actualFirstNo, @Param( value = "dataNo")String dataNo, @Param( value = "predictionNo")String predictionNo);
-
-    MeterWorkCarActual mathPredcition(@Param(value = "actualNo") String actualNo, @Param(value = "predictionNo") String predictionNo);
-
-    MeterWorkCarActual cleanPredcition(@Param(value = "actualNo") String actualNo);
-
-    String getNewID(@org.apache.ibatis.annotations.Param(value="afl")String afl);
-    //期限皮重结净
-    MeterWorkCarActual tareAdd(@Param( value = "actualFirstNo") String actualFirstNo, @Param( value = "dataNo")String dataNo);
-
-    List<MeterWorkCarActual> selectByTime(Map<Objects,String> map);
-
-    List<MeterWorkCarActual> selectParameters(Map<String, Object> map);
-
-    List<MeterWorkCarActual> selectManualData(Map<String, Object> map);
-
-    int selectCarNoCount(Map<String, Object> map);
-
-    //查询需要
-    List<MeterWorkCarActual> selectDataConversionOfCar(Map<String, Object> map);
-
-    //查询车号今天是第几次出现
-    List<MeterWorkCarActual> selectRepeatCarNO(Map<String, Object> map);
-
-    /**
-     * 根据传入时间和车号,查询给定时间段去重车号
-     * @param obj
-     * @return
-     */
-    List<MeterWorkCarActual> distinctCarNo(HashMap<String, Object> obj);
-
-    List<MeterWorkCarActual> getCarActual(Map<String, Object> obj);
-
-    MeterWorkCarActual selectActual(String actualFirstNo);
-
-    List<MeterWorkCarActual> likeByDesc(Map<String, Object> params);
-    List<MeterWorkCarActual> carActualDataDetail(Map<String, Object> params);
-
-    List<MeterWorkCarActual> selectByMap(Map<String, Object> params);
-
-    List<HashMap> selectOldAndNew(Map<String, Object> params);
-    List<HashMap> doQueryFirstOldAndNew(Map<String, Object> params);
-    List<HashMap> countOldAndNew(Map<String, Object> params);
-
-    //根据时间查询所有秤点的结净已匹配、结净未匹配、结净已上传、结净未上传
-    List<MeterWorkCarActual> countAllState(Map<String, Object> params);
-    List<HashMap> countDayAllState(Map<String, Object> params);
-    List<HashMap> netWeightAndTheoryAmount(Map<String, Object> params);
-
-    //查询符合内倒双委托车辆在铁合金秤点用普通委托信息过磅的结净信息倒序
-    List<MeterWorkCarActual> findTHJNetWeight(Map<String, Object> params);
-    List<MeterWorkCarActual> findFiveNetWeight(Map<String, Object> params);
-
-    //小洁净和负洁净重量比对核查
-    List<MeterWorkCarActual> smallAndNegativeNetWeightRatio(Map<String, Object> params);
-
-    List<HashMap> getNetFilterCheck(HashMap<String, Object> params);
-
-    List<HashMap> getNetFilterCheckWeightReversal(HashMap<String, Object> params);
-
-    List<MeterWorkCarActual> findCommonRemove();
-
-    List<MeterWorkCarActual> selectByMapRe(HashMap<String, Object> actualInfoMap);
-
-    BigDecimal selectLastUpWeightByCarNo(String carNo);
+    List<ActualRecord> selectActualRecordsByPrediction(@Param("predictionNo") String predictionNo);
 
+    int invalidateActualRecord(@Param("actualNo") String actualNo);
 }

+ 32 - 1500
src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.xml

@@ -3354,1506 +3354,38 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <sql id="whereTime">
-    <where>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-  </sql>
-  <select id="selectView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT *
-    from meter_work_car_actual_view
-    <where>
-      <if test="carNo != null and carNo != ''">
-        and CAR_NO LIKE '%${carNo}%'
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO = #{matterNo}
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME = #{matterName}
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO = #{meterTypeNo}
-      </if>
-      <if test="meterTypeName != null and meterTypeName != '' and meterTypeName !='驻外检测'.toString() and meterTypeName !='单包计量'.toString()">
-        and METER_TYPE_NAME = #{meterTypeName}
-      </if>
-      <if test="meterTypeName != null and meterTypeName != '' and meterTypeName =='驻外检测'.toString()">
-        and METER_TYPE_NAME like '${meterTypeName}%'
-      </if>
-      <if test="meterTypeName != null and meterTypeName != '' and meterTypeName =='单包计量'.toString()">
-        and METER_TYPE_NAME like  '${meterTypeName}%'
-      </if>
-      <if test="baseSpotNo != null and baseSpotNo != ''">
-        and BASE_SPOT_NO = #{baseSpotNo}
-      </if>
-      <if test="baseSpotName != null and baseSpotName != ''">
-        and BASE_SPOT_NAME = #{baseSpotName}
-      </if>
-      <if test="uploadFlag != null and uploadFlag != ''">
-        and UPLOAD_FLAG = #{uploadFlag}
-      </if>
-      <if test="contractNo != null and contractNo != ''">
-        and CONTRACT_NO LIKE '%${contractNo}%'
-      </if>
-      <if test="batchNo != null and batchNo != ''">
-        and BATCH_NO LIKE '%${batchNo}%'
-      </if>
-      <if test="customerSupplierNo != null and customerSupplierNo != ''">
-        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
-      </if>
-      <if test="customerSupplierName != null and customerSupplierName != ''">
-        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
-      </if>
-      <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-        and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-      </if>
-      <if test="forwardingUnitName != null and forwardingUnitName != ''">
-        and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-      </if>
-      <if test="receivingUintNo != null and receivingUintNo != ''">
-        and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-      </if>
-      <if test="receivingUintName != null and receivingUintName != ''">
-        and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-      </if>
-      <if test="materialNo != null and materialNo != ''">
-        and MATERIAL_NO LIKE '%${materialNo}%'
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME LIKE '%${materialName}%'
-      </if>
-      <if test="specNo != null and specNo != ''">
-        and SPEC_NO LIKE '%${specNo}%'
-      </if>
-      <if test="specName != null and specName != ''">
-        and SPEC_NAME LIKE '%${specName}%'
-      </if>
-      <if test="loadPointNo != null and loadPointNo != ''">
-        and LOAD_POINT_NO LIKE '%${loadPointNo}%'
-      </if>
-      <if test="loadPointName != null and loadPointName != ''">
-        and LOAD_POINT_NAME LIKE '%${loadPointName}%'
-      </if>
-      <if test="sampleNo != null and sampleNo != ''">
-        and SAMPLE_NO LIKE '%${sampleNo}%'
-      </if>
-      <if test="sampleVoucher != null and sampleVoucher != ''">
-        and SAMPLE_VOUCHER LIKE '%${sampleVoucher}%'
-      </if>
-      <if test="carrierUnitNo != null and carrierUnitNo != ''">
-        and CARRIER_UNIT_NO LIKE '%${carrierUnitNo}%'
-      </if>
-      <if test="carrierUnitName != null and carrierUnitName != ''">
-        and CARRIER_UNIT_NAME LIKE '%${carrierUnitName}%'
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO LIKE '%${meterTypeNo}%'
-      </if>
-      <if test="meterTypeName != null and meterTypeName != ''">
-        and METER_TYPE_NAME LIKE '%${meterTypeName}%'
-      </if>
-      <if test="meterProcessNo != null and meterProcessNo != ''">
-        and METER_PROCESS_NO LIKE '%${meterProcessNo}%'
-      </if>
-      <if test="meterProcessEditionNo != null and meterProcessEditionNo != ''">
-        and METER_PROCESS_EDITION_NO LIKE '%${meterProcessEditionNo}%'
-      </if>
-      <if test="actualFirst1No != null and actualFirst1No != ''">
-        and ACTUAL_FIRST1_NO LIKE '%${actualFirst1No}%'
-      </if>
-      <if test="grossWeight != null">
-        and GROSS_WEIGHT = #{grossWeight}
-      </if>
-      <if test="grossManNo != null and grossManNo != ''">
-        and GROSS_MAN_NO LIKE '%${grossManNo}%'
-      </if>
-      <if test="grossManName != null and grossManName != ''">
-        and GROSS_MAN_NAME LIKE '%${grossManName}%'
-      </if>
-      <if test="grossTime != null">
-        and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
-      </if>
-      <if test="baseSpot1No != null and baseSpot1No != ''">
-        and BASE_SPOT1_NO LIKE '%${baseSpot1No}%'
-      </if>
-      <if test="baseSpot1Name != null and baseSpot1Name != ''">
-        and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
-      </if>
-      <if test="grossClass != null and grossClass != ''">
-        and GROSS_CLASS LIKE '%${grossClass}%'
-      </if>
-      <if test="grossGroup != null and grossGroup != ''">
-        and GROSS_GROUP LIKE '%${grossGroup}%'
-      </if>
-      <if test="grossMode != null and grossMode != ''">
-        and GROSS_MODE LIKE '%${grossMode}%'
-      </if>
-      <if test="actualFirst2No != null and actualFirst2No != ''">
-        and ACTUAL_FIRST2_NO LIKE '%${actualFirst2No}%'
-      </if>
-      <if test="tareWeight != null">
-        and TARE_WEIGHT = #{tareWeight}
-      </if>
-      <if test="tareManNo != null and tareManNo != ''">
-        and TARE_MAN_NO LIKE '%${tareManNo}%'
-      </if>
-      <if test="tareManName != null and tareManName != ''">
-        and TARE_MAN_NAME LIKE '%${tareManName}%'
-      </if>
-      <if test="tareTime != null">
-        and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
-      </if>
-      <if test="baseSpot2No != null and baseSpot2No != ''">
-        and BASE_SPOT2_NO LIKE '%${baseSpot2No}%'
-      </if>
-      <if test="baseSpot2Name != null and baseSpot2Name != ''">
-        and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
-      </if>
-      <if test="tareClass != null and tareClass != ''">
-        and TARE_CLASS LIKE '%${tareClass}%'
-      </if>
-      <if test="tareGroup != null and tareGroup != ''">
-        and TARE_GROUP LIKE '%${tareGroup}%'
-      </if>
-      <if test="tareMode != null and tareMode != ''">
-        and TARE_MODE LIKE '%${tareMode}%'
-      </if>
-      <if test="netWeight != null">
-        and NET_WEIGHT = #{netWeight}
-      </if>
-      <if test="meterNum != null">
-        and METER_NUM = #{meterNum}
-      </if>
-      <if test="netManNo != null and netManNo != ''">
-        and NET_MAN_NO LIKE '%${netManNo}%'
-      </if>
-      <if test="netManName != null and netManName != ''">
-        and NET_MAN_NAME LIKE '%${netManName}%'
-      </if>
-      <if test="netSpot3No != null and netSpot3No != ''">
-        and NET_SPOT3_NO LIKE '%${netSpot3No}%'
-      </if>
-      <if test="netSpot3Name != null and netSpot3Name != ''">
-        and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
-      </if>
-      <if test="valueFlag != null and valueFlag != ''">
-        and value_flag = #{valueFlag}
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    order by NET_TIME desc
-  </select>
-
-  <select id="manualAdd" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select t1.prediction_no PREDICTION_NO, t1.notice_no NOTICE_NO, t1.car_no CAR_NO, t1.trailer_no TRAILER_NO, t1.matter_no MATTER_NO,
-       t1.matter_name MATTER_NAME, t1.contract_no CONTRACT_NO, t1.batch_no BATCH_NO, t1.customer_supplier_no CUSTOMER_SUPPLIER_NO,
-       t1.customer_supplier_name CUSTOMER_SUPPLIER_NAME, t1.forwarding_unit_no FORWARDING_UNIT_NO, t1.forwarding_unit_name FORWARDING_UNIT_NAME,
-       t1.receiving_uint_no RECEIVING_UINT_NO, t1.receiving_uint_name RECEIVING_UINT_NAME, t1.material_no MATERIAL_NO,
-       t1.voucher_identity, t1.voucher_item, t1.business_group, t1.temp_conveyance, t1.conveyance_type,
-       t1.resource_system, t1.group_package_amount, t1.group_package_unit, t1.package_amount,
-       t1.package_unit, t1.theory_amount, t1.measure_batch,t1.measure_batch_count,t1.sender_type,
-       t1.sender_remark,t1.receiver_type, t1.receiver_remark,t1.amount_unit,
-       t1.material_name MATERIAL_NAME, t1.spec_no SPEC_NO, t1.spec_name SPEC_NAME, t1.load_point_no LOAD_POINT_NO, t1.load_point_name LOAD_POINT_NAME,
-       t1.sample_no SAMPLE_NO,t1.sample_voucher SAMPLE_VOUCHER,t1.carrier_unit_no CARRIER_UNIT_NO,t1.carrier_unit_name CARRIER_UNIT_NAME,
-       t1.meter_type_no METER_TYPE_NO, t1.meter_type_name METER_TYPE_NAME,t1.meter_process_no METER_PROCESS_NO, t1.meter_process_edition_no METER_PROCESS_EDITION_NO,
-       t1.actual_first_no ACTUAL_FIRST1_NO, t1.meter_weight GROSS_WEIGHT, t1.create_man_no GROSS_MAN_NO, t1.create_man_name GROSS_MAN_NAME, t1.create_time GROSS_TIME,
-       t1.base_spot_no BASE_SPOT1_NO, t1.base_spot_name BASE_SPOT1_NAME,t1.meter_class GROSS_CLASS, t1.meter_group GROSS_GROUP, t1.meter_mode GROSS_MODE,t2.data_source,
-       t2.actual_first_no ACTUAL_FIRST2_NO, t2.meter_weight TARE_WEIGHT, t2.create_man_no TARE_MAN_NO, t2.create_man_name TARE_MAN_NAME, t2.create_time TARE_TIME,
-       t2.base_spot_no BASE_SPOT2_NO, t2.base_spot_name BASE_SPOT2_NAME, t2.create_man_no net_man_no, t2.create_man_name net_man_name, t2.create_time net_time,t2.base_spot_no net_spot3_no, t2.base_spot_name net_spot3_name, t2.create_time create_time,  t2.create_man_name create_man_name, t2.meter_class TARE_CLASS, t2.meter_group TARE_GROUP,t2.meter_mode TARE_MODE,t1.METER_NUM METER_NUM
-    from METER_WORK_CAR_ACTUAL_FIRST t1,METER_WORK_CAR_ACTUAL_FIRST t2
-    where t1.actual_first_no=#{actualFirstNo,jdbcType=VARCHAR} and t2.actual_first_no=#{dataNo,jdbcType=VARCHAR}
- </select>
-
-  <select id="manualAddPre" parameterType="java.lang.String" resultMap="BaseResultMap">
-        select T3.prediction_no PREDICTION_NO, T3.notice_no NOTICE_NO, t1.car_no CAR_NO, T3.trailer_no TRAILER_NO, T3.matter_no MATTER_NO,
-               T3.voucher_identity, T3.voucher_item, T3.business_group, T3.temp_conveyance, T3.conveyance_type,
-               T3.resource_system, T3.group_package_amount, T3.group_package_unit, T3.package_amount,
-               T3.package_unit, T3.theory_amount, T3.measure_batch,T3.measure_batch_count,T3.sender_type,
-               T3.sender_remark,T3.receiver_type, T3.receiver_remark,T3.amount_unit,t1.data_source,
-               T3.matter_name MATTER_NAME, T3.contract_no CONTRACT_NO, T3.batch_no BATCH_NO, T3.customer_supplier_no CUSTOMER_SUPPLIER_NO,
-               T3.customer_supplier_name CUSTOMER_SUPPLIER_NAME, T3.forwarding_unit_no FORWARDING_UNIT_NO, T3.forwarding_unit_name FORWARDING_UNIT_NAME,
-               T3.receiving_uint_no RECEIVING_UINT_NO, T3.receiving_uint_name RECEIVING_UINT_NAME, T3.material_no MATERIAL_NO,
-               T3.material_name MATERIAL_NAME, T3.spec_no SPEC_NO, T3.spec_name SPEC_NAME, T3.load_point_no LOAD_POINT_NO, T3.load_point_name LOAD_POINT_NAME,
-               t1.sample_no SAMPLE_NO,t1.sample_voucher SAMPLE_VOUCHER,T3.carrier_unit_no CARRIER_UNIT_NO,T3.carrier_unit_name CARRIER_UNIT_NAME,
-               T3.meter_type_no METER_TYPE_NO, T3.meter_type_name METER_TYPE_NAME,T3.meter_process_no METER_PROCESS_NO, T3.meter_process_edition_no METER_PROCESS_EDITION_NO,
-               t1.actual_first_no ACTUAL_FIRST1_NO, t1.meter_weight GROSS_WEIGHT, t1.create_man_no GROSS_MAN_NO, t1.create_man_name GROSS_MAN_NAME, t1.create_time GROSS_TIME,
-               t1.base_spot_no BASE_SPOT1_NO, t1.base_spot_name BASE_SPOT1_NAME,t1.meter_class GROSS_CLASS, t1.meter_group GROSS_GROUP, t1.meter_mode GROSS_MODE,
-               t2.actual_first_no ACTUAL_FIRST2_NO, t2.meter_weight TARE_WEIGHT, t2.create_man_no TARE_MAN_NO, t2.create_man_name TARE_MAN_NAME, t2.create_time TARE_TIME,
-               t2.base_spot_no BASE_SPOT2_NO, t2.base_spot_name BASE_SPOT2_NAME, t2.create_man_no net_man_no, t2.create_man_name net_man_name, t2.create_time net_time, t2.base_spot_no net_spot3_no, t2.base_spot_name net_spot3_name, t2.create_time create_time,  t2.create_man_name create_man_name, t2.meter_class TARE_CLASS, t2.meter_group TARE_GROUP,t2.meter_mode TARE_MODE,t1.METER_NUM METER_NUM
-        from METER_WORK_CAR_ACTUAL_FIRST t1,METER_WORK_CAR_ACTUAL_FIRST t2, PRE_TRACK_SCALE T3
-        where t1.actual_first_no=#{actualFirstNo,jdbcType=VARCHAR} and t2.actual_first_no=#{dataNo,jdbcType=VARCHAR} AND T3.prediction_no =#{predictionNo,jdbcType=VARCHAR}
-    </select>
-
-  <select id="mathPredcition" parameterType="java.lang.String" resultMap="BaseResultMap">
-        select t.actual_no, t1.prediction_no, t1.notice_no, t.car_no,
-               t1.trailer_no, t1.matter_no, t1.matter_name, t1.contract_no,
-               t1.batch_no, t1.customer_supplier_no, t1.customer_supplier_name,
-               t1.forwarding_unit_no, t1.forwarding_unit_name, t1.receiving_uint_no,
-               t1.receiving_uint_name, t1.material_no, t1.material_name,
-               t1.voucher_identity, t1.voucher_item, t1.business_group, t1.temp_conveyance, t1.conveyance_type,
-               t1.resource_system, t1.group_package_amount, t1.group_package_unit, t1.package_amount,
-               t1.package_unit, t1.theory_amount, t1.measure_batch,t1.measure_batch_count,t1.sender_type,
-               t1.sender_remark,t1.receiver_type, t1.receiver_remark,t1.amount_unit,
-               t1.spec_no, t1.spec_name, t1.load_point_no, t1.load_point_name,
-               t1.sample_no, t1.sample_voucher, t1.carrier_unit_no, t1.carrier_unit_name,
-               t1.meter_type_no, t1.meter_type_name, t1.meter_process_no, t1.meter_process_edition_no,
-               t.actual_first1_no, t.gross_weight, t.gross_man_no, t.gross_man_name, t.gross_time,
-               t.base_spot1_no, t.base_spot1_name, t.gross_class, t.gross_group, t.gross_mode,
-               t.actual_first2_no,  t.tare_weight, t.tare_man_no, t.tare_man_name, t.tare_time,
-               t.base_spot2_no, t.base_spot2_name, t.tare_class, t.tare_group, t.tare_mode,t.data_source,
-               t.net_weight, t.meter_num, t.net_man_no, t.net_man_name, t.net_time, t.net_spot3_no,
-               t.net_spot3_name, t.net_group, t.net_mode, t.value_flag, t.upload_flag, t.check_man_no,
-               t.check_man_name, t.check_time, t.upload_man_no, t.upload_man_name, t.upload_time, t.add_weight,
-               t.net_class, t.tb_flage, t1.railway_no, t.update_man_no, t.update_man_name, t.update_time,
-               t.create_man_name, t.create_time,
-               t.memo, t1.heat_no, t1.shipment_gross_weight, t1.shipment_net_weight, t1.shipment_num,
-               t1.bind_card_no, t1.prediction_type, t1.prediction_combination, t.meter_pier_name,
-               t.meter_pier_no, t.note
-        from meter_work_car_actual t, pre_track_scale t1 where t.actual_no = #{actualNo,jdbcType=VARCHAR} and t1.prediction_no = #{predictionNo,jdbcType=VARCHAR}
-    </select>
-
-  <select id="cleanPredcition" parameterType="java.lang.String" resultMap="BaseResultMap">
-        select t.actual_no, t.actual_first1_no,t.car_no, t.gross_weight, t.gross_man_no, t.gross_man_name, t.gross_time,
-               t.base_spot1_no, t.base_spot1_name, t.gross_class, t.gross_group, t.gross_mode,
-               t.actual_first2_no,  t.tare_weight, t.tare_man_no, t.tare_man_name, t.tare_time,
-               t.base_spot2_no, t.base_spot2_name, t.tare_class, t.tare_group, t.tare_mode,t.data_source,
-               t.net_weight, t.meter_num, t.net_man_no, t.net_man_name, t.net_time, t.net_spot3_no,
-               t.net_spot3_name, t.net_group, t.net_mode, t.value_flag, t.upload_flag, t.check_man_no,
-               t.check_man_name, t.check_time, t.upload_man_no, t.upload_man_name, t.upload_time, t.add_weight,
-               t.net_class, t.tb_flage, t.update_man_no, t.update_man_name, t.update_time,
-               t.memo, t.meter_pier_name, t.meter_pier_no, t.note
-        from meter_work_car_actual t where t.actual_no = #{actualNo,jdbcType=VARCHAR}
-    </select>
-
-  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
-    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(ACTUAL_NO,9))),0) + 1,4,'0') ACTUAL_NO
-    FROM METER_WORK_CAR_ACTUAL where instr(ACTUAL_NO,#{afl,jdbcType=VARCHAR})>0
-  </select>
-
-  <select id="tareAdd" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select t1.PREDICTION_NO PREDICTION_NO, t1.notice_no NOTICE_NO, t1.car_no CAR_NO, t1.trailer_no TRAILER_NO, t1.matter_no MATTER_NO,
-       t1.matter_name MATTER_NAME, t1.contract_no CONTRACT_NO, t1.batch_no BATCH_NO, t1.customer_supplier_no CUSTOMER_SUPPLIER_NO,
-       t1.customer_supplier_name CUSTOMER_SUPPLIER_NAME, t1.forwarding_unit_no FORWARDING_UNIT_NO, t1.forwarding_unit_name FORWARDING_UNIT_NAME,
-       t1.receiving_uint_no RECEIVING_UINT_NO, t1.receiving_uint_name RECEIVING_UINT_NAME, t1.material_no MATERIAL_NO,
-       t1.voucher_identity, t1.voucher_item, t1.business_group, t1.temp_conveyance, t1.conveyance_type,
-       t1.resource_system, t1.group_package_amount, t1.group_package_unit, t1.package_amount,
-       t1.package_unit, t1.theory_amount, t1.measure_batch,t1.measure_batch_count,t1.sender_type,
-       t1.sender_remark,t1.receiver_type, t1.receiver_remark,t1.amount_unit,t1.data_source,
-       t1.material_name MATERIAL_NAME, t1.spec_no SPEC_NO, t1.spec_name SPEC_NAME, t1.load_point_no LOAD_POINT_NO, t1.load_point_name LOAD_POINT_NAME,
-       t1.sample_no SAMPLE_NO,t1.sample_voucher SAMPLE_VOUCHER,t1.carrier_unit_no CARRIER_UNIT_NO,t1.carrier_unit_name CARRIER_UNIT_NAME,
-       t1.meter_type_no METER_TYPE_NO, t1.meter_type_name METER_TYPE_NAME,t1.meter_process_no METER_PROCESS_NO, t1.meter_process_edition_no METER_PROCESS_EDITION_NO,
-       t1.actual_first_no ACTUAL_FIRST1_NO, t1.meter_weight GROSS_WEIGHT, t1.create_man_no GROSS_MAN_NO, t1.create_man_name GROSS_MAN_NAME, t1.create_time GROSS_TIME,
-       t1.base_spot_no BASE_SPOT1_NO, t1.base_spot_name BASE_SPOT1_NAME,t1.meter_class GROSS_CLASS, t1.meter_group GROSS_GROUP, t1.meter_mode GROSS_MODE,
-       t2.data_no ACTUAL_FIRST2_NO, t2.meter_weight TARE_WEIGHT, t2.create_man_no TARE_MAN_NO, t2.create_man_name TARE_MAN_NAME, t2.create_time TARE_TIME,
-       t2.base_spot_no BASE_SPOT2_NO, t2.base_spot_name BASE_SPOT2_NAME,t1.meter_num  METER_NUM
-    from METER_WORK_CAR_ACTUAL_FIRST t1,METER_BASE_TERM_TARE_DATA t2
-    where t1.actual_first_no=#{actualFirstNo,jdbcType=VARCHAR} and t2.DATA_NO=#{dataNo,jdbcType=VARCHAR}
- </select>
-
-  <select id="selectByTime" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT
-    <include refid="columns"/>
-    from METER_WORK_CAR_ACTUAL_VIEW
-    <where>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO = #{matterNo}
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME = #{matterName}
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO = #{meterTypeNo}
-      </if>
-      <if test="meterTypeName != null and meterTypeName != ''">
-        and METER_TYPE_NAME = #{meterTypeName}
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-  </select>
-
-  <select id="selectParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT t.ACTUAL_NO, t.PREDICTION_NO, t.NOTICE_NO, t.CAR_NO, t.TRAILER_NO, t.MATTER_NO,
-    m.matter_name_old MATTER_NAME,
-    t.CONTRACT_NO, t.BATCH_NO, t.CUSTOMER_SUPPLIER_NO, t.CUSTOMER_SUPPLIER_NAME, t.FORWARDING_UNIT_NO,
-    t.FORWARDING_UNIT_NAME,
-    t.RECEIVING_UINT_NO, t.RECEIVING_UINT_NAME, t.MATERIAL_NO, t.MATERIAL_NAME, t.SPEC_NO, t.SPEC_NAME,
-    t.LOAD_POINT_NO, t.LOAD_POINT_NAME, t.SAMPLE_NO, t.SAMPLE_VOUCHER, t.CARRIER_UNIT_NO, t.CARRIER_UNIT_NAME,
-    t.METER_TYPE_NO, t.METER_TYPE_NAME, t.METER_PROCESS_NO, t.METER_PROCESS_EDITION_NO, t.ACTUAL_FIRST1_NO,
-    nvl(t.GROSS_WEIGHT,0) GROSS_WEIGHT, t.GROSS_MAN_NO, t.GROSS_MAN_NAME, t.GROSS_TIME, t.BASE_SPOT1_NO,
-    t.BASE_SPOT1_NAME, t.GROSS_CLASS,
-    t.GROSS_GROUP, t.GROSS_MODE, t.ACTUAL_FIRST2_NO, nvl(t.TARE_WEIGHT,0) TARE_WEIGHT, t.TARE_MAN_NO,
-    t.TARE_MAN_NAME, t.TARE_TIME,
-    t.BASE_SPOT2_NO, t.BASE_SPOT2_NAME, t.TARE_CLASS, t.TARE_GROUP, t.TARE_MODE, nvl(t.NET_WEIGHT,0) NET_WEIGHT,
-    t.METER_NUM,
-    t.NET_MAN_NO, t.NET_MAN_NAME, t.NET_TIME, t.NET_SPOT3_NO, t.NET_SPOT3_NAME, t.NET_GROUP, t.NET_MODE,
-    t.VALUE_FLAG,
-    t.UPLOAD_FLAG, t.CHECK_MAN_NO, t.CHECK_MAN_NAME, t.CHECK_TIME, t.UPLOAD_MAN_NO, t.UPLOAD_MAN_NAME,
-    t.UPLOAD_TIME,
-    nvl(t.ADD_WEIGHT,0) ADD_WEIGHT, t.NET_CLASS
-    from METER_WORK_CAR_ACTUAL t,METER_BASE_MATTER_INFO_MATCH m
-    where t.matter_name=m.matter_name(+)
-    <if test="matterNo != null and matterNo != ''">
-      and t.MATTER_NO = #{matterNo}
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and t.MATTER_NAME = #{matterName}
-    </if>
-    <if test="meterTypeNo != null and meterTypeNo != ''">
-      and t.METER_TYPE_NO = #{meterTypeNo}
-    </if>
-    <if test="meterTypeName != null and meterTypeName != ''">
-      and t.METER_TYPE_NAME = #{meterTypeName}
-    </if>
-    <if test="meterTypeName != null and meterTypeName != ''">
-      and t.METER_TYPE_NAME = #{meterTypeName}
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and t.value_flag = #{valueFlag}
-    </if>
-    <if test="baseSpot1No != null and baseSpot1No != ''">
-      and t.base_spot1_no = #{baseSpot1No}
-    </if>
-    <if test="baseSpot2No != null and baseSpot2No != ''">
-      and t.base_spot2_no = #{baseSpot2No}
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and t.NET_TIME between to_date(#{startTime},'yyyy-MM-dd HH24:mi:ss') and to_date(#{endTime}, 'yyyy-MM-dd
-      HH24:mi:ss')
-    </if>
-    order by t.net_time
-  </select>
-
-  <select id="selectCarNoCount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
-    SELECT count(1) from METER_WORK_CAR_ACTUAL t
-    where value_flag='0'
-    <if test="carNo != null and carNo != ''">
-      and t.CAR_NO = #{carNo}
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and t.MATTER_NO = #{matterNo}
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and t.MATTER_NAME = #{matterName}
-    </if>
-    <if test="meterTypeNo != null and meterTypeNo != ''">
-      and t.METER_TYPE_NO = #{meterTypeNo}
-    </if>
-    <if test="meterTypeName != null and meterTypeName != ''">
-      and t.METER_TYPE_NAME = #{meterTypeName}
-    </if>
-    <if test="meterTypeName != null and meterTypeName != ''">
-      and t.METER_TYPE_NAME = #{meterTypeName}
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and t.value_flag = #{valueFlag}
-    </if>
-    <if test="baseSpot1No != null and baseSpot1No != ''">
-      and t.base_spot1_no = #{baseSpot1No}
-    </if>
-    <if test="baseSpot2No != null and baseSpot2No != ''">
-      and t.base_spot2_no = #{baseSpot2No}
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-  </select>
-
-  <!--  查询计量票据录入产生的数据  -->
-  <select id="selectManualData" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      (DATA_SOURCE = 4)
-      <if test="predictionNo != null and predictionNo != ''">
-        and PREDICTION_NO = #{predictionNo}
-      </if>
-      <if test="carNo != null and carNo != ''">
-        and CAR_NO = #{carNo}
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO = #{matterNo}
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME = #{matterName}
-      </if>
-      <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-        and FORWARDING_UNIT_NO = #{forwardingUnitNo}
-      </if>
-      <if test="forwardingUnitName != null and forwardingUnitName != ''">
-        and FORWARDING_UNIT_NAME = #{forwardingUnitName}
-      </if>
-      <if test="receivingUintNo != null and receivingUintNo != ''">
-        and RECEIVING_UINT_NO = #{receivingUintNo}
-      </if>
-      <if test="receivingUintName != null and receivingUintName != ''">
-        and RECEIVING_UINT_NAME = #{receivingUintName}
-      </if>
-      <if test="grossTime != null">
-        and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
-      </if>
-      <if test="baseSpot1No != null and baseSpot1No != ''">
-        and BASE_SPOT1_NO = #{baseSpot1No}
-      </if>
-      <if test="baseSpot1Name != null and baseSpot1Name != ''">
-        and BASE_SPOT1_NAME = #{baseSpot1Name}
-      </if>
-      <if test="tareTime != null">
-        and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
-      </if>
-      <if test="baseSpot2No != null and baseSpot2No != ''">
-        and BASE_SPOT2_NO = #{baseSpot2No}
-      </if>
-      <if test="baseSpot2Name != null and baseSpot2Name != ''">
-        and BASE_SPOT2_NAME = #{baseSpot2Name}
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where> order by net_time asc
-  </select>
-
-  <!--查询需要转换到老系统的数据-->
-  <select id="selectDataConversionOfCar" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where net_time > sysdate -0.3 and tb_flage = 0 order by net_time asc
-  </select>
-
-  <!--查询车号今天是第几次出现-->
-  <select id="selectRepeatCarNO" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where CAR_NO = #{carNo} and instr(ACTUAL_NO,#{startTime})>0 order by NET_TIME asc
-  </select>
-
-  <!-- 查询:根据传入时间和车号,查询给定时间段去重车号 -->
-  <select id="distinctCarNo" parameterType="java.lang.String" resultMap="BaseResultMap">
-    SELECT distinct car_No, net_time
-    from METER_WORK_CAR_ACTUAL
-    where VALUE_FLAG != '0'
-    <if test="baseSpotNames != null and baseSpotNames.size() != 0">
-      and NET_SPOT3_NAME in
-      <foreach collection="baseSpotNames" item="id" open="(" close=")" separator=",">
-        #{id}
-      </foreach>
-    </if>
-    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-      and  NET_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and NET_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="predictionNo != null and predictionNo != ''">
-      and PREDICTION_NO LIKE '%${predictionNo}%'
-    </if>
-    <if test="dataSource != null and dataSource != null">
-      and  data_source = '${dataSource}'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  value_flag = #{valueFlag}
-    </if>
-    <if test="carNo != null and carNo != null">
-      and  CAR_NO like '%${carNo}%'
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and MATTER_NO LIKE '%${matterNo}%'
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and MATTER_NAME LIKE '%${matterName}%'
-    </if>
-    <if test="netSpot3No != null and netSpot3No != ''">
-      and NET_SPOT3_NO LIKE '%${netSpot3No}%'
-    </if>
-    <if test="netSpot3Name != null and netSpot3Name != ''">
-      and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
-    </if>
-    <if test="isPreScale != null and isPreScale != ''">
-      and  is_pre_scale = #{isPreScale}
-    </if>
-
-    order by net_time desc
-  </select>
-
-
-  <select id="selectActual" parameterType="java.lang.String" resultMap="BaseResultMap">
-      SELECT *
-      from METER_WORK_CAR_ACTUAL
-      where ACTUAL_FIRST1_NO = #{actualFirstNo} or ACTUAL_FIRST2_NO = #{actualFirstNo}
-    </select>
-
-  <select id="getCarActual" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select * from METER_WORK_CAR_ACTUAL WHERE CAR_NO IN (select CAR_NO from METER_BASE_CAR where CUSTOMER_SUPPLIER_NO = #{customerSupplierNo} and CUSTOMER_SUPPLIER_NAME = #{customerSupplierName})
-  </select>
-
-  <select id="likeByDesc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      1=1
-      <if test="baseSpotNames != null and baseSpotNames.size() != 0">
-        and NET_SPOT3_NAME in
-        <foreach collection="baseSpotNames" item="id" open="(" close=")" separator=",">
-          #{id}
-        </foreach>
-      </if>
-      <if test="actualNo != null and actualNo != ''">
-        and ACTUAL_NO LIKE '%${actualNo}%'
-      </if>
-      <if test="predictionNo != null and predictionNo != ''">
-        and PREDICTION_NO LIKE '%${predictionNo}%'
-      </if>
-      <if test="noticeNo != null and noticeNo != ''">
-        and NOTICE_NO LIKE '%${noticeNo}%'
-      </if>
-      <if test="carNo != null and carNo != ''">
-        and CAR_NO LIKE '%${carNo}%'
-      </if>
-      <if test="trailerNo != null and trailerNo != ''">
-        and TRAILER_NO LIKE '%${trailerNo}%'
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO LIKE '%${matterNo}%'
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME LIKE '%${matterName}%'
-      </if>
-      <if test="contractNo != null and contractNo != ''">
-        and CONTRACT_NO LIKE '%${contractNo}%'
-      </if>
-      <if test="batchNo != null and batchNo != ''">
-        and BATCH_NO LIKE '%${batchNo}%'
-      </if>
-      <if test="customerSupplierNo != null and customerSupplierNo != ''">
-        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
-      </if>
-      <if test="customerSupplierName != null and customerSupplierName != ''">
-        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
-      </if>
-      <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-        and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-      </if>
-      <if test="forwardingUnitName != null and forwardingUnitName != ''">
-        and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-      </if>
-      <if test="receivingUintNo != null and receivingUintNo != ''">
-        and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-      </if>
-      <if test="receivingUintName != null and receivingUintName != ''">
-        and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-      </if>
-      <if test="materialNo != null and materialNo != ''">
-        and MATERIAL_NO LIKE '%${materialNo}%'
-      </if>
-      <if test="materialName != null and materialName != ''">
-        and MATERIAL_NAME LIKE '%${materialName}%'
-      </if>
-      <if test="specNo != null and specNo != ''">
-        and SPEC_NO LIKE '%${specNo}%'
-      </if>
-      <if test="specName != null and specName != ''">
-        and SPEC_NAME LIKE '%${specName}%'
-      </if>
-      <if test="loadPointNo != null and loadPointNo != ''">
-        and LOAD_POINT_NO LIKE '%${loadPointNo}%'
-      </if>
-      <if test="loadPointName != null and loadPointName != ''">
-        and LOAD_POINT_NAME LIKE '%${loadPointName}%'
-      </if>
-      <if test="sampleNo != null and sampleNo != ''">
-        and SAMPLE_NO LIKE '%${sampleNo}%'
-      </if>
-      <if test="sampleVoucher != null and sampleVoucher != ''">
-        and SAMPLE_VOUCHER LIKE '%${sampleVoucher}%'
-      </if>
-      <if test="carrierUnitNo != null and carrierUnitNo != ''">
-        and CARRIER_UNIT_NO LIKE '%${carrierUnitNo}%'
-      </if>
-      <if test="carrierUnitName != null and carrierUnitName != ''">
-        and CARRIER_UNIT_NAME LIKE '%${carrierUnitName}%'
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO LIKE '%${meterTypeNo}%'
-      </if>
-      <if test="meterTypeName != null and meterTypeName != ''">
-        and METER_TYPE_NAME LIKE '%${meterTypeName}%'
-      </if>
-      <if test="meterProcessNo != null and meterProcessNo != ''">
-        and METER_PROCESS_NO LIKE '%${meterProcessNo}%'
-      </if>
-      <if test="meterProcessEditionNo != null and meterProcessEditionNo != ''">
-        and METER_PROCESS_EDITION_NO LIKE '%${meterProcessEditionNo}%'
-      </if>
-      <if test="actualFirst1No != null and actualFirst1No != ''">
-        and ACTUAL_FIRST1_NO LIKE '%${actualFirst1No}%'
-      </if>
-      <if test="grossWeight != null">
-        and GROSS_WEIGHT = #{grossWeight}
-      </if>
-      <if test="grossManNo != null and grossManNo != ''">
-        and GROSS_MAN_NO LIKE '%${grossManNo}%'
-      </if>
-      <if test="grossManName != null and grossManName != ''">
-        and GROSS_MAN_NAME LIKE '%${grossManName}%'
-      </if>
-      <if test="grossTime != null">
-        and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
-      </if>
-      <if test="baseSpot1No != null and baseSpot1No != ''">
-        and BASE_SPOT1_NO LIKE '%${baseSpot1No}%'
-      </if>
-      <if test="baseSpot1Name != null and baseSpot1Name != ''">
-        and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
-      </if>
-      <if test="grossClass != null and grossClass != ''">
-        and GROSS_CLASS LIKE '%${grossClass}%'
-      </if>
-      <if test="grossGroup != null and grossGroup != ''">
-        and GROSS_GROUP LIKE '%${grossGroup}%'
-      </if>
-      <if test="grossMode != null and grossMode != ''">
-        and GROSS_MODE LIKE '%${grossMode}%'
-      </if>
-      <if test="actualFirst2No != null and actualFirst2No != ''">
-        and ACTUAL_FIRST2_NO LIKE '%${actualFirst2No}%'
-      </if>
-      <if test="tareWeight != null">
-        and TARE_WEIGHT = #{tareWeight}
-      </if>
-      <if test="tareManNo != null and tareManNo != ''">
-        and TARE_MAN_NO LIKE '%${tareManNo}%'
-      </if>
-      <if test="tareManName != null and tareManName != ''">
-        and TARE_MAN_NAME LIKE '%${tareManName}%'
-      </if>
-      <if test="tareTime != null">
-        and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
-      </if>
-      <if test="baseSpot2No != null and baseSpot2No != ''">
-        and BASE_SPOT2_NO LIKE '%${baseSpot2No}%'
-      </if>
-      <if test="baseSpot2Name != null and baseSpot2Name != ''">
-        and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
-      </if>
-      <if test="tareClass != null and tareClass != ''">
-        and TARE_CLASS LIKE '%${tareClass}%'
-      </if>
-      <if test="tareGroup != null and tareGroup != ''">
-        and TARE_GROUP LIKE '%${tareGroup}%'
-      </if>
-      <if test="tareMode != null and tareMode != ''">
-        and TARE_MODE LIKE '%${tareMode}%'
-      </if>
-      <if test="netWeight != null">
-        and NET_WEIGHT = #{netWeight}
-      </if>
-      <if test="meterNum != null">
-        and METER_NUM = #{meterNum}
-      </if>
-      <if test="netManNo != null and netManNo != ''">
-        and NET_MAN_NO LIKE '%${netManNo}%'
-      </if>
-      <if test="netManName != null and netManName != ''">
-        and NET_MAN_NAME LIKE '%${netManName}%'
-      </if>
-      <if test="netTime != null">
-        and TO_CHAR(NET_TIME,'yyyy-MM-dd') = #{netTime}
-      </if>
-      <if test="netSpot3No != null and netSpot3No != ''">
-        and NET_SPOT3_NO LIKE '%${netSpot3No}%'
-      </if>
-      <if test="netSpot3Name != null and netSpot3Name != ''">
-        and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
-      </if>
-      <if test="netGroup != null and netGroup != ''">
-        and NET_GROUP LIKE '%${netGroup}%'
-      </if>
-      <if test="netMode != null and netMode != ''">
-        and NET_MODE LIKE '%${netMode}%'
-      </if>
-      <if test="valueFlag != null and valueFlag != ''">
-        and VALUE_FLAG = #{valueFlag}
-      </if>
-      <if test="uploadFlag != null and uploadFlag != ''">
-        and UPLOAD_FLAG LIKE '%${uploadFlag}%'
-      </if>
-      <if test="checkManNo != null and checkManNo != ''">
-        and CHECK_MAN_NO LIKE '%${checkManNo}%'
-      </if>
-      <if test="checkManName != null and checkManName != ''">
-        and CHECK_MAN_NAME LIKE '%${checkManName}%'
-      </if>
-      <if test="checkTime != null">
-        and TO_CHAR(CHECK_TIME,'yyyy-MM-dd') = #{checkTime}
-      </if>
-      <if test="uploadManNo != null and uploadManNo != ''">
-        and UPLOAD_MAN_NO LIKE '%${uploadManNo}%'
-      </if>
-      <if test="uploadManName != null and uploadManName != ''">
-        and UPLOAD_MAN_NAME LIKE '%${uploadManName}%'
-      </if>
-      <if test="uploadTime != null">
-        and TO_CHAR(UPLOAD_TIME,'yyyy-MM-dd') = #{uploadTime}
-      </if>
-      <if test="addWeight != null">
-        and ADD_WEIGHT = #{addWeight}
-      </if>
-      <if test="netClass != null and netClass != ''">
-        and NET_CLASS LIKE '%${netClass}%'
-      </if>
-      <if test="tbFlage != null and tbFlage != ''">
-        and TB_FLAGE LIKE '%${tbFlage}%'
-      </if>
-      <if test="railwayNo != null and railwayNo != ''">
-        and RAILWAY_NO LIKE '%${railwayNo}%'
-      </if>
-      <if test="updateManNo != null and updateManNo != ''">
-        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
-      </if>
-      <if test="updateManName != null and updateManName != ''">
-        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
-      </if>
-      <if test="updateTime != null">
-        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
-      </if>
-      <if test="memo != null and memo != ''">
-        and MEMO LIKE '%${memo}%'
-      </if>
-      <if test="heatNo != null and heatNo != ''">
-        and HEAT_NO LIKE '%${heatNo}%'
-      </if>
-      <if test="shipmentGrossWeight != null">
-        and SHIPMENT_GROSS_WEIGHT = #{shipmentGrossWeight}
-      </if>
-      <if test="shipmentNetWeight != null">
-        and SHIPMENT_NET_WEIGHT = #{shipmentNetWeight}
-      </if>
-      <if test="shipmentNum != null">
-        and SHIPMENT_NUM = #{shipmentNum}
-      </if>
-      <if test="bindCardNo != null and bindCardNo != ''">
-        and BIND_CARD_NO LIKE '%${bindCardNo}%'
-      </if>
-      <if test="predictionType != null and predictionType != ''">
-        and PREDICTION_TYPE LIKE '%${predictionType}%'
-      </if>
-      <if test="predictionCombination != null and predictionCombination != ''">
-        and PREDICTION_COMBINATION LIKE '%${predictionCombination}%'
-      </if>
-      <if test="meterPierName != null and meterPierName != ''">
-        and METER_PIER_NAME LIKE '%${meterPierName}%'
-      </if>
-      <if test="meterPierNo != null and meterPierNo != ''">
-        and METER_PIER_NO LIKE '%${meterPierNo}%'
-      </if>
-      <if test="shipNo != null and shipNo != ''">
-        and SHIP_NO LIKE '%${shipNo}%'
-      </if>
-      <if test="note != null and note != ''">
-        and NOTE LIKE '%${note}%'
-      </if>
-      <if test="voucherIdentity != null and voucherIdentity != ''">
-        and VOUCHER_IDENTITY LIKE '%${voucherIdentity}%'
-      </if>
-      <if test="voucherItem != null and voucherItem != ''">
-        and VOUCHER_ITEM LIKE '%${voucherItem}%'
-      </if>
-      <if test="businessGroup != null and businessGroup != ''">
-        and BUSINESS_GROUP LIKE '%${businessGroup}%'
-      </if>
-      <if test="tempConveyance != null and tempConveyance != ''">
-        and TEMP_CONVEYANCE LIKE '%${tempConveyance}%'
-      </if>
-      <if test="conveyanceType != null and conveyanceType != ''">
-        and CONVEYANCE_TYPE LIKE '%${conveyanceType}%'
-      </if>
-      <if test="resourceSystem != null and resourceSystem != ''">
-        and RESOURCE_SYSTEM LIKE '%${resourceSystem}%'
-      </if>
-      <if test="groupPackageAmount != null">
-        and GROUP_PACKAGE_AMOUNT = #{groupPackageAmount}
-      </if>
-      <if test="groupPackageUnit != null and groupPackageUnit != ''">
-        and GROUP_PACKAGE_UNIT LIKE '%${groupPackageUnit}%'
-      </if>
-      <if test="packageAmount != null">
-        and PACKAGE_AMOUNT = #{packageAmount}
-      </if>
-      <if test="packageUnit != null and packageUnit != ''">
-        and PACKAGE_UNIT LIKE '%${packageUnit}%'
-      </if>
-      <if test="theoryAmount != null">
-        and THEORY_AMOUNT = #{theoryAmount}
-      </if>
-      <if test="measureBatch != null and measureBatch != ''">
-        and MEASURE_BATCH LIKE '%${measureBatch}%'
-      </if>
-      <if test="measureBatchCount != null">
-        and MEASURE_BATCH_COUNT = #{measureBatchCount}
-      </if>
-      <if test="senderType != null and senderType != ''">
-        and SENDER_TYPE LIKE '%${senderType}%'
-      </if>
-      <if test="senderRemark != null and senderRemark != ''">
-        and SENDER_REMARK LIKE '%${senderRemark}%'
-      </if>
-      <if test="receiverType != null and receiverType != ''">
-        and RECEIVER_TYPE LIKE '%${receiverType}%'
-      </if>
-      <if test="receiverRemark != null and receiverRemark != ''">
-        and RECEIVER_REMARK LIKE '%${receiverRemark}%'
-      </if>
-      <if test="amountUnit != null and amountUnit != ''">
-        and AMOUNT_UNIT LIKE '%${amountUnit}%'
-      </if>
-      <if test="measureObjectType != null and measureObjectType != ''">
-        and MEASURE_OBJECT_TYPE LIKE '%${measureObjectType}%'
-      </if>
-      <if test="measureTaskNum != null and measureTaskNum != ''">
-        and MEASURE_TASK_NUM LIKE '%${measureTaskNum}%'
-      </if>
-      <if test="billType != null and billType != ''">
-        and BILL_TYPE LIKE '%${billType}%'
-      </if>
-      <if test="createManName != null and createManName != ''">
-        and CREATE_MAN_NAME LIKE '%${createManName}%'
-      </if>
-      <if test="dataSource != null and dataSource != ''">
-        and DATA_SOURCE LIKE '%${dataSource}%'
-      </if>
-      <if test="isPreScale != null and isPreScale != ''">
-        and IS_PRE_SCALE = #{isPreScale}
-      </if>
-    </where>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="netSpot3NoStr != null and netSpot3NoStr != ''">
-      and net_spot3_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="flag != null and flag != ''">
-      and value_flag != '0'
-    </if>
-    <if test="groupId != null and groupId != ''">
-      and NET_SPOT3_NO in (SELECT METER_BASE_GROUP_SPOT.SPOT_ID FROM METER_BASE_GROUP_SPOT WHERE METER_BASE_GROUP_SPOT.GROUP_ID = #{groupId})
-    </if>
-
-    order by net_time desc
-  </select>
-
-  <select id="selectByMap" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-    and value_flag != '0'
-    order by ACTUAL_NO desc
-  </select>
-
-  <select id="selectOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
-    SELECT *
-    FROM (
-    select ACTUAL_NO,
-    prediction_no,
-    CAR_NO,
-    GROSS_WEIGHT,
-    BASE_SPOT1_NAME,
-    GROSS_TIME,
-    TARE_WEIGHT,
-    BASE_SPOT2_NAME,
-    TARE_TIME,
-    NET_WEIGHT,
-    net_spot3_no,
-    NET_SPOT3_NAME,
-    NET_TIME,
-    forwarding_unit_no,
-    FORWARDING_UNIT_NAME,
-    receiving_uint_no,
-    RECEIVING_UINT_NAME,
-    matter_no,
-    MATTER_NAME,
-    sender_remark,
-    '新系统' as REMARK
-    from METER_WORK_CAR_ACTUAL
-    where IS_PRE_SCALE='1'
-    and VALUE_FLAG in ('1', '2')
-    and UPLOAD_FLAG='2'
-    and NET_TIME > to_date('2022-07-21','YYYY-MM-DD')
-    union
-    (
-    select FS_WEIGHTNO as ACTUAL_NO,
-    fs_noticeId as prediction_no,
-    REPLACE(FS_CARNO,'-','') as CAR_NO,
-    FS_GROSSWEIGHT * 1000 as GROSS_WEIGHT,
-    FS_GROSSPOINTNAME as BASE_SPOT1_NAME,
-    FS_GROSSWEIGHTTIME as GROSS_TIME,
-    FS_TAREWEIGHT * 1000 as TARE_WEIGHT,
-    FS_TAREPOINTNAME as BASE_SPOT2_NAME,
-    FS_TAREWEIGHTTIME as TARE_TIME,
-    FS_NETWEIGHT * 1000 as NET_WEIGHT,
-    fs_netPointId as net_spot3_no,
-    FS_NETPOINTNAME as NET_SPOT3_NAME,
-    FS_NETWEIGHTTIME as NET_TIME,
-    fs_sender as FORWARDING_UNIT_No,
-    FS_SENDERNAME as FORWARDING_UNIT_NAME,
-    fs_receiver as RECEIVING_UINT_No,
-    FS_RECEIVERNAME as RECEIVING_UINT_NAME,
-    fs_material as matter_no,
-    FS_MATERIALNAME as MATTER_NAME,
-    fs_senderRemark sender_remark,
-    '老系统' as REMARK
-    from jgweight.view_car_net @MCMS
-    where FS_NETWEIGHTTIME > to_date('2022-07-21','YYYY-MM-DD') AND FS_DELETEDTAG='N'
-    and fs_noticeId is not null )
-    )
-    where 1 = 1
-    <if test="remark != null and remark != ''">
-      and remark LIKE '%${remark}%'
-    </if>
-    <if test="predictionNo != null and predictionNo != ''">
-      and prediction_no LIKE '%${predictionNo}%'
-    </if>
-    <if test="senderRemark != null and senderRemark != ''">
-      and sender_remark LIKE '%${senderRemark}%'
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and car_no like '%${carNo}%'
-    </if>
-    <if test="netSpot3No != null and netSpot3No != ''">
-      and net_spot3_no like '%${netSpot3No}%'
-    </if>
-    <if test="netSpot3Name != null and netSpot3Name != ''">
-      and net_spot3_name like '%${netSpot3Name}%'
-    </if>
-    <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-      and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-    </if>
-    <if test="forwardingUnitName != null and forwardingUnitName != ''">
-      and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-    </if>
-    <if test="receivingUintNo != null and receivingUintNo != ''">
-      and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-    </if>
-    <if test="receivingUintName != null and receivingUintName != ''">
-      and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and matter_no LIKE '%${matterNo}%'
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and matter_name LIKE '%${matterName}%'
-    </if>
-  </select>
-
-  <select id="doQueryFirstOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
-    select *
-    from (
-    select actual_first_no,
-    prediction_no,
-    car_no,
-    meter_weight,
-    create_time,
-    base_spot_no,
-    base_spot_name,
-    forwarding_unit_no,
-    forwarding_unit_name,
-    receiving_uint_no,
-    receiving_uint_name,
-    matter_no,
-    matter_name,
-    sender_remark,
-    '新系统' remark
-    from meter_work_car_actual_first
-    where is_pre_scale = '1'
-    and value_flag in  ('1', '2')
-    and create_time > to_date('2022-07-21','YYYY-MM-DD')
-    union
-    (
-    select weightNo actual_first_no,
-    noticeId prediction_no,
-    replace(carNo, '-', '') car_no,
-    weight*1000 meter_weight,
-    weightTime create_time,
-    fs_pointId base_spot_no,
-    pointName base_spot_name,
-    sender forwarding_unit_no,
-    senderName forwarding_unit_name,
-    receiver receiving_uint_no,
-    receiverName receiving_uint_name,
-    material matter_no,
-    materialName matter_name,
-    senderRemark sender_remark,
-    '老系统' remark
-    from jgweight.VIEW_CAR_FIRST @MCMS
-    where weightTime > to_date('2022-07-21','YYYY-MM-DD') AND FS_DELETEDTAG='N'
-    and noticeId is not null)
-    ) A
-    where 1 = 1
-    <if test="remark != null and remark != ''">
-      and remark LIKE '%${remark}%'
-    </if>
-    <if test="predictionNo != null and predictionNo != ''">
-      and prediction_no LIKE '%${predictionNo}%'
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="senderRemark != null and senderRemark != ''">
-      and sender_remark LIKE '%${senderRemark}%'
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and car_no like '%${carNo}%'
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and base_spot_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and base_spot_name like '%${baseSpotName}%'
-    </if>
-    <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-      and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-    </if>
-    <if test="forwardingUnitName != null and forwardingUnitName != ''">
-      and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-    </if>
-    <if test="receivingUintNo != null and receivingUintNo != ''">
-      and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-    </if>
-    <if test="receivingUintName != null and receivingUintName != ''">
-      and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and matter_no LIKE '%${matterNo}%'
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and matter_name LIKE '%${matterName}%'
-    </if>
-  </select>
-
-
-  <select id="countOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
-    select * from
-    (
-    select matter_no,
-    matter_name,
-    count(1) countSum,
-    sum(net_weight) net_weight,
-    sum(gross_weight) gross_weight,
-    sum(tare_weight) tare_weight,
-    forwarding_unit_no,
-    forwarding_unit_name,
-    receiving_uint_no,
-    receiving_uint_name,
-    '新系统' remark
-    from meter_work_car_actual
-    where 1= 1
-    and IS_PRE_SCALE='1'
-    and VALUE_FLAG in ('1', '2')
-    and UPLOAD_FLAG='2'
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="netSpot3No != null and netSpot3No != ''">
-      and net_spot3_no like '%${netSpot3No}%'
-    </if>
-    <if test="netSpot3Name != null and netSpot3Name != ''">
-      and net_spot3_name like '%${netSpot3Name}%'
-    </if>
-    <if test="senderRemark != null and senderRemark != ''">
-      and sender_remark LIKE '%${senderRemark}%'
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and car_no LIKE '%${carNo}%'
-    </if>
-    group by matter_no, matter_name, forwarding_unit_no, forwarding_unit_name, receiving_uint_no, receiving_uint_name
-    union
-    (
-    select fs_material matter_no,
-    fs_materialName matter_name,
-    count(1) countSum,
-    sum(fs_netWeight*1000) net_weight,
-    sum(fs_grossWeight*1000) gross_weight,
-    sum(fs_tareWeight*1000) tare_weight,
-    fs_sender forwarding_unit_no,
-    fs_senderName forwarding_unit_name,
-    fs_receiver receiving_uint_no,
-    fs_receiverName receiving_uint_name,
-    '老系统' remark
-    from jgweight.view_car_net @MCMS
-    where 1 = 1
-    and fs_noticeId is not null
-    and FS_DELETEDTAG='N'
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  fs_netweightTime  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and fs_netweightTime  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="netSpot3No != null and netSpot3No != ''">
-      and fs_netPointId like '%${netSpot3No}%'
-    </if>
-    <if test="netSpot3Name != null and netSpot3Name != ''">
-      and fs_netPointName like '%${netSpot3Name}%'
-    </if>
-    <if test="senderRemark != null and senderRemark != ''">
-      and fs_senderRemark LIKE '%${senderRemark}%'
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and FS_CARNO LIKE '%${carNo}%'
-    </if>
-    group by fs_material, fs_materialName, fs_sender , fs_senderName , fs_receiver , fs_receiverName
-    )
-    )
-    where 1=1
-    <if test="remark != null and remark != ''">
-      and remark LIKE '%${remark}%'
-    </if>
-    <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-      and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-    </if>
-    <if test="forwardingUnitName != null and forwardingUnitName != ''">
-      and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-    </if>
-    <if test="receivingUintNo != null and receivingUintNo != ''">
-      and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-    </if>
-    <if test="receivingUintName != null and receivingUintName != ''">
-      and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and matter_no LIKE '%${matterNo}%'
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and matter_name LIKE '%${matterName}%'
-    </if>
-  </select>
-
-  <!--根据时间查询所有秤点的结净已匹配、结净未匹配、结净已上传、结净未上传、结净已作废-->
-  <select id="countAllState" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where 1 = 1
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  net_spot3_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  net_spot3_name like '%${baseSpotName}%'
-    </if>
-    <if test="netSpot3NoStr != null and netSpot3NoStr != ''">
-      and net_spot3_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-  </select>
-
-  <select id="carActualDataDetail" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where 1 = 1
-    <if test="validFlag != null and validFlag != ''">
-      and  value_flag != '0'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  value_flag = #{valueFlag}
-    </if>
-    <if test="isPreScale != null and isPreScale != ''">
-      and IS_PRE_SCALE = #{isPreScale}
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    order by net_time desc
-  </select>
-
-  <select id="netWeightAndTheoryAmount" parameterType="java.util.HashMap" resultType="hashmap">
-    select A.car_no,
-    A.prediction_no,
-    A.matter_name,
-    to_char(round(B.gross_weight/1000,2),'FM9999999999999999.00') grossWeight,
-    to_char(round(B.tare_weight/1000,2),'FM9999999999999999.00') tareWeight,
-    to_char(round(B.net_weight/1000,2),'FM9999999999999999.00') netWeight,
-    A.theory_amount,
-    to_char(round(B.net_weight/1000,2),'FM9999999999999999.00') - A.theory_amount netWeightSubTheoryWeight,
-    A.forwarding_unit_name,
-    A.receiving_uint_name,
-    B.gross_time,
-    B.base_spot1_name,
-    B.tare_time,
-    B.base_spot2_name,
-    B.net_time,
-    B.net_spot3_name
-    from pre_track_scale A
-    left join meter_work_car_actual B
-    on A.prediction_no = B.prediction_no
-    where A.theory_amount is not null
-    and B.actual_no is not null
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  B.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and B.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and B.car_no like '%${carNo}%'
-    </if>
-    <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-      and B.FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-    </if>
-    <if test="forwardingUnitName != null and forwardingUnitName != ''">
-      and B.FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-    </if>
-    <if test="receivingUintNo != null and receivingUintNo != ''">
-      and B.RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-    </if>
-    <if test="receivingUintName != null and receivingUintName != ''">
-      and B.RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-    </if>
-    <if test="matterNo != null and matterNo != ''">
-      and B.matter_no LIKE '%${matterNo}%'
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and B.matter_name LIKE '%${matterName}%'
-    </if>
-    order by B.net_time desc
-  </select>
-
-  <!-- 查询符合内倒双委托车辆在铁合金秤点用普通委托信息过磅的结净信息倒序 -->
-  <select id="findTHJNetWeight" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select A.*
-    from meter_work_car_actual A
-    where A.car_no in (select distinct base_name
-    from com_base_info
-    where p_base_code = '001047')
-    and A.net_spot3_no = 'JT0026'
-    and ( A.prediction_type is null or A.prediction_type = '1' )
-    and A.is_pre_scale = '1'
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and A.car_no like '%${carNo}%'
-    </if>
-    order by A.net_time desc
-  </select>
-
-  <select id="findFiveNetWeight" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select A.*
-    from meter_work_car_actual A
-    where 1 = 1
-    and A.net_spot3_no in ('JT0035', 'JT0034')
-    and A.prediction_type = '5'
-    and A.is_pre_scale = '1'
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and A.car_no like '%${carNo}%'
-    </if>
-    order by A.net_time ASC
-  </select>
-
-  <select id="countDayAllState" parameterType="java.util.HashMap" resultType="hashmap">
-    SELECT A.net_spot3_no,
-    A.net_spot3_name,
-    A.net_man_no,
-    A.net_man_name,
-    count(1) count_actual
-    from meter_work_car_actual A
-    left join pre_track_scale B
-    on A.prediction_no = B.prediction_no
-    where 1 = 1
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="netSpot3NoStr != null and netSpot3NoStr != ''">
-      and A.net_spot3_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="createManNoStr != null and createManNoStr != ''">
-      and A.net_man_no in
-      <foreach collection="manNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  A.net_spot3_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  A.net_spot3_name like '%${baseSpotName}%'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  A.value_flag = #{valueFlag}
-    </if>
-    <if test="validFlag != null and validFlag != ''">
-      and  A.value_flag != '0'
-    </if>
-    <if test="isPreScale != null and isPreScale != ''">
-      and  A.is_pre_scale = #{isPreScale}
-    </if>
-    group by A.net_spot3_no,
-    A.net_spot3_name,
-    A.net_man_no,
-    A.net_man_name
-  </select>
-
-  <select id="smallAndNegativeNetWeightRatio" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select A.actual_no,
-    A.car_no,
-    A.prediction_no,
-    A.matter_name,
-    A.gross_weight,
-    A.tare_weight,
-    A.net_weight,
-    A.update_man_name,
-    A.update_time,
-    A.note,
-    A.sender_remark,
-    A.forwarding_unit_name,
-    A.receiving_uint_name,
-    A.gross_time,
-    A.base_spot1_name,
-    case when A.gross_mode = '1' then '远程计量'
-    when A.gross_mode = '2' then '智能计量'
-    when A.gross_mode = '3' then '手工计量'
-    else null end gross_mode,
-    A.gross_man_name,
-    A.tare_time,
-    A.base_spot2_name,
-    case when A.tare_mode = '1' then '远程计量'
-    when A.tare_mode = '2' then '智能计量'
-    when A.tare_mode = '3' then '手工计量'
-    else null end tare_mode,
-    A.tare_man_name,
-    A.net_time,
-    A.net_spot3_name,
-    A.net_man_name,
-    case when A.value_flag = '0' then '作废'
-    when A.value_flag = '1' then '有效'
-    else null end value_flag,
-    case when A.upload_flag = '1' then '未同步'
-    when A.upload_flag = '2' then '已同步'
-    else null end upload_flag
-    from meter_work_car_actual A
-    where A.net_weight &lt;= 2000
-    and A.value_flag != '0'
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  A.net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and A.net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and A.car_no like '%${carNo}%'
-    </if>
-  </select>
-    <select id="getNetFilterCheck"
-            resultType="java.util.LinkedHashMap">
-      <include refid="select"></include>
-      <where>
-        <if test="predictionNo != null and predictionNo != ''">
-          and prediction_no LIKE '%${predictionNo}%'
-        </if>
-        <if test="senderRemark != null and senderRemark != ''">
-          and sender_remark LIKE '%${senderRemark}%'
-        </if>
-        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-          and net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-        </if>
-        <if test="carNo != null and carNo != ''">
-          and car_no like '%${carNo}%'
-        </if>
-        <if test="netSpot3No != null and netSpot3No != ''">
-          and net_spot3_no like '%${netSpot3No}%'
-        </if>
-        <if test="netSpot3Name != null and netSpot3Name != ''">
-          and net_spot3_name like '%${netSpot3Name}%'
-        </if>
-        <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-          and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-        </if>
-        <if test="forwardingUnitName != null and forwardingUnitName != ''">
-          and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-        </if>
-        <if test="receivingUintNo != null and receivingUintNo != ''">
-          and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-        </if>
-        <if test="receivingUintName != null and receivingUintName != ''">
-          and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-        </if>
-        <if test="matterNo != null and matterNo != ''">
-          and matter_no LIKE '%${matterNo}%'
-        </if>
-        <if test="matterName != null and matterName != ''">
-          and matter_name LIKE '%${matterName}%'
-        </if>
-        <if test="minWgt != null and minWgt != ''">
-          and NET_WEIGHT/1000 >= '${minWgt}'
-        </if>
-        <if test="maxWgt != null and maxWgt != ''">
-          and NET_WEIGHT/1000 &lt;= '${maxWgt}'
-        </if>
-      </where>
-      order by net_time desc
-    </select>
-  <select id="getNetFilterCheckWeightReversal" resultType="java.util.LinkedHashMap">
-    <include refid="select"></include>
-    <where>
-      <if test="predictionNo != null and predictionNo != ''">
-        and prediction_no LIKE '%${predictionNo}%'
-      </if>
-      <if test="senderRemark != null and senderRemark != ''">
-        and sender_remark LIKE '%${senderRemark}%'
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and net_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-      <if test="carNo != null and carNo != ''">
-        and car_no like '%${carNo}%'
-      </if>
-      <if test="netSpot3No != null and netSpot3No != ''">
-        and net_spot3_no like '%${netSpot3No}%'
-      </if>
-      <if test="netSpot3Name != null and netSpot3Name != ''">
-        and net_spot3_name like '%${netSpot3Name}%'
-      </if>
-      <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
-        and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
-      </if>
-      <if test="forwardingUnitName != null and forwardingUnitName != ''">
-        and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
-      </if>
-      <if test="receivingUintNo != null and receivingUintNo != ''">
-        and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
-      </if>
-      <if test="receivingUintName != null and receivingUintName != ''">
-        and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and matter_no LIKE '%${matterNo}%'
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and matter_name LIKE '%${matterName}%'
-      </if>
-      <if test="minWgt != null and minWgt != '' and maxWgt != null and maxWgt != ''">
-        and (NET_WEIGHT/1000 &lt; '${minWgt}' or NET_WEIGHT/1000 > '${maxWgt}')
-      </if>
-    </where>
-    order by net_time desc
+   <select id="selectDuplicatePredictions" resultType="com.steerinfo.abnormalHandler.dto.DuplicatePrediction">
+     SELECT
+       PREDICTION_NO "predictionNo",
+       COUNT( 1 ) "count"
+     FROM
+       METER_WORK_CAR_ACTUAL
+     WHERE
+       VALUE_FLAG != '0'
+	AND PREDICTION_NO IS NOT NULL
+	AND CREATE_TIME >= SYSDATE - 3
+     GROUP BY
+       PREDICTION_NO,
+       CAR_NO,
+       NET_WEIGHT,
+       FORWARDING_UNIT_NO,
+       RECEIVING_UINT_NO
+     HAVING
+       COUNT( 1 ) > 1 FETCH NEXT 20 ROWS ONLY
+   </select>
+  <select id="selectActualRecordsByPrediction" resultType="com.steerinfo.abnormalHandler.dto.ActualRecord">
+    SELECT ACTUAL_NO,
+           PREDICTION_NO,
+           ACTUAL_FIRST1_NO,
+           ACTUAL_FIRST2_NO,
+           CREATE_TIME,
+           VALUE_FLAG
+    FROM METER_WORK_CAR_ACTUAL
+    WHERE PREDICTION_NO = #{predictionNo}
+      AND VALUE_FLAG != '0'
+    ORDER BY CREATE_TIME ASC, ACTUAL_NO ASC
   </select>
-    <select id="findCommonRemove"  resultMap="BaseResultMap">
-      select * from METER_WORK_CAR_ACTUAL t where t.car_no in ('甘B07522','甘AQY023','甘B07268','晋B91232','晋JW5922')
-      AND TO_CHAR(T.NET_TIME,'yyyy-MM-dd') >= '2026-04-25'
-      AND TO_CHAR(T.NET_TIME,'yyyy-MM-dd') &lt;= '2026-05-25'
-      AND T.VALUE_FLAG = '1'
-    </select>
-  <select id="selectByMapRe" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    WHERE CAR_NO = #{carNo}
-    and value_flag != '0'
-    order by ACTUAL_NO desc
-    FETCH FIRST 1 ROW ONLY
-  </select>
-    <select id="selectLastUpWeightByCarNo" resultType="java.math.BigDecimal">
-      SELECT * FROM METER_WORK_CAR_ACTUAL WHERE CAR_NO = #{carNo} AND VALUE_FLAG != '0' AND prediction_Type = 1 ORDER BY NET_TIME DESC
-      FETCH FIRST 1 ROW ONLY
-    </select>
+  <update id="invalidateActualRecord">
 
+  </update>
 </mapper>

+ 20 - 77
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.java

@@ -1,5 +1,7 @@
 package com.steerinfo.meterwork.meterworkcaractualfirst.mapper;
 
+import com.steerinfo.abnormalHandler.dto.DuplicateFirstGroup;
+import com.steerinfo.abnormalHandler.dto.FirstRecord;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.meterwork.dto.*;
 import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
@@ -13,83 +15,6 @@ import java.util.*;
 
 @Mapper
 public interface MeterWorkCarActualFirstMapper extends IBaseMapper<MeterWorkCarActualFirst, String> {
-    String getNewID(@Param(value = "afl") String afl);
-
-    List<MeterWorkCarActualFirst> selectView(Map<Objects, String> parmas);
-
-    MeterWorkCarActualFirst selectAndMatch(@Param(value = "actualFirstNo") String actualFirstNo, @Param(value = "predictionNo") String predictionNo);
-
-    MeterWorkCarActualFirst selectAndRemove(@Param(value = "actualFirstNo") String actualFirstNo);
-
-    List<MeterWorkCarActualFirst> selectTa(Map<String, Object> parmas);
-
-    List<MeterWorkCarActualFirst> selectByCarNo(@Param(value = "carNo") String carNo);
-
-    List<MeterWorkCarActualFirst> selectNet(@Param(value = "weightType") String weightType, @Param(value = "carNo") String carNo);
-
-    List<StaffPerformanceAnalysis> analysis(HashMap<String, Object> obj);
-
-    List<UtensilDto> utensil(HashMap<String, Object> obj);
-
-    List<MeterTypeDto> meterType(HashMap<String, Object> obj);
-
-    List<TimesDto> daily(HashMap<String, Object> obj);
-
-    List<TimesDto> period(HashMap<String, Object> obj);
-
-    List<MeterWorkCarActualFirst> detailed(HashMap<String, Object> obj);
-
-    List<AbnormalDto> abnormal(HashMap<String, Object> obj);
-
-    List<MeterWorkCarActualFirst> getByAbnormal(HashMap<String, Object> obj);
-
-    /*List<MeterWorkCarActualFirst> selectForAppLoad(ArrayList<String> id);*/
-
-    List<MeterWorkCarActualFirst> selectForAppLoad(Map<String, Object> parmas);
-
-    /**
-     * 已确认但是未结净的卸货数据
-     * @param map
-     * @return
-     */
-    List<MeterWorkCarActualFirst> selectForAppLoadFirst(Map<String, Object> map);
-
-    /**
-     * 查询当天未使用的液碱的销售出厂的预报数据
-     * @return
-     */
-    List<MeterWorkCarActualFirst> selectInvalidNaOHData();
-
-    /**
-     * 查询:按时间排序
-     * @param parmas
-     * @return
-     */
-    List<MeterWorkCarActualFirst> queryOrderByTime(HashMap parmas);
-
-    /**
-     * 根据传入时间和车号,查询给定时间段去重车号
-     * @param obj
-     * @return
-     */
-    List<MeterWorkCarActualFirst> distinctCarNo(HashMap<String, Object> obj);
-
-    void repairPre(Map<String, Object> map);
-
-    List<MeterWorkCarActualFirst> likeByDesc(Map<String, Object> params);
-    List<MeterWorkCarActualFirst> carFirstDataDetail(Map<String, Object> params);
-    List<MeterWorkCarActualFirst> ApplikeByDesc(Map<String, Object> params);
-
-    List<MeterWorkCarActualFirst> queryForTimeInterval(Map<String, Object> params);
-
-    List<MeterWorkCarActualFirst> selectById(List<String> actualNoList);
-
-    int countFirstByCar(HashMap params);
-
-    //根据时间查询所有秤点的一次毛重、一次皮重、一次期限皮、一次有效、一次作废
-    List<MeterWorkCarActualFirst> countAllState(Map<String, Object> params);
-    List<HashMap> countDayAllState(Map<String, Object> params);
-    List<MeterWorkCarActualFirst> allStateView(Map<String, Object> params);
 
     List<String> selectRule1PredictionNos();
 
@@ -130,4 +55,22 @@ public interface MeterWorkCarActualFirstMapper extends IBaseMapper<MeterWorkCarA
      * @param actualFirstNo 一次实绩编号
      */
     int updateFirstByRule5(@Param("actualFirstNo") String actualFirstNo);
+
+    List<Map<String, Objects>> selectReActualFirstNoMap();
+
+    List<Map<String, Objects>> selectReActualNoMap();
+
+    List<DuplicateFirstGroup> selectDuplicateFirstGroups();
+
+    List<FirstRecord> selectFirstRecordsByGroup(@Param("createTimeSec") String createTimeSec,
+                                                @Param("predictionNo") String predictionNo,
+                                                @Param("carNo") String carNo,
+                                                @Param("baseSpotNo") String baseSpotNo,
+                                                @Param("meterWeight") Double meterWeight,
+                                                @Param("forwardingUnitNo") String forwardingUnitNo,
+                                                @Param("receivingUintNo") String receivingUintNo);
+
+    int countActualBoundByFirstNo(@Param("actualFirstNo") String actualFirstNo);
+
+    int invalidateFirstRecord(String actualFirstNo);
 }

+ 40 - 636
src/main/java/com/steerinfo/meterwork/meterworkcaractualfirst/mapper/MeterWorkCarActualFirstMapper.xml

@@ -2692,641 +2692,6 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
-    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(ACTUAL_FIRST_NO, LENGTH(ACTUAL_FIRST_NO) - 3))),0) + 1,4,'0') ACTUAL_FIRST_NO
-    FROM METER_WORK_CAR_ACTUAL_FIRST where instr(ACTUAL_FIRST_NO,#{afl,jdbcType=VARCHAR})>0
-  </select>
-
-  <sql id="whereTime">
-    <where>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-  </sql>
-  <select id="getByAbnormal" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      METER_REASON_NO LIKE '%${meterReasonNo}%' and METER_REASON_NAME LIKE '%${meterReasonName}%'
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{startTime} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
-        HH24:mi:ss') &lt;= #{endTime}
-      </if>
-      <if test="baseSpotNo != null and baseSpotNo != ''">
-        and BASE_SPOT_NO = #{baseSpotNo}
-      </if>
-      <if test="baseSpotName != null and baseSpotName != ''">
-        and BASE_SPOT_NAME = #{baseSpotName}
-      </if>
-    </where>
-  </select>
-
-  <select id="selectByCarNo" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      VALUE_FLAG IN ('1', '3') AND CAR_NO= #{carNo,jdbcType=VARCHAR} order by create_time desc
-    </where>
-  </select>
-
-  <select id="selectView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT
-    <include refid="columns"/>
-    from METER_WORK_CAR_ACTUAL_FIRST
-    <where>
-      <if test="carNo != null and carNo != ''">
-        and CAR_NO LIKE '%${carNo}%'
-      </if>
-      <if test="matterNo != null and matterNo != ''">
-        and MATTER_NO = #{matterNo}
-      </if>
-      <if test="matterName != null and matterName != ''">
-        and MATTER_NAME = #{matterName}
-      </if>
-      <if test="meterTypeNo != null and meterTypeNo != ''">
-        and METER_TYPE_NO = #{meterTypeNo}
-      </if>
-      <if test="meterTypeName != null and meterTypeName != ''">
-        and METER_TYPE_NAME = #{meterTypeName}
-      </if>
-      <if test="baseSpotNo != null and baseSpotNo != ''">
-        and BASE_SPOT_NO = #{baseSpotNo}
-      </if>
-      <if test="baseSpotName != null and baseSpotName != ''">
-        and BASE_SPOT_NAME = #{baseSpotName}
-      </if>
-      <if test="valueFlag != null and valueFlag != ''">
-        and VALUE_FLAG = #{valueFlag}
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    order by  CREATE_TIME desc
-  </select>
-  <select id="selectAndMatch" parameterType="java.lang.String" resultMap="BaseResultMap">
-      select t.ACTUAL_FIRST_NO, t1.PREDICTION_NO, t1.NOTICE_NO, t.CAR_NO, t1.TRAILER_NO, t1.MATTER_NO,
-        t1.voucher_identity, t1.voucher_item, t1.business_group, t1.temp_conveyance, t1.conveyance_type,
-        t1.resource_system, t1.group_package_amount, t1.group_package_unit, t1.package_amount,
-        t1.package_unit, t1.theory_amount, t1.measure_batch,t1.measure_batch_count,t1.sender_type,
-        t1.sender_remark,t1.receiver_type, t1.receiver_remark,t1.amount_unit,t.data_source,
-        t1.MATTER_NAME, t1.CONTRACT_NO, t1.BATCH_NO, t1.CUSTOMER_SUPPLIER_NO, t1.CUSTOMER_SUPPLIER_NAME,
-        t1.FORWARDING_UNIT_NO, t1.FORWARDING_UNIT_NAME, t1.RECEIVING_UINT_NO, t1.RECEIVING_UINT_NAME,
-        t1.MATERIAL_NO, t1.MATERIAL_NAME, t1.SPEC_NO, t1.SPEC_NAME, t1.SHIPMENT_GROSS_WEIGHT,
-        t1.SHIPMENT_NET_WEIGHT, t1.SHIPMENT_NUM, t1.BIND_CARD_NO, t1.LOAD_POINT_NO, t1.LOAD_POINT_NAME,
-        t1.SAMPLE_NO, t1.SAMPLE_VOUCHER, t1.CARRIER_UNIT_NO, t1.CARRIER_UNIT_NAME, t1.PREDICTION_TYPE,
-        t1.PREDICTION_COMBINATION, t1.METER_TYPE_NO, t1.METER_TYPE_NAME, t1.RAILWAY_NO, t1.METER_PROCESS_NO,
-        t1.METER_PROCESS_EDITION_NO,t.IS_PRE_SCALE, t.METER_WEIGHT, t.ADD_WEIGHT, t.METER_NUM, t.WEIGHT_TYPE,
-        t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.BASE_SPOT_NO, t.BASE_SPOT_NAME,
-        t.METER_CLASS, t.METER_GROUP, t.MEMO, t.VALUE_FLAG, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME,
-        t.UPDATE_TIME, t.CHECK_FLAG, t.CHECK_MAN_NO, t.CHECK_MAN_NAME, t.CHECK_TIME, t.METER_MODE
-        from METER_WORK_CAR_ACTUAL_FIRST t,PRE_TRACK_SCALE t1
-        where t.ACTUAL_FIRST_NO= #{actualFirstNo,jdbcType=VARCHAR} and t1.PREDICTION_NO= #{predictionNo,jdbcType=VARCHAR}
-  </select>
-  <select id="selectAndRemove" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select TRAILER_NO,CAR_NO,ACTUAL_FIRST_NO, METER_WEIGHT, ADD_WEIGHT, METER_NUM, WEIGHT_TYPE,
-    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, BASE_SPOT_NO, BASE_SPOT_NAME, data_source,
-    METER_CLASS, METER_GROUP, MEMO, VALUE_FLAG, UPDATE_MAN_NO, UPDATE_MAN_NAME,
-    UPDATE_TIME, CHECK_FLAG, CHECK_MAN_NO, CHECK_MAN_NAME, CHECK_TIME, METER_MODE,IS_PRE_SCALE
-    from METER_WORK_CAR_ACTUAL_FIRST
-    where ACTUAL_FIRST_NO= #{actualFirstNo,jdbcType=VARCHAR}
-    </select>
-  <select id="selectTa" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT
-    <include refid="columns"/>
-    from METER_WORK_CAR_ACTUAL_FIRST
-    <where>
-      VALUE_FLAG= '1' and CHECK_FLAG= '1' and WEIGHT_TYPE= #{weightType}
-      <if test="carNo != null and carNo != ''">
-        and CAR_NO LIKE '%${carNo}%'
-      </if>
-      <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    order by CREATE_TIME  desc
-  </select>
-  <select id="selectNet" parameterType="java.lang.String" resultMap="BaseResultMap">
-    SELECT
-    <include refid="columns"/>
-    from METER_WORK_CAR_ACTUAL_FIRST
-    where VALUE_FLAG= '1' and CHECK_FLAG= '1' and CAR_NO=#{carNo,jdbcType=VARCHAR} and WEIGHT_TYPE in
-    ('1','2','3','4','5')
-  </select>
-
-  <resultMap id="BaseResultMapDto" type="com.steerinfo.meterwork.dto.StaffPerformanceAnalysis"
-             extends="BaseResultMap">
-    <result column="STAFF_ID" jdbcType="VARCHAR" property="staffId"/>
-    <result column="STAFF_NAME" jdbcType="VARCHAR" property="staffName"/>
-    <result column="ARTIFICIAL_NUM" jdbcType="VARCHAR" property="artificialNum"/>
-    <result column="CALIBRATION_NUM" jdbcType="VARCHAR" property="calibrationNum"/>
-    <result column="CHECK_NUM" jdbcType="VARCHAR" property="checkNum"/>
-    <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime"/>
-    <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime"/>
-  </resultMap>
-  <select id="analysis" parameterType="java.util.HashMap" resultMap="BaseResultMapDto">
-    select nvl(t1.num1,0) ARTIFICIAL_NUM,nvl(t2.num1,0) CHECK_NUM,nvl(t3.num1,0) CALIBRATION_NUM,t4.id
-    STAFF_ID,t4.names STAFF_NAME
-    from
-    (select count(1) num1,t.create_man_no id,t.create_man_name names
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      t.value_flag !='0'
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    group by t.create_man_no,t.create_man_name
-    )t1,
-    (select count(1) num1,t.check_man_no id,t.check_man_name names
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      t.value_flag !='0'
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and TO_CHAR(t.CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{startTime} and TO_CHAR(t.CREATE_TIME,'yyyy-MM-dd
-        HH24:mi:ss') &lt;= #{endTime}
-      </if>
-    </where>
-    group by t.check_man_no,t.check_man_name
-    )t2,
-    (select count(1) num1,t.create_man_no id,t.create_man_name names
-    from METER_WORK_CALIBRATION_BRANCH t
-    <where>
-      t.value_flag !='0' and t.SPOT_TYPE_NO='001002001' and t.SPOT_TYPE_NAME='汽车衡'
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    group by t.create_man_no,t.create_man_name
-    )t3,
-    (select create_man_no id,create_man_name names
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      value_flag !='0'
-      and t.create_man_no is not null
-      and t.create_man_name is not null
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{startTime} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
-        HH24:mi:ss') &lt;= #{endTime}
-      </if>
-    </where>
-    union
-    select check_man_no id,check_man_name names
-    from METER_WORK_CAR_ACTUAL_FIRST
-    <where>
-      check_man_no is not null
-      and check_man_name is not null
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    union
-    select create_man_no id,create_man_name names
-    from METER_WORK_CALIBRATION_BRANCH
-    <where>
-      value_flag !='0' and SPOT_TYPE_NO='001002001' and SPOT_TYPE_NAME='汽车衡' and create_man_no is not null
-      and create_man_name is not null
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{startTime} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
-        HH24:mi:ss') &lt;= #{endTime}
-      </if>
-    </where>
-    )t4
-    where t4.id=t3.id(+) and t4.id=t2.id(+) and t4.id=t1.id(+)
-  </select>
-
-
-  <resultMap id="UtensilDto" type="com.steerinfo.meterwork.dto.UtensilDto" extends="BaseResultMap">
-    <result column="SPOT_ID" jdbcType="VARCHAR" property="spotId"/>
-    <result column="SPOT_NAME" jdbcType="VARCHAR" property="spotName"/>
-    <result column="NUM" jdbcType="VARCHAR" property="num"/>
-  </resultMap>
-  <select id="utensil" parameterType="java.util.HashMap" resultMap="UtensilDto">
-    select t.base_spot_name SPOT_NAME,t.base_spot_no SPOT_ID,count(1) NUM
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      t.value_flag !='0'
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    group by t.base_spot_name,t.base_spot_no
-  </select>
-
-
-  <resultMap id="MeterTypeDto" type="com.steerinfo.meterwork.dto.MeterTypeDto" extends="BaseResultMap">
-    <result column="METER_TYPE_NO" jdbcType="VARCHAR" property="meterTypeNo"/>
-    <result column="METER_TYPE_NAME" jdbcType="VARCHAR" property="meterTypeName"/>
-    <result column="NUM" jdbcType="VARCHAR" property="num"/>
-  </resultMap>
-  <select id="meterType" parameterType="java.util.HashMap" resultMap="MeterTypeDto">
-    select t2.base_code METER_TYPE_NO,t2.base_name METER_TYPE_NAME,nvl(t1.num,0) NUM
-    from
-    (select t.meter_type_no,t.meter_type_name,count(1) num
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      t.value_flag !='0' and t.base_spot_no=#{baseSpotNo}
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and TO_CHAR(t.CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{startTime} and TO_CHAR(t.CREATE_TIME,'yyyy-MM-dd
-        HH24:mi:ss') &lt;= #{endTime}
-      </if>
-    </where>
-    group by t.meter_type_no,t.meter_type_name) t1,
-    (select t.base_code,t.base_name
-    from COM_BASE_INFO t
-    where t.p_base_code='001006') t2
-    where t2.base_code=t1.meter_type_no(+)
-  </select>
-
-  <resultMap id="TimesDto" type="com.steerinfo.meterwork.dto.TimesDto" extends="BaseResultMap">
-    <result column="TIMES" jdbcType="VARCHAR" property="times"/>
-    <result column="NUM" jdbcType="VARCHAR" property="num"/>
-  </resultMap>
-  <select id="daily" parameterType="java.util.HashMap" resultMap="TimesDto">
-    select t2.times times,nvl(t1.num,0) num
-    from (select to_char(t.create_time,'yyyy-MM-dd') times,count(1) num
-    from METER_WORK_CAR_ACTUAL_FIRST t
-    where   t.value_flag !='0' and t.base_spot_no=#{baseSpotNo}
-    group by to_char(t.create_time,'yyyy-MM-dd') )t1,
-    (
-    SELECT to_char(TO_DATE(substr(#{startTime},1,10), 'yyyy-MM-dd') + ROWNUM - 1,'yyyy-MM-dd') as times
-    FROM DUAL
-    CONNECT BY ROWNUM &lt;= trunc(to_date(substr(#{endTime},1,10), 'yyyy-MM-dd') -to_date(substr(#{startTime},1,10), 'yyyy-MM-dd')) + 1
-    ) t2
-    where t2.times=t1.times(+)
-    order by t2.times asc
-  </select>
-  <select id="period" parameterType="java.util.HashMap" resultMap="TimesDto">
-    SELECT concat((to_char(t.create_time,'hh24')),':00:00') times,count(1) num
-    FROM METER_WORK_CAR_ACTUAL_FIRST t
-    <where>
-      t.value_flag !='0' and t.base_spot_no=#{baseSpotNo}
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-    </where>
-    GROUP BY concat((to_char(t.create_time,'hh24')),':00:00')
-  </select>
-
-
-  <select id="detailed" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT t.*
-      FROM METER_WORK_CAR_ACTUAL_FIRST t
-     where t.value_flag != '0' and t.actual_first_no in
-           (select t1.Actual_First_No
-              from METER_MONITOR_WEIGHT t1,
-                   (select max(t.collect_time) collect_time,
-                           t.collect_start_time collect_start_time
-                      from METER_MONITOR_WEIGHT t
-                     WHERE t.collect_start_time in
-                           (select distinct (t.collect_start_time)
-                              from METER_MONITOR_WEIGHT t
-                             where t.actual_first_no is not null)
-                       and t.SPOT_TYPE_NO = #{spotTypeNo}
-                     group by t.collect_start_time
-                     order by t.collect_start_time desc) t2
-             where t2.collect_time = #{num}
-               and to_char(t2.collect_start_time, 'yyyy-MM') = #{times}
-               and t1.collect_start_time = t2.collect_start_time
-               and t1.spot_type_no = #{spotTypeNo})
-  </select>
-
-  <resultMap id="AbnormalDto" type="com.steerinfo.meterwork.dto.AbnormalDto" extends="BaseResultMap">
-    <result column="METER_REASON_NO" jdbcType="VARCHAR" property="meterReasonNo"/>
-    <result column="METER_REASON_NAME" jdbcType="VARCHAR" property="meterReasonName"/>
-    <result column="ABNORMAL_NUM" jdbcType="VARCHAR" property="abnormalNum"/>
-    <result column="ABNORMAL_WEIGHT" jdbcType="VARCHAR" property="abnormalWeight"/>
-    <result column="START_TIME" jdbcType="VARCHAR" property="startTime"/>
-    <result column="END_TIME" jdbcType="VARCHAR" property="endTime"/>
-  </resultMap>
-
-  <select id="abnormal" parameterType="java.util.HashMap" resultMap="AbnormalDto">
-    select t2.code METER_REASON_NO,t2.name METER_REASON_NAME,nvl(num,0) ABNORMAL_NUM,nvl(weight,0) ABNORMAL_WEIGHT
-    from
-    (select d2.base_code code,d2.base_name name,count(1) num,sum(d1.meter_weight) weight
-    from METER_WORK_CAR_ACTUAL_FIRST d1,COM_BASE_INFO d2
-    <where>
-      d2.p_base_code='001024' and instr(d1.meter_reason_no,d2.base_code)>0
-      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
-        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-      </if>
-      <if test="baseSpotNo != null and baseSpotNo != ''">
-        and d1.BASE_SPOT_NO = #{baseSpotNo}
-      </if>
-      <if test="baseSpotName != null and baseSpotName != ''">
-        and d1.BASE_SPOT_NAME = #{baseSpotName}
-      </if>
-    </where>
-    group by d2.base_code,d2.base_name)t1,
-    (select t.base_code code,t.base_name name
-    from COM_BASE_INFO t
-    where t.p_base_code='001024' and t.valid_flag='1') t2
-    where t2.code=t1.code(+)
-  </select>
-
-  <!--未确认的卸货数据-->
-  <select id="selectForAppLoad" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select t1.*
-    from meter_work_car_actual_first t1
-    left join METER_WORK_PRE_LINK t2
-    on t1.prediction_no = t2.prediction_no
-    where t1.WEIGHT_TYPE = '0' and t1.VALUE_FLAG in ('1','2') and t2.link_code = '001021004'
-    and t1.load_point_no in (select s.load_point_no from meter_base_load_userloadinfo s where s.user_code =
-    #{createManNo})
-    <if test="valueFlag != null and valueFlag != ''">
-      and t2.value_flag = #{valueFlag}
-    </if>
-    order by t1.create_time desc
-  </select>
-
-  <!--已确认但是未结净的卸货数据-->
-  <select id="selectForAppLoadFirst" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    select t2.update_man_no, t2.update_man_name, t2.update_time, t1.actual_first_no, t1.prediction_no, t1.notice_no,
-    t1.car_no, t1.trailer_no, t1.matter_no, t1.matter_name, t1.contract_no, t1.batch_no, t1.customer_supplier_no,
-    t1.customer_supplier_name, t1.forwarding_unit_no, t1.forwarding_unit_name, t1.receiving_uint_no,
-    t1.receiving_uint_name, t1.material_no, t1.material_name, t1.spec_no, t1.spec_name, t1.shipment_gross_weight,
-    t1.shipment_net_weight, t1.shipment_num, t1.bind_card_no, t1.load_point_no, t1.load_point_name, t1.sample_no,
-    t1.sample_voucher, t1.carrier_unit_no, t1.carrier_unit_name, t1.prediction_type, t1.prediction_combination,
-    t1.meter_type_no, t1.meter_type_name, t1.railway_no, t1.meter_process_no, t1.meter_process_edition_no,
-    t1.meter_weight, t1.add_weight, t1.meter_num, t1.weight_type, t1.create_man_no, t1.create_man_name,
-    t1.create_time, t1.base_spot_no, t1.base_spot_name, t1.meter_class, t1.meter_group, t1.memo, t1.value_flag,
-    t1.check_flag, t1.check_man_no, t1.check_man_name, t1.check_time, t1.meter_mode, t1.meter_reason_no,
-    t1.meter_reason_name, t1.load_end_time, t1.add_wgt_no, t1.add_wgt_pk
-    from meter_work_car_actual_first t1
-    left join METER_WORK_PRE_LINK t2
-    on t1.prediction_no = t2.prediction_no
-    where t1.WEIGHT_TYPE = '0' and t1.VALUE_FLAG = '1' and t2.link_code = '001021004'
-    and t1.load_point_no in (select s.load_point_no from meter_base_load_userloadinfo s where s.user_code =
-    #{createManNo})
-    <if test="valueFlag != null and valueFlag != ''">
-      and t2.value_flag = #{valueFlag}
-    </if>
-    order by t1.create_time desc
-  </select>
-
-  <!--查询当天没有结净的销售出厂的液碱的数据-->
-  <select id="selectInvalidNaOHData" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT <include refid="columns"/>
-    from meter_work_car_actual_first t
-    where t.matter_no = '00495' and t.weight_type = '1' and t.value_flag = '1' and t.meter_type_no = '001006002' and
-    t.create_time  <![CDATA[<]]>  to_date(to_char(sysdate, 'yyyy-MM-dd') || ' 00:00:00', 'yyyy-MM-dd HH24:mi:ss')
-  </select>
-
-  <!--查询:按照时间进行排序-->
-  <select id="queryOrderByTime" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
-    order by create_time desc
-  </select>
-
-  <!-- 查询:根据传入时间和车号,查询给定时间段去重车号 -->
-  <select id="distinctCarNo" parameterType="java.lang.String" resultMap="BaseResultMap">
-    SELECT distinct car_No, create_time
-    from METER_WORK_CAR_ACTUAL_FIRST
-    where 1=1
-    <if test="baseSpotNames != null and baseSpotNames.size() != 0">
-      and BASE_SPOT_NAME in
-      <foreach collection="baseSpotNames" item="id" open="(" close=")" separator=",">
-        #{id}
-      </foreach>
-    </if>
-    <if test="carNo != null and carNo != ''">
-      and CAR_NO like '%${carNo}%'
-    </if>
-    <if test="carTypeNo != null and carTypeNo != ''">
-      and car_no in (
-      select distinct car_no
-      from meter_base_car where 1 = 1
-      and car_type_no = #{carTypeNo}
-      and valid_flag = '0'
-      )
-    </if>
-    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-      and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="matterName != null and matterName != ''">
-      and  matter_name like  '%${matterName}%'
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  base_spot_no = #{baseSpotNo}
-    </if>
-    <if test="predictionNo != null and predictionNo != ''">
-      and  prediction_no =  #{predictionNo}
-    </if>
-    <if test="forwardingUnitName != null and forwardingUnitName != ''">
-      and  forwarding_Unit_Name like '%${forwardingUnitName}%'
-    </if>
-    <if test="receivingUintName != null and receivingUintName != ''">
-      and  receiving_uint_name like  '%${receivingUintName}%'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  value_flag = #{valueFlag}
-    </if>
-    <if test="isPreScale != null and isPreScale != ''">
-      and  is_pre_scale = #{isPreScale}
-    </if>
-    order by create_time desc
-  </select>
-
-  <update id="repairPre" parameterType="java.util.HashMap">
-    update METER_WORK_CAR_ACTUAL_FIRST set PREDICTION_NO = #{predictionNo} where ACTUAL_FIRST_NO = #{actualFirstNo}
-  </update>
-
-  <select id="selectById" parameterType="java.util.List" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where ACTUAL_FIRST_NO in
-    <foreach collection="list" item="item" separator="," open="(" close=")">
-      #{item}
-    </foreach>
-  </select>
-
-  <select id="likeByDesc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-    <!--App特殊条件查询,查询不能为作废、已结净数据-->
-    <if test="flag != null and flag != ''">
-      and (value_flag in ('1', '3')
-      or (
-      value_flag = '2'
-      and (is_pre_scale = '0' or is_pre_scale is null)
-      ))
-    </if>
-    <if test="carTypeNo != null and carTypeNo != ''">
-      and car_no in (
-      select distinct car_no
-      from meter_base_car where 1 = 1
-      and car_type_no = #{carTypeNo}
-      and valid_flag = '0'
-      )
-    </if>
-    <if test="groupId != null and groupId != ''">
-      and BASE_SPOT_NO in (SELECT METER_BASE_GROUP_SPOT.SPOT_ID FROM METER_BASE_GROUP_SPOT WHERE METER_BASE_GROUP_SPOT.GROUP_ID = #{groupId})
-    </if>
-    <!-- 计量点复选功能 -->
-    <if test="baseSpotNoStr != null and baseSpotNoStr != ''">
-      and base_spot_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="baseSpotNames != null and baseSpotNames.size() != 0">
-      and BASE_SPOT_NAME in
-      <foreach collection="baseSpotNames" item="id" open="(" close=")" separator=",">
-        #{id}
-      </foreach>
-    </if>
-    order by create_time desc
-  </select>
-
-  <select id="queryForTimeInterval" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    WHERE CAR_NO = #{carNo}
-    AND VALUE_FLAG != '0'
-    ORDER BY CREATE_TIME DESC
-    FETCH FIRST 1 ROW ONLY
-    <!--App特殊条件查询,查询不能为作废、已结净数据-->
-  </select>
-
-  <select id="ApplikeByDesc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
-    <!--已结净且未匹配委托-->
-    <if test="flag != null and flag != ''">
-      and (value_flag = '2'
-      and (is_pre_scale = '0' or is_pre_scale is null))
-    </if>
-    order by create_time desc
-  </select>
-
-  <select id="countFirstByCar" parameterType="java.util.HashMap" resultType="Integer">
-    select count(1) from meter_work_car_actual_first
-    where value_flag in ('1', '2')
-    and car_no like '%${carNo}%'
-    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-      and  create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-  </select>
-
-  <!--根据时间查询所有秤点的一次毛重、一次皮重、一次期限皮、一次有效、一次作废-->
-  <select id="countAllState" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where 1 = 1
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  base_spot_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  base_spot_name like '%${baseSpotName}%'
-    </if>
-    <if test="netSpot3NoStr != null and netSpot3NoStr != ''">
-      and base_spot_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-  </select>
-
-  <!--根据时间查询所有秤点的一次毛重、一次皮重、一次期限皮、一次有效、一次作废-->
-  <select id="allStateView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where 1 = 1
-    <if test="carNo != null and carNo != ''">
-      and car_no like '%${carNo}%'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and value_flag = #{valueFlag}
-    </if>
-    <if test="valueFlag == null or valueFlag == ''">
-      and value_flag != '0'
-    </if>
-    <if test="weightType != null and weightType != ''">
-      and weight_type = #{weightType}
-    </if>
-    <if test="flag != null and flag != ''">
-      and weight_type is null
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  base_spot_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  base_spot_name like '%${baseSpotName}%'
-    </if>
-  </select>
-
-  <select id="carFirstDataDetail" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    SELECT <include refid="columns_alias"/> FROM METER_WORK_CAR_ACTUAL_FIRST t
-    where 1 = 1
-    <if test="validFlag != null and validFlag != ''">
-      and  t.value_flag != '0'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  t.value_flag = #{valueFlag}
-    </if>
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  t.create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and t.create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    order by t.create_time desc
-  </select>
-
-  <select id="countDayAllState" parameterType="java.util.HashMap" resultType="hashmap">
-    select A.base_spot_no,
-    A.base_spot_name,
-    A.create_man_no,
-    A.create_man_name,
-    count(1) count_first
-    from meter_work_car_actual_first A
-    left join pre_track_scale B
-    on A.prediction_no = B.prediction_no
-    where 1 = 1
-    <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
-      and  A.create_time  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and A.create_time  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
-    </if>
-    <if test="netSpot3NoStr != null and netSpot3NoStr != ''">
-      and A.base_spot_no in
-      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="createManNoStr != null and createManNoStr != ''">
-      and A.create_man_no in
-      <foreach collection="manNoStr" item="item" open="(" separator="," close=")">
-        #{item}
-      </foreach>
-    </if>
-    <if test="baseSpotNo != null and baseSpotNo != ''">
-      and  A.base_spot_no like '%${baseSpotNo}%'
-    </if>
-    <if test="baseSpotName != null and baseSpotName != ''">
-      and  A.base_spot_name like '%${baseSpotName}%'
-    </if>
-    <if test="validFlag != null and validFlag != ''">
-      and  A.value_flag != '0'
-    </if>
-    <if test="valueFlag != null and valueFlag != ''">
-      and  A.value_flag = #{valueFlag}
-    </if>
-    group by A.base_spot_no,
-    A.base_spot_name,
-    A.create_man_no,
-    A.create_man_name
-  </select>
-    <update id="abolishCSharp">
-    UPDATE METER_WORK_RAILWAY_ACT_FIRST
-    SET VALUE_FLAG = '2',
-        UPDATE_MAN_NO = #{userId},
-        UPDATE_MAN_NAME = #{userName}
-    WHERE
-      RAILWAY_NO LIKE '%${railwayNo}'
-      AND CREATE_TIME BETWEEN TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss' )
-      AND TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss' )
-      AND BASE_SPOT_NO IN ( 'JT0062', 'JT0063', 'JT0064', 'JT0065', 'JT0066', 'JT0061', 'DTTX1' )
-      AND VALUE_FLAG = '1'
-      AND IS_PRE_SACALE = '0'
-  </update>
   <select id="selectRule1PredictionNos"  resultType="java.lang.String">
     SELECT FIRST.ACTUAL_FIRST_NO
     FROM METER_WORK_CAR_ACTUAL_FIRST FIRST
@@ -3398,7 +2763,7 @@ FETCH FIRST 20 ROWS ONLY
       )
       FETCH FIRST 20 ROWS ONLY
   </select>
-  <update id="updateFirstByRule1">
+    <update id="updateFirstByRule1">
     UPDATE METER_WORK_CAR_ACTUAL_FIRST f
     SET f.VALUE_FLAG = '2',
         f.UPDATE_TIME = SYSDATE,
@@ -3478,4 +2843,43 @@ FETCH FIRST 20 ROWS ONLY
       WHERE a.PREDICTION_NO = f.PREDICTION_NO
     )
   </update>
+  <select id="selectReActualFirstNoMap" resultType="java.util.Map">
+    SELECT
+      TO_CHAR( CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS' ) AS createTimeSec,
+      PREDICTION_NO AS predictionNo,
+      CAR_NO AS carNo,
+      BASE_SPOT_NO AS baseSpotNo,
+      METER_WEIGHT AS meterWeight,
+      listagg(ACTUAL_FIRST_NO,',') AS actualFirstNos,
+      COUNT( 1 ) AS count
+    FROM
+      METER_WORK_CAR_ACTUAL_FIRST
+    WHERE
+      VALUE_FLAG != '0'
+      AND CREATE_TIME >= SYSDATE - 3
+      AND PREDICTION_NO IS NOT NULL
+      AND FORWARDING_UNIT_NO IS NOT NULL
+      AND RECEIVING_UINT_NO IS NOT NULL
+    GROUP BY
+      TO_CHAR( CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS' ),
+      PREDICTION_NO,
+      CAR_NO,
+      BASE_SPOT_NO,
+      METER_WEIGHT,
+      PREDICTION_NO,
+      FORWARDING_UNIT_NO,
+      RECEIVING_UINT_NO
+    HAVING
+      COUNT( 1 ) > 1
+  </select>
+  <select id="selectReActualNoMap" resultType="java.util.Map">
+
+  </select>
+  <select id="selectDuplicateFirstGroups" resultType="com.steerinfo.abnormalHandler.dto.DuplicateFirstGroup">
+
+  </select>
+  <select id="selectFirstRecordsByGroup" resultType="com.steerinfo.abnormalHandler.dto.FirstRecord"></select>
+  <select id="countActualBoundByFirstNo" resultType="java.lang.Integer"></select>
+  <update id="invalidateFirstRecord"></update>
+
 </mapper>

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkmonitor/mapper/MeterWorkMonitorMapper.java

@@ -24,4 +24,6 @@ public interface MeterWorkMonitorMapper extends IBaseMapper<MeterWorkMonitor, St
 
     List<MeterWorkMonitor> weightByCarNo(HashMap<String, Object> map);
     List<MeterWorkMonitor> monitorLeftJoinUserSpotConfig(HashMap<String, Object> map);
+
+    int updateByPrimaryKeyCopy(MeterWorkMonitor row);
 }

+ 68 - 0
src/main/java/com/steerinfo/meterwork/meterworkmonitor/mapper/MeterWorkMonitorMapper.xml

@@ -2182,4 +2182,72 @@
             on A.point_no = B.base_spot_no
     <include refid="where" />
   </select>
+  <update id="updateByPrimaryKeyCopy" parameterType="com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor">
+    update METER_WORK_MONITOR
+    set
+        VALID_WGT = #{validWgt,jdbcType=VARCHAR},
+        VALID_CARNO = #{validCarno,jdbcType=VARCHAR},
+        VALID_TARE_TIME = #{validTareTime,jdbcType=VARCHAR},
+        VALID_TIME_INTERVAL = #{validTimeInterval,jdbcType=VARCHAR},
+        VALID_PARK_STATUS = #{validParkStatus,jdbcType=VARCHAR},
+        VALID_EXCEED_WGT = #{validExceedWgt,jdbcType=VARCHAR},
+        VALID_PREDICTION_DIFF = #{validPredictionDiff,jdbcType=VARCHAR},
+        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
+        VALID_MAT_TIME = #{validMatTime,jdbcType=VARCHAR},
+        CAR_MONITOR = #{carMonitor,jdbcType=VARCHAR},
+        CAR_MONITOR_LVL = #{carMonitorLvl,jdbcType=DECIMAL},
+        IS_HELP = #{isHelp,jdbcType=VARCHAR},
+        IS_TAKE_OVER = #{isTakeOver,jdbcType=VARCHAR},
+        LED_WRITER = #{ledWriter,jdbcType=VARCHAR},
+        PRINT_NUM = #{printNum,jdbcType=DECIMAL},
+        COLLECTION_CODE = #{collectionCode,jdbcType=VARCHAR},
+        IS_OVER_WGT = #{isOverWgt,jdbcType=VARCHAR},
+        USER_NO = #{userNo,jdbcType=VARCHAR},
+        MONITOR_USER_NO = #{monitorUserNo,jdbcType=VARCHAR},
+        SET_CAR = #{setCar,jdbcType=VARCHAR},
+        LED_KEEP = #{ledKeep,jdbcType=VARCHAR},
+        RFID_CAR = #{rfidCar,jdbcType=VARCHAR},
+        PHOTO_CAR = #{photoCar,jdbcType=VARCHAR},
+        SCAN_CAR = #{scanCar,jdbcType=VARCHAR},
+        EDIT_CAR = #{editCar,jdbcType=VARCHAR},
+        CAR_ERR = #{carErr,jdbcType=VARCHAR},
+        WGT_ERR = #{wgtErr,jdbcType=VARCHAR},
+        LAST_TIME = #{lastTime,jdbcType=TIMESTAMP},
+        STOP_OVER_TIME = #{stopOverTime,jdbcType=VARCHAR},
+        MSG_INFO = #{msgInfo,jdbcType=VARCHAR},
+        WGT = #{wgt,jdbcType=DECIMAL},
+        IS_REMOTE = #{isRemote,jdbcType=VARCHAR},
+        WEIGH_INSTRUMENT_MODEL = #{weighInstrumentModel,jdbcType=VARCHAR},
+        WEIGH_INSTRUMENT_PARAM = #{weighInstrumentParam,jdbcType=VARCHAR},
+        MOXA_IP = #{moxaIp,jdbcType=VARCHAR},
+        MOXA_PORT = #{moxaPort,jdbcType=VARCHAR},
+        VALID_LIANDA = #{validLianda,jdbcType=VARCHAR},
+        IS_OPEN_SCANNING = #{isOpenScanning,jdbcType=VARCHAR},
+        VALID_IS_PRE = #{validIsPre,jdbcType=VARCHAR},
+        USER_IP = #{userIp,jdbcType=VARCHAR},
+        POWER_STATE = #{powerState,jdbcType=VARCHAR},
+        DVR_STATE = #{dvrState,jdbcType=VARCHAR},
+        MOXA_STATE = #{moxaState,jdbcType=VARCHAR},
+        PLC_STATE = #{plcState,jdbcType=VARCHAR},
+        LEFT_INFRARED_RAY_STATE = #{leftInfraredRayState,jdbcType=VARCHAR},
+        RIGHT_INFRARED_RAY_STATE = #{rightInfraredRayState,jdbcType=VARCHAR},
+        AMPLIFIER_STATE = #{amplifierState,jdbcType=VARCHAR},
+        LAMP_STATE = #{lampState,jdbcType=VARCHAR},
+        SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
+        RED_GREEN_LIGHT_STATE = #{redGreenLightState,jdbcType=VARCHAR},
+        FRONT_INFRARED_RAY_STATE = #{frontInfraredRayState,jdbcType=VARCHAR},
+        REAR_INFRARED_RAY_STATE = #{rearInfraredRayState,jdbcType=VARCHAR},
+        RFID_STATE = #{rfidState,jdbcType=VARCHAR},
+        VALID_AREA = #{validArea,jdbcType=VARCHAR},
+        WEIGHT_STATUS = #{weightStatus,jdbcType=VARCHAR},
+        FERROALLOY_CONFIRM = #{ferroalloyConfirm,jdbcType=VARCHAR},
+        FERROALLOY_RESULT = #{ferroalloyResult,jdbcType=VARCHAR},
+        ZERO_STATE = #{zeroState,jdbcType=VARCHAR},
+        ZERO_WEIGHT = #{zeroWeight,jdbcType=DECIMAL},
+        IS_ZERO_STATE = #{isZeroState,jdbcType=VARCHAR},
+        IS_VALID_SCAN = #{isValidScan,jdbcType=VARCHAR},
+        IS_ENABLE_SOUND = #{isEnableSound,jdbcType=VARCHAR},
+        PHOTO_CAR2 = #{photoCar2,jdbcType=VARCHAR}
+    where POINT_NO = #{pointNo,jdbcType=VARCHAR}
+  </update>
 </mapper>

+ 0 - 67
src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorRtdbBootstrap.java

@@ -1,67 +0,0 @@
-package com.steerinfo.meterwork.meterworkmonitor.rtdb;
-
-import com.steerinfo.meterwork.meterworkmonitor.mapper.MeterWorkMonitorMapper;
-import com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor;
-import com.steerinfo.meterwork.rtdb.RtdbPoolProperties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * 冷启动:Oracle → Tarantool 全量灌数(_dirty=false)。
- */
-@Component
-@Order(100)
-@ConditionalOnExpression("'${rtdb.monitor.enabled:true}' == 'true' && '${rtdb.monitor.bootstrap-enabled:false}' == 'true'")
-public class MeterWorkMonitorRtdbBootstrap implements ApplicationRunner {
-
-    private static final Logger log = LoggerFactory.getLogger(MeterWorkMonitorRtdbBootstrap.class);
-
-    @Resource
-    private MeterWorkMonitorMapper meterWorkMonitorMapper;
-
-    @Resource
-    private MeterWorkMonitorRtdbRepository meterWorkMonitorRtdbRepository;
-
-    @Resource
-    private RtdbPoolProperties rtdbPoolProperties;
-
-    @Override
-    public void run(ApplicationArguments args) {
-        if (rtdbPoolProperties == null || !rtdbPoolProperties.getMonitor().isBootstrapEnabled()) {
-            return;
-        }
-        long start = System.currentTimeMillis();
-        int ok = 0;
-        int fail = 0;
-        try {
-            List<MeterWorkMonitor> rows = meterWorkMonitorMapper.selectByParameters(new HashMap<String, Object>());
-            log.info("METER_WORK_MONITOR bootstrap start, oracleRows={}", rows == null ? 0 : rows.size());
-            if (rows == null) {
-                return;
-            }
-            for (MeterWorkMonitor row : rows) {
-                try {
-                    meterWorkMonitorRtdbRepository.replace(row, false);
-                    ok++;
-                } catch (Exception e) {
-                    fail++;
-                    log.error("bootstrap replace failed, pointNo={}", row.getPointNo(), e);
-                }
-            }
-        } catch (Exception e) {
-            log.error("METER_WORK_MONITOR bootstrap failed", e);
-        } finally {
-            log.info("METER_WORK_MONITOR bootstrap done, ok={}, fail={}, costMs={}",
-                    ok, fail, System.currentTimeMillis() - start);
-        }
-    }
-}

+ 0 - 219
src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorRtdbRepository.java

@@ -1,219 +0,0 @@
-package com.steerinfo.meterwork.meterworkmonitor.rtdb;
-
-import com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor;
-import com.steerinfo.meterwork.rtdb.RtdbClientPool;
-import com.steerinfo.rtdb.Client;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Repository;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * METER_WORK_MONITOR Tarantool 访问封装。
- */
-@Repository
-@ConditionalOnProperty(name = "rtdb.monitor.enabled", havingValue = "true", matchIfMissing = true)
-public class MeterWorkMonitorRtdbRepository {
-
-    private static final Logger log = LoggerFactory.getLogger(MeterWorkMonitorRtdbRepository.class);
-
-    private static final String SPACE_GET = "db.space.METER_WORK_MONITOR:get";
-    private static final String SPACE_REPLACE = "db.space.METER_WORK_MONITOR:replace";
-    private static final String SPACE_UPDATE = "db.space.METER_WORK_MONITOR:update";
-    private static final String SPACE_SELECT = "db.space.METER_WORK_MONITOR:select";
-    private static final String DIRTY_SELECT = "db.space.METER_WORK_MONITOR.index.dirty:select";
-
-    private final RtdbClientPool pool;
-
-    public MeterWorkMonitorRtdbRepository(RtdbClientPool pool) {
-        this.pool = pool;
-    }
-
-    public MeterWorkMonitor getByPointNo(String pointNo) {
-        long start = System.currentTimeMillis();
-        MeterWorkMonitor result = pool.execute(client -> {
-            List<?> raw = callResult(client, SPACE_GET, pointNo);
-            List<?> tuple = unwrapTuple(raw);
-            return MeterWorkMonitorTupleCodec.fromTuple(tuple);
-        });
-        log.debug("[MonitorRTDB] tarantool get pointNo={} hit={} costMs={}",
-                pointNo, result != null && result.getPointNo() != null, System.currentTimeMillis() - start);
-        return result;
-    }
-
-    public void replace(MeterWorkMonitor model, boolean dirty) {
-        long start = System.currentTimeMillis();
-        String pointNo = model == null ? null : model.getPointNo();
-        List<Object> tuple = MeterWorkMonitorTupleCodec.toTuple(model, dirty);
-        try {
-            pool.execute(client -> {
-                client.syncOps().call(SPACE_REPLACE, tuple);
-                return null;
-            });
-            log.info("[MonitorRTDB] tarantool replace ok pointNo={} dirty={} tupleSize={} costMs={}",
-                    pointNo, dirty, tuple.size(), System.currentTimeMillis() - start);
-        } catch (RuntimeException e) {
-            log.error("[MonitorRTDB] tarantool replace fail pointNo={} dirty={} costMs={}",
-                    pointNo, dirty, System.currentTimeMillis() - start, e);
-            throw e;
-        }
-    }
-
-    public void updateLastTime(String pointNo, long lastTimeMs) {
-        long start = System.currentTimeMillis();
-        List<List<?>> ops = Arrays.asList(
-                Arrays.asList("=", MeterWorkMonitorTupleCodec.IDX_LAST_TIME, lastTimeMs),
-                Arrays.asList("=", MeterWorkMonitorTupleCodec.IDX_DIRTY, true),
-                Arrays.asList("=", MeterWorkMonitorTupleCodec.IDX_UPDATED_AT, System.currentTimeMillis())
-        );
-        try {
-            pool.execute(client -> {
-                client.syncOps().call(SPACE_UPDATE, pointNo, ops);
-                return null;
-            });
-            log.info("[MonitorRTDB] tarantool update LAST_TIME ok pointNo={} lastTimeMs={} costMs={}",
-                    pointNo, lastTimeMs, System.currentTimeMillis() - start);
-        } catch (RuntimeException e) {
-            log.error("[MonitorRTDB] tarantool update LAST_TIME fail pointNo={} lastTimeMs={} costMs={}",
-                    pointNo, lastTimeMs, System.currentTimeMillis() - start, e);
-            throw e;
-        }
-    }
-
-    public void clearDirty(String pointNo) {
-        List<List<?>> ops = Arrays.asList(
-                Arrays.asList("=", MeterWorkMonitorTupleCodec.IDX_DIRTY, false),
-                Arrays.asList("=", MeterWorkMonitorTupleCodec.IDX_UPDATED_AT, System.currentTimeMillis())
-        );
-        pool.execute(client -> {
-            client.syncOps().call(SPACE_UPDATE, pointNo, ops);
-            return null;
-        });
-    }
-
-    public List<MeterWorkMonitor> selectDirty() {
-        return pool.execute(client -> {
-            List<?> raw;
-            try {
-                raw = callResult(client, DIRTY_SELECT, true);
-            } catch (Exception e) {
-                log.warn("dirty index select failed, fallback full select: {}", e.getMessage());
-                raw = callResult(client, SPACE_SELECT);
-            }
-            List<List<?>> tuples = unwrapTupleList(raw);
-            List<MeterWorkMonitor> result = new ArrayList<>();
-            for (List<?> tuple : tuples) {
-                if (MeterWorkMonitorTupleCodec.isDirty(tuple)) {
-                    MeterWorkMonitor m = MeterWorkMonitorTupleCodec.fromTuple(tuple);
-                    if (m != null && m.getPointNo() != null) {
-                        result.add(m);
-                    }
-                }
-            }
-            return result;
-        });
-    }
-
-    public List<MeterWorkMonitor> selectAll() {
-        return pool.execute(client -> {
-            List<?> raw = callResult(client, SPACE_SELECT);
-            List<List<?>> tuples = unwrapTupleList(raw);
-            List<MeterWorkMonitor> result = new ArrayList<>();
-            for (List<?> tuple : tuples) {
-                MeterWorkMonitor m = MeterWorkMonitorTupleCodec.fromTuple(tuple);
-                if (m != null && m.getPointNo() != null) {
-                    result.add(m);
-                }
-            }
-            return result;
-        });
-    }
-
-    @SuppressWarnings("unchecked")
-    private static List<?> callResult(Client client, String function, Object... args) {
-        Object res = client.syncOps().call(function, args);
-        if (res instanceof List) {
-            return (List<?>) res;
-        }
-        return Collections.emptyList();
-    }
-
-    /**
-     * call 返回通常为 [tuple] 或 [ [tuples...] ],兼容多种包装。
-     */
-    @SuppressWarnings("unchecked")
-    private static List<?> unwrapTuple(List<?> raw) {
-        if (raw == null || raw.isEmpty()) {
-            return null;
-        }
-        Object first = raw.get(0);
-        if (first == null) {
-            return null;
-        }
-        if (first instanceof List) {
-            List<?> inner = (List<?>) first;
-            // get 返回单行:可能是字段 list,也可能再包一层
-            if (!inner.isEmpty() && !(inner.get(0) instanceof List) && inner.size() >= 1) {
-                // 可能是 tuple 本身(首字段为 POINT_NO string)
-                if (inner.get(0) instanceof String || inner.get(0) instanceof Number || inner.get(0) instanceof Boolean) {
-                    return inner;
-                }
-            }
-            if (!inner.isEmpty() && inner.get(0) instanceof List) {
-                return (List<?>) inner.get(0);
-            }
-            return inner;
-        }
-        return null;
-    }
-
-    @SuppressWarnings("unchecked")
-    private static List<List<?>> unwrapTupleList(List<?> raw) {
-        List<List<?>> out = new ArrayList<>();
-        if (raw == null || raw.isEmpty()) {
-            return out;
-        }
-        Object first = raw.get(0);
-        if (!(first instanceof List)) {
-            return out;
-        }
-        List<?> level1 = (List<?>) first;
-        if (level1.isEmpty()) {
-            return out;
-        }
-        // select 返回 [[tuple1],[tuple2],...] 或 [tuple1, tuple2, ...]
-        if (level1.get(0) instanceof List) {
-            Object maybeField = ((List<?>) level1.get(0)).isEmpty() ? null : ((List<?>) level1.get(0)).get(0);
-            // 若内层首元素仍是 List,则 level1 是 tuple 列表
-            if (maybeField instanceof List) {
-                for (Object o : level1) {
-                    if (o instanceof List) {
-                        out.add((List<?>) o);
-                    }
-                }
-                return out;
-            }
-            // level1.get(0) 是 tuple(字段为标量)→ level1 即多行
-            for (Object o : level1) {
-                if (o instanceof List) {
-                    List<?> row = (List<?>) o;
-                    if (!row.isEmpty() && !(row.get(0) instanceof List)) {
-                        out.add(row);
-                    } else if (!row.isEmpty() && row.get(0) instanceof List) {
-                        out.add((List<?>) row.get(0));
-                    }
-                }
-            }
-            return out;
-        }
-        // 单行字段 list
-        out.add(level1);
-        return out;
-    }
-}

+ 0 - 446
src/main/java/com/steerinfo/meterwork/meterworkmonitor/rtdb/MeterWorkMonitorTupleCodec.java

@@ -1,446 +0,0 @@
-package com.steerinfo.meterwork.meterworkmonitor.rtdb;
-
-import com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * MeterWorkMonitor ↔ Tarantool tuple(65 业务字段 + _dirty + _updated_at)。
- * 与线上 space format 对齐:66=_dirty(boolean), 67=_updated_at(number)。
- */
-public final class MeterWorkMonitorTupleCodec {
-
-    public static final int FIELD_COUNT = 67;
-    public static final int IDX_POINT_NO = 1;
-    public static final int IDX_LAST_TIME = 30;
-    /** 1-based Tarantool field no */
-    public static final int IDX_DIRTY = 66;
-    /** 1-based Tarantool field no */
-    public static final int IDX_UPDATED_AT = 67;
-
-    private MeterWorkMonitorTupleCodec() {
-    }
-
-    public static List<Object> toTuple(MeterWorkMonitor m, boolean dirty) {
-        List<Object> t = new ArrayList<>(FIELD_COUNT);
-        t.add(nullToEmpty(m.getPointNo()));
-        t.add(nullToEmpty(m.getPointName()));
-        t.add(nullToEmpty(m.getValidWgt()));
-        t.add(nullToEmpty(m.getValidCarno()));
-        t.add(nullToEmpty(m.getValidTareTime()));
-        t.add(nullToEmpty(m.getValidTimeInterval()));
-        t.add(nullToEmpty(m.getValidParkStatus()));
-        t.add(nullToEmpty(m.getValidExceedWgt()));
-        t.add(nullToEmpty(m.getValidPredictionDiff()));
-        t.add(nullToEmpty(m.getValidFlag()));
-        t.add(nullToEmpty(m.getValidMatTime()));
-        t.add(nullToEmpty(m.getCarMonitor()));
-        t.add(numOrZero(m.getCarMonitorLvl()));
-        t.add(nullToEmpty(m.getIsHelp()));
-        t.add(nullToEmpty(m.getIsTakeOver()));
-        t.add(nullToEmpty(m.getLedWriter()));
-        t.add(numOrZero(m.getPrintNum()));
-        t.add(nullToEmpty(m.getCollectionCode()));
-        t.add(nullToEmpty(m.getIsOverWgt()));
-        t.add(nullToEmpty(m.getUserNo()));
-        t.add(nullToEmpty(m.getMonitorUserNo()));
-        t.add(nullToEmpty(m.getSetCar()));
-        t.add(nullToEmpty(m.getLedKeep()));
-        t.add(nullToEmpty(m.getRfidCar()));
-        t.add(nullToEmpty(m.getPhotoCar()));
-        t.add(nullToEmpty(m.getScanCar()));
-        t.add(nullToEmpty(m.getEditCar()));
-        t.add(nullToEmpty(m.getCarErr()));
-        t.add(nullToEmpty(m.getWgtErr()));
-        t.add(dateToEpoch(m.getLastTime()));
-        t.add(nullToEmpty(m.getStopOverTime()));
-        t.add(nullToEmpty(m.getMsgInfo()));
-        t.add(m.getWgt() == null ? 0L : m.getWgt());
-        t.add(nullToEmpty(m.getIsRemote()));
-        t.add(nullToEmpty(m.getWeighInstrumentModel()));
-        t.add(nullToEmpty(m.getWeighInstrumentParam()));
-        t.add(nullToEmpty(m.getMoxaIp()));
-        t.add(nullToEmpty(m.getMoxaPort()));
-        t.add(nullToEmpty(m.getValidLianda()));
-        t.add(nullToEmpty(m.getIsOpenScanning()));
-        t.add(nullToEmpty(m.getValidIsPre()));
-        t.add(nullToEmpty(m.getUserIp()));
-        t.add(nullToEmpty(m.getPowerState()));
-        t.add(nullToEmpty(m.getDvrState()));
-        t.add(nullToEmpty(m.getMoxaState()));
-        t.add(nullToEmpty(m.getPlcState()));
-        t.add(nullToEmpty(m.getLeftInfraredRayState()));
-        t.add(nullToEmpty(m.getRightInfraredRayState()));
-        t.add(nullToEmpty(m.getAmplifierState()));
-        t.add(nullToEmpty(m.getLampState()));
-        t.add(nullToEmpty(m.getSpotTypeNo()));
-        t.add(nullToEmpty(m.getRedGreenLightState()));
-        t.add(nullToEmpty(m.getFrontInfraredRayState()));
-        t.add(nullToEmpty(m.getRearInfraredRayState()));
-        t.add(nullToEmpty(m.getRfidState()));
-        t.add(nullToEmpty(m.getValidArea()));
-        t.add(nullToEmpty(m.getWeightStatus()));
-        t.add(nullToEmpty(m.getFerroalloyConfirm()));
-        t.add(nullToEmpty(m.getFerroalloyResult()));
-        t.add(nullToEmpty(m.getZeroState()));
-        t.add(numOrZero(m.getZeroWeight()));
-        t.add(nullToEmpty(m.getIsZeroState()));
-        t.add(nullToEmpty(m.getIsValidScan()));
-        t.add(nullToEmpty(m.getIsEnableSound()));
-        t.add(nullToEmpty(m.getPhotoCar2()));
-        t.add(dirty);
-        t.add(System.currentTimeMillis());
-        return t;
-    }
-
-    public static MeterWorkMonitor fromTuple(List<?> t) {
-        if (t == null || t.isEmpty()) {
-            return null;
-        }
-        MeterWorkMonitor m = new MeterWorkMonitor();
-        m.setPointNo(asString(t, 0));
-        m.setPointName(asString(t, 1));
-        m.setValidWgt(asString(t, 2));
-        m.setValidCarno(asString(t, 3));
-        m.setValidTareTime(asString(t, 4));
-        m.setValidTimeInterval(asString(t, 5));
-        m.setValidParkStatus(asString(t, 6));
-        m.setValidExceedWgt(asString(t, 7));
-        m.setValidPredictionDiff(asString(t, 8));
-        m.setValidFlag(asString(t, 9));
-        m.setValidMatTime(asString(t, 10));
-        m.setCarMonitor(asString(t, 11));
-        m.setCarMonitorLvl(asShort(t, 12));
-        m.setIsHelp(asString(t, 13));
-        m.setIsTakeOver(asString(t, 14));
-        m.setLedWriter(asString(t, 15));
-        m.setPrintNum(asShort(t, 16));
-        m.setCollectionCode(asString(t, 17));
-        m.setIsOverWgt(asString(t, 18));
-        m.setUserNo(asString(t, 19));
-        m.setMonitorUserNo(asString(t, 20));
-        m.setSetCar(asString(t, 21));
-        m.setLedKeep(asString(t, 22));
-        m.setRfidCar(asString(t, 23));
-        m.setPhotoCar(asString(t, 24));
-        m.setScanCar(asString(t, 25));
-        m.setEditCar(asString(t, 26));
-        m.setCarErr(asString(t, 27));
-        m.setWgtErr(asString(t, 28));
-        m.setLastTime(asDate(t, 29));
-        m.setStopOverTime(asString(t, 30));
-        m.setMsgInfo(asString(t, 31));
-        m.setWgt(asLong(t, 32));
-        m.setIsRemote(asString(t, 33));
-        m.setWeighInstrumentModel(asString(t, 34));
-        m.setWeighInstrumentParam(asString(t, 35));
-        m.setMoxaIp(asString(t, 36));
-        m.setMoxaPort(asString(t, 37));
-        m.setValidLianda(asString(t, 38));
-        m.setIsOpenScanning(asString(t, 39));
-        m.setValidIsPre(asString(t, 40));
-        m.setUserIp(asString(t, 41));
-        m.setPowerState(asString(t, 42));
-        m.setDvrState(asString(t, 43));
-        m.setMoxaState(asString(t, 44));
-        m.setPlcState(asString(t, 45));
-        m.setLeftInfraredRayState(asString(t, 46));
-        m.setRightInfraredRayState(asString(t, 47));
-        m.setAmplifierState(asString(t, 48));
-        m.setLampState(asString(t, 49));
-        m.setSpotTypeNo(asString(t, 50));
-        m.setRedGreenLightState(asString(t, 51));
-        m.setFrontInfraredRayState(asString(t, 52));
-        m.setRearInfraredRayState(asString(t, 53));
-        m.setRfidState(asString(t, 54));
-        m.setValidArea(asString(t, 55));
-        m.setWeightStatus(asString(t, 56));
-        m.setFerroalloyConfirm(asString(t, 57));
-        m.setFerroalloyResult(asString(t, 58));
-        m.setZeroState(asString(t, 59));
-        m.setZeroWeight(asShort(t, 60));
-        m.setIsZeroState(asString(t, 61));
-        m.setIsValidScan(asString(t, 62));
-        m.setIsEnableSound(asString(t, 63));
-        m.setPhotoCar2(asString(t, 64));
-        return m;
-    }
-
-    public static boolean isDirty(List<?> t) {
-        if (t == null || t.size() < IDX_DIRTY) {
-            return false;
-        }
-        Object v = t.get(IDX_DIRTY - 1);
-        return Boolean.TRUE.equals(v) || "true".equalsIgnoreCase(String.valueOf(v));
-    }
-
-    /**
-     * 将 patch 中非空字段合并到 base(selective update 语义)。
-     */
-    public static void mergeNonNull(MeterWorkMonitor base, MeterWorkMonitor patch) {
-        if (patch.getPointName() != null) {
-            base.setPointName(patch.getPointName());
-        }
-        if (patch.getValidWgt() != null) {
-            base.setValidWgt(patch.getValidWgt());
-        }
-        if (patch.getValidCarno() != null) {
-            base.setValidCarno(patch.getValidCarno());
-        }
-        if (patch.getValidTareTime() != null) {
-            base.setValidTareTime(patch.getValidTareTime());
-        }
-        if (patch.getValidTimeInterval() != null) {
-            base.setValidTimeInterval(patch.getValidTimeInterval());
-        }
-        if (patch.getValidParkStatus() != null) {
-            base.setValidParkStatus(patch.getValidParkStatus());
-        }
-        if (patch.getValidExceedWgt() != null) {
-            base.setValidExceedWgt(patch.getValidExceedWgt());
-        }
-        if (patch.getValidPredictionDiff() != null) {
-            base.setValidPredictionDiff(patch.getValidPredictionDiff());
-        }
-        if (patch.getValidFlag() != null) {
-            base.setValidFlag(patch.getValidFlag());
-        }
-        if (patch.getValidMatTime() != null) {
-            base.setValidMatTime(patch.getValidMatTime());
-        }
-        if (patch.getCarMonitor() != null) {
-            base.setCarMonitor(patch.getCarMonitor());
-        }
-        if (patch.getCarMonitorLvl() != null) {
-            base.setCarMonitorLvl(patch.getCarMonitorLvl());
-        }
-        if (patch.getIsHelp() != null) {
-            base.setIsHelp(patch.getIsHelp());
-        }
-        if (patch.getIsTakeOver() != null) {
-            base.setIsTakeOver(patch.getIsTakeOver());
-        }
-        if (patch.getLedWriter() != null) {
-            base.setLedWriter(patch.getLedWriter());
-        }
-        if (patch.getPrintNum() != null) {
-            base.setPrintNum(patch.getPrintNum());
-        }
-        if (patch.getCollectionCode() != null) {
-            base.setCollectionCode(patch.getCollectionCode());
-        }
-        if (patch.getIsOverWgt() != null) {
-            base.setIsOverWgt(patch.getIsOverWgt());
-        }
-        if (patch.getUserNo() != null) {
-            base.setUserNo(patch.getUserNo());
-        }
-        if (patch.getMonitorUserNo() != null) {
-            base.setMonitorUserNo(patch.getMonitorUserNo());
-        }
-        if (patch.getSetCar() != null) {
-            base.setSetCar(patch.getSetCar());
-        }
-        if (patch.getLedKeep() != null) {
-            base.setLedKeep(patch.getLedKeep());
-        }
-        if (patch.getRfidCar() != null) {
-            base.setRfidCar(patch.getRfidCar());
-        }
-        if (patch.getPhotoCar() != null) {
-            base.setPhotoCar(patch.getPhotoCar());
-        }
-        if (patch.getScanCar() != null) {
-            base.setScanCar(patch.getScanCar());
-        }
-        if (patch.getEditCar() != null) {
-            base.setEditCar(patch.getEditCar());
-        }
-        if (patch.getCarErr() != null) {
-            base.setCarErr(patch.getCarErr());
-        }
-        if (patch.getWgtErr() != null) {
-            base.setWgtErr(patch.getWgtErr());
-        }
-        if (patch.getLastTime() != null) {
-            base.setLastTime(patch.getLastTime());
-        }
-        if (patch.getStopOverTime() != null) {
-            base.setStopOverTime(patch.getStopOverTime());
-        }
-        if (patch.getMsgInfo() != null) {
-            base.setMsgInfo(patch.getMsgInfo());
-        }
-        if (patch.getWgt() != null) {
-            base.setWgt(patch.getWgt());
-        }
-        if (patch.getIsRemote() != null) {
-            base.setIsRemote(patch.getIsRemote());
-        }
-        if (patch.getWeighInstrumentModel() != null) {
-            base.setWeighInstrumentModel(patch.getWeighInstrumentModel());
-        }
-        if (patch.getWeighInstrumentParam() != null) {
-            base.setWeighInstrumentParam(patch.getWeighInstrumentParam());
-        }
-        if (patch.getMoxaIp() != null) {
-            base.setMoxaIp(patch.getMoxaIp());
-        }
-        if (patch.getMoxaPort() != null) {
-            base.setMoxaPort(patch.getMoxaPort());
-        }
-        if (patch.getValidLianda() != null) {
-            base.setValidLianda(patch.getValidLianda());
-        }
-        if (patch.getIsOpenScanning() != null) {
-            base.setIsOpenScanning(patch.getIsOpenScanning());
-        }
-        if (patch.getValidIsPre() != null) {
-            base.setValidIsPre(patch.getValidIsPre());
-        }
-        if (patch.getUserIp() != null) {
-            base.setUserIp(patch.getUserIp());
-        }
-        if (patch.getPowerState() != null) {
-            base.setPowerState(patch.getPowerState());
-        }
-        if (patch.getDvrState() != null) {
-            base.setDvrState(patch.getDvrState());
-        }
-        if (patch.getMoxaState() != null) {
-            base.setMoxaState(patch.getMoxaState());
-        }
-        if (patch.getPlcState() != null) {
-            base.setPlcState(patch.getPlcState());
-        }
-        if (patch.getLeftInfraredRayState() != null) {
-            base.setLeftInfraredRayState(patch.getLeftInfraredRayState());
-        }
-        if (patch.getRightInfraredRayState() != null) {
-            base.setRightInfraredRayState(patch.getRightInfraredRayState());
-        }
-        if (patch.getAmplifierState() != null) {
-            base.setAmplifierState(patch.getAmplifierState());
-        }
-        if (patch.getLampState() != null) {
-            base.setLampState(patch.getLampState());
-        }
-        if (patch.getSpotTypeNo() != null) {
-            base.setSpotTypeNo(patch.getSpotTypeNo());
-        }
-        if (patch.getRedGreenLightState() != null) {
-            base.setRedGreenLightState(patch.getRedGreenLightState());
-        }
-        if (patch.getFrontInfraredRayState() != null) {
-            base.setFrontInfraredRayState(patch.getFrontInfraredRayState());
-        }
-        if (patch.getRearInfraredRayState() != null) {
-            base.setRearInfraredRayState(patch.getRearInfraredRayState());
-        }
-        if (patch.getRfidState() != null) {
-            base.setRfidState(patch.getRfidState());
-        }
-        if (patch.getValidArea() != null) {
-            base.setValidArea(patch.getValidArea());
-        }
-        if (patch.getWeightStatus() != null) {
-            base.setWeightStatus(patch.getWeightStatus());
-        }
-        if (patch.getFerroalloyConfirm() != null) {
-            base.setFerroalloyConfirm(patch.getFerroalloyConfirm());
-        }
-        if (patch.getFerroalloyResult() != null) {
-            base.setFerroalloyResult(patch.getFerroalloyResult());
-        }
-        if (patch.getZeroState() != null) {
-            base.setZeroState(patch.getZeroState());
-        }
-        if (patch.getZeroWeight() != null) {
-            base.setZeroWeight(patch.getZeroWeight());
-        }
-        if (patch.getIsZeroState() != null) {
-            base.setIsZeroState(patch.getIsZeroState());
-        }
-        if (patch.getIsValidScan() != null) {
-            base.setIsValidScan(patch.getIsValidScan());
-        }
-        if (patch.getIsEnableSound() != null) {
-            base.setIsEnableSound(patch.getIsEnableSound());
-        }
-        if (patch.getPhotoCar2() != null) {
-            base.setPhotoCar2(patch.getPhotoCar2());
-        }
-    }
-
-    private static String nullToEmpty(String s) {
-        return s == null ? "" : s;
-    }
-
-    private static Number numOrZero(Number n) {
-        return n == null ? 0 : n;
-    }
-
-    private static Long dateToEpoch(Date d) {
-        return d == null ? null : d.getTime();
-    }
-
-    private static Object at(List<?> t, int idx) {
-        return idx < t.size() ? t.get(idx) : null;
-    }
-
-    private static String asString(List<?> t, int idx) {
-        Object v = at(t, idx);
-        if (v == null) {
-            return null;
-        }
-        String s = String.valueOf(v);
-        return s.isEmpty() ? null : s;
-    }
-
-    private static Short asShort(List<?> t, int idx) {
-        Object v = at(t, idx);
-        if (v == null) {
-            return null;
-        }
-        if (v instanceof Number) {
-            return ((Number) v).shortValue();
-        }
-        try {
-            return Short.valueOf(String.valueOf(v));
-        } catch (NumberFormatException e) {
-            return null;
-        }
-    }
-
-    private static Long asLong(List<?> t, int idx) {
-        Object v = at(t, idx);
-        if (v == null) {
-            return null;
-        }
-        if (v instanceof Number) {
-            return ((Number) v).longValue();
-        }
-        try {
-            return Long.valueOf(String.valueOf(v));
-        } catch (NumberFormatException e) {
-            return null;
-        }
-    }
-
-    private static Date asDate(List<?> t, int idx) {
-        Object v = at(t, idx);
-        if (v == null) {
-            return null;
-        }
-        if (v instanceof Date) {
-            return (Date) v;
-        }
-        if (v instanceof Number) {
-            long epoch = ((Number) v).longValue();
-            return epoch <= 0 ? null : new Date(epoch);
-        }
-        return null;
-    }
-}

+ 0 - 30
src/main/java/com/steerinfo/meterwork/meterworkmonitor/scheduler/MeterWorkMonitorSyncScheduler.java

@@ -1,30 +0,0 @@
-package com.steerinfo.meterwork.meterworkmonitor.scheduler;
-
-import com.steerinfo.meterwork.meterworkmonitor.service.MeterWorkMonitorSyncService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-/**
- * Tarantool METER_WORK_MONITOR → Oracle 定时回写。
- */
-@Component
-@ConditionalOnProperty(name = "meter.monitor.sync.enabled", havingValue = "true", matchIfMissing = false)
-public class MeterWorkMonitorSyncScheduler {
-
-    private static final Logger log = LoggerFactory.getLogger(MeterWorkMonitorSyncScheduler.class);
-
-    @Autowired
-    private MeterWorkMonitorSyncService meterWorkMonitorSyncService;
-
-    @Scheduled(cron = "${meter.monitor.sync.cron:* * * * * ?}")
-    public void scheduledSync() {
-        log.info("========== 开始执行 METER_WORK_MONITOR Tarantool→Oracle 同步 ==========");
-        System.out.println("====开始执行 METER_WORK_MONITOR Tarantool→Oracle 同步");
-        meterWorkMonitorSyncService.doSync();
-    }
-
-}

+ 0 - 4
src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/IMeterWorkMonitorService.java

@@ -24,10 +24,6 @@ import java.util.HashMap;
  */
 public interface IMeterWorkMonitorService extends IBaseService<MeterWorkMonitor, String>{
 
-    RESTfulResult doQueryWf(MeterWorkMonitor oci);
-
-    String doUpdateWf(MeterWorkMonitor model);
-    String updateLastTime(MeterWorkMonitor model);
 
 
 }

+ 0 - 39
src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/MeterWorkMonitorSyncService.java

@@ -2,7 +2,6 @@ package com.steerinfo.meterwork.meterworkmonitor.service;
 
 import com.steerinfo.meterwork.meterworkmonitor.mapper.MeterWorkMonitorMapper;
 import com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor;
-import com.steerinfo.meterwork.meterworkmonitor.rtdb.MeterWorkMonitorRtdbRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
@@ -16,52 +15,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
  * 将 Tarantool METER_WORK_MONITOR 脏数据回写 Oracle。
  */
 @Service
-@ConditionalOnExpression("'${rtdb.monitor.enabled:true}' == 'true' && '${meter.monitor.sync.enabled:false}' == 'true'")
 public class MeterWorkMonitorSyncService {
 
     private static final Logger log = LoggerFactory.getLogger(MeterWorkMonitorSyncService.class);
 
     private final AtomicBoolean running = new AtomicBoolean(false);
 
-    @Resource
-    private MeterWorkMonitorRtdbRepository meterWorkMonitorRtdbRepository;
-
     @Resource
     private MeterWorkMonitorMapper meterWorkMonitorMapper;
 
-    public void doSync() {
-        if (!running.compareAndSet(false, true)) {
-            log.warn("MeterWorkMonitor sync skipped: previous run still in progress");
-            return;
-        }
-        long start = System.currentTimeMillis();
-        int success = 0;
-        int failed = 0;
-        try {
-            List<MeterWorkMonitor> dirtyRows = meterWorkMonitorRtdbRepository.selectDirty();
-            log.info("MeterWorkMonitor sync start, dirtyCount={}", dirtyRows.size());
-            if (dirtyRows.isEmpty()) {
-                return;
-            }
-            for (MeterWorkMonitor row : dirtyRows) {
-                try {
-                    row.setPointName(null);
-                    meterWorkMonitorMapper.updateByPrimaryKeySelective(row);
-//                    meterWorkMonitorRtdbRepository.clearDirty(row.getPointNo());
-                    success++;
-                } catch (Exception ex) {
-                    failed++;
-                    log.error("sync row failed, pointNo={}", row.getPointNo(), ex);
-                }
-            }
-        } catch (Exception e) {
-            log.error("MeterWorkMonitor sync failed", e);
-        } finally {
-            running.set(false);
-            System.out.println("====结束执行 METER_WORK_MONITOR Tarantool→Oracle 同步, success=" + success + ", failed=" + failed + ", costMs=" + (System.currentTimeMillis() - start));
-            log.info("MeterWorkMonitor sync done, success={}, failed={}, costMs={}",
-                    success, failed, System.currentTimeMillis() - start);
-        }
-    }
 
    }

+ 0 - 151
src/main/java/com/steerinfo/meterwork/meterworkmonitor/service/impl/MeterWorkMonitorServiceImpl.java

@@ -8,10 +8,7 @@ import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.meterwork.meterworkmonitor.dto.MeterWorkMonitorDto;
 import com.steerinfo.meterwork.meterworkmonitor.mapper.MeterWorkMonitorMapper;
 import com.steerinfo.meterwork.meterworkmonitor.model.MeterWorkMonitor;
-import com.steerinfo.meterwork.meterworkmonitor.rtdb.MeterWorkMonitorRtdbRepository;
-import com.steerinfo.meterwork.meterworkmonitor.rtdb.MeterWorkMonitorTupleCodec;
 import com.steerinfo.meterwork.meterworkmonitor.service.IMeterWorkMonitorService;
-import com.steerinfo.meterwork.rtdb.RtdbPoolProperties;
 import com.steerinfo.util.FieldsCollector;
 import com.steerinfo.util.StringUtils;
 import org.slf4j.Logger;
@@ -51,159 +48,11 @@ public class MeterWorkMonitorServiceImpl extends BaseServiceImpl<MeterWorkMonito
     private MeterWorkMonitorMapper meterWorkMonitorMapper;
 
 
-    @Autowired(required = false)
-    private MeterWorkMonitorRtdbRepository meterWorkMonitorRtdbRepository;
-
-    @Autowired(required = false)
-    private RtdbPoolProperties rtdbPoolProperties;
-
     @Override
     protected IBaseMapper<MeterWorkMonitor, String> getMapper() {
         return meterWorkMonitorMapper;
     }
 
-    @Override
-    public RESTfulResult doQueryWf(MeterWorkMonitor oci) {
-        RESTfulResult rm = new RESTfulResult();
-        try {
-            rm.setCode("200");
-            PageHelper.startPage(0, 1);
-            Map<String, Object> map = FieldsCollector.beanToMap(oci);
-            List<MeterWorkMonitor> rows = meterWorkMonitorMapper.selectByParameters(map);
-            PageList pageInfo = new PageList(rows);
-            rm.setData(pageInfo);
-        } catch (Exception ex) {
-            rm.setCode("500");
-            rm.setMessage("查询失败:" + ex.getMessage());
-        }
-        return rm;
-    }
-
-    @Override
-    public String doUpdateWf(MeterWorkMonitor model) {
-        long start = System.currentTimeMillis();
-        try {
-            Assert.isTrue(model != null && StringUtils.isNotEmpty(model.getPointNo()), "秤点编号为空");
-            boolean rtdbEnabled = isRtdbWriteEnabled();
-            log.info("[MonitorRTDB] doUpdateWf service start pointNo={} rtdbEnabled={}",
-                    model.getPointNo(), rtdbEnabled);
-            if (rtdbEnabled) {
-                try {
-                    MeterWorkMonitor existing = meterWorkMonitorRtdbRepository.getByPointNo(model.getPointNo());
-                    String source;
-                    if (existing == null || existing.getPointNo() == null) {
-                        existing = meterWorkMonitorMapper.selectByPrimaryKey(model.getPointNo());
-                        if (existing == null || existing.getPointNo() == null) {
-                            existing = model;
-                            source = "request";
-                        } else {
-                            source = "oracle";
-                        }
-                    } else {
-                        source = "tarantool";
-                    }
-                    if (!"request".equals(source)) {
-                        MeterWorkMonitorTupleCodec.mergeNonNull(existing, model);
-                    }
-                    log.info("[MonitorRTDB] doUpdateWf replace Tarantool pointNo={} baseSource={} dirty=true",
-                            existing.getPointNo(), source);
-                    meterWorkMonitorRtdbRepository.replace(existing, true);
-                    log.info("[MonitorRTDB] doUpdateWf Tarantool ok pointNo={} costMs={}",
-                            existing.getPointNo(), System.currentTimeMillis() - start);
-                    return existing.getPointNo();
-                } catch (Exception rtdbEx) {
-                    log.error("[MonitorRTDB] doUpdateWf Tarantool failed pointNo={} fallbackOracle={} costMs={}",
-                            model.getPointNo(), isFallbackOracle(), System.currentTimeMillis() - start, rtdbEx);
-                    if (isFallbackOracle()) {
-                        meterWorkMonitorMapper.updateByPrimaryKeySelective(model);
-                        log.warn("[MonitorRTDB] doUpdateWf fallback Oracle ok pointNo={} costMs={}",
-                                model.getPointNo(), System.currentTimeMillis() - start);
-                        return model.getPointNo();
-                    }
-                    return "";
-                }
-            }
-            log.info("[MonitorRTDB] doUpdateWf write Oracle (rtdb disabled) pointNo={}", model.getPointNo());
-            meterWorkMonitorMapper.updateByPrimaryKeySelective(model);
-            return model.getPointNo();
-        } catch (Exception ex) {
-            log.error("[MonitorRTDB] doUpdateWf failed pointNo={} costMs={}",
-                    model == null ? null : model.getPointNo(), System.currentTimeMillis() - start, ex);
-            return "";
-        }
-    }
-
-    @Override
-    public String updateLastTime(MeterWorkMonitor model) {
-        long start = System.currentTimeMillis();
-        try {
-            Assert.isTrue(Objects.nonNull(model) && StringUtils.isNotEmpty(model.getPointNo()), "秤点编号为空");
-            Date now = new Date();
-            boolean rtdbEnabled = isRtdbWriteEnabled();
-            log.info("[MonitorRTDB] updateLastTime service start pointNo={} rtdbEnabled={} lastTimeMs={}",
-                    model.getPointNo(), rtdbEnabled, now.getTime());
-            if (rtdbEnabled) {
-                try {
-                    MeterWorkMonitor existing = meterWorkMonitorRtdbRepository.getByPointNo(model.getPointNo());
-                    if (existing == null || existing.getPointNo() == null) {
-                        existing = meterWorkMonitorMapper.selectByPrimaryKey(model.getPointNo());
-                        if (existing == null || existing.getPointNo() == null) {
-                            log.warn("[MonitorRTDB] updateLastTime miss both Tarantool and Oracle pointNo={} costMs={}",
-                                    model.getPointNo(), System.currentTimeMillis() - start);
-                            return "";
-                        }
-                        existing.setLastTime(now);
-                        log.info("[MonitorRTDB] updateLastTime miss Tarantool, replace from Oracle pointNo={}",
-                                model.getPointNo());
-                        meterWorkMonitorRtdbRepository.replace(existing, true);
-                    } else {
-                        log.info("[MonitorRTDB] updateLastTime update Tarantool LAST_TIME pointNo={} lastTimeMs={}",
-                                model.getPointNo(), now.getTime());
-                        meterWorkMonitorRtdbRepository.updateLastTime(model.getPointNo(), now.getTime());
-                    }
-                    log.info("[MonitorRTDB] updateLastTime Tarantool ok pointNo={} costMs={}",
-                            model.getPointNo(), System.currentTimeMillis() - start);
-                    return model.getPointNo();
-                } catch (Exception rtdbEx) {
-                    log.error("[MonitorRTDB] updateLastTime Tarantool failed pointNo={} fallbackOracle={} costMs={}",
-                            model.getPointNo(), isFallbackOracle(), System.currentTimeMillis() - start, rtdbEx);
-                    if (isFallbackOracle()) {
-                        MeterWorkMonitor tempModel = meterWorkMonitorMapper.selectByPrimaryKey(model.getPointNo());
-                        Assert.isTrue(tempModel != null && tempModel.getPointNo() != null, "未查询到秤点信息");
-                        tempModel.setLastTime(now);
-                        meterWorkMonitorMapper.updateByPrimaryKeySelective(tempModel);
-                        log.warn("[MonitorRTDB] updateLastTime fallback Oracle ok pointNo={} costMs={}",
-                                tempModel.getPointNo(), System.currentTimeMillis() - start);
-                        return tempModel.getPointNo();
-                    }
-                    return "";
-                }
-            }
-            log.info("[MonitorRTDB] updateLastTime write Oracle (rtdb disabled) pointNo={}", model.getPointNo());
-            MeterWorkMonitor tempModel = meterWorkMonitorMapper.selectByPrimaryKey(model.getPointNo());
-            Assert.isTrue(tempModel != null && tempModel.getPointNo() != null, "未查询到秤点信息");
-            tempModel.setLastTime(now);
-            meterWorkMonitorMapper.updateByPrimaryKeySelective(tempModel);
-            return tempModel.getPointNo();
-        } catch (Exception ex) {
-            log.error("[MonitorRTDB] updateLastTime failed pointNo={} costMs={}",
-                    model == null ? null : model.getPointNo(), System.currentTimeMillis() - start, ex);
-            return "";
-        }
-    }
-
-    private boolean isRtdbWriteEnabled() {
-        return meterWorkMonitorRtdbRepository != null
-                && rtdbPoolProperties != null
-                && rtdbPoolProperties.getMonitor().isEnabled()
-                && !rtdbPoolProperties.getMonitor().isFallbackOracle()
-                && rtdbPoolProperties.getMonitor().isSyncEnabled();
-
-    }
-
-    private boolean isFallbackOracle() {
-        return rtdbPoolProperties != null && rtdbPoolProperties.getMonitor().isFallbackOracle();
-    }
 
 
 }

+ 13 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.java

@@ -1,5 +1,8 @@
 package com.steerinfo.meterwork.meterworkrailwayactfirst.mapper;
 
+import com.steerinfo.abnormalHandler.dto.RailwayActualDuplicateGroup;
+import com.steerinfo.abnormalHandler.dto.RailwayActualRecord;
+import com.steerinfo.abnormalHandler.dto.RailwayFirstDuplicateGroup;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.meterwork.dto.StaffPerformanceAnalysis;
 import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
@@ -80,5 +83,15 @@ public interface MeterWorkRailwayActFirstMapper extends IBaseMapper<MeterWorkRai
     int updatePredictionByRule3(@Param("predictionNo") String predictionNo);
     int updatePredictionByRule4(@Param("predictionNo") String predictionNo);
 
+    List<RailwayActualDuplicateGroup> selectDuplicateRailwayActualGroups();
+
+    int invalidateRailwayActualRecord(@Param("actualNo") String actualNo);
+
+    List<RailwayFirstDuplicateGroup> selectDuplicateRailwayFirstGroups();
+
+    int invalidateRailwayFirstRecord(@Param("actualFirstNo") String actualFirstNo);
+
+
+
 
 }

+ 113 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.xml

@@ -4462,5 +4462,118 @@ FETCH FIRST 20 ROWS ONLY
     )
   </update>
 
+  <!-- 查询火运洁净表重复数据 -->
+  <select id="selectDuplicateRailwayActualGroups"
+          resultType="com.steerinfo.abnormalHandler.dto.RailwayActualDuplicateGroup">
+    SELECT * FROM (
+                    SELECT RAILWAY_NO AS "railwayNo",
+                           LISTAGG(ACTUAL_NO, ',') WITHIN GROUP (ORDER BY CREATE_TIME DESC) AS "actualList"
+                    FROM METER_WORK_RAILWAY_ACTUAL
+                    WHERE CREATE_TIME >= SYSDATE - 3
+                      AND VALUE_FLAG != '0'
+                      AND RAILWAY_NO IS NOT NULL
+                    GROUP BY RAILWAY_NO,
+                      BASE_SPOT1_NO,
+                      BASE_SPOT2_NO,
+                      TO_CHAR(GROSS_TIME, 'yyyy-MM-dd HH24:mi:ss')
+                    HAVING COUNT(1) > 1
+                    UNION ALL
+                    SELECT RAILWAY_NO AS "railwayNo",
+                      LISTAGG(ACTUAL_NO, ',') WITHIN GROUP (ORDER BY CREATE_TIME DESC) AS "actualList"
+                    FROM METER_WORK_RAILWAY_ACTUAL
+                    WHERE CREATE_TIME >= SYSDATE - 3
+                      AND VALUE_FLAG != '0'
+                      AND RAILWAY_NO IS NOT NULL
+                    GROUP BY RAILWAY_NO,
+                      BASE_SPOT1_NO,
+                      BASE_SPOT2_NO,
+                      TO_CHAR(TARE_TIME, 'yyyy-MM-dd HH24:mi:ss')
+                    HAVING COUNT(1) > 1
+                  ) WHERE ROWNUM <![CDATA[ <= ]]> 20
+  </select>
+
+  <!-- 查询某个 ACTUAL_NO 下的所有记录(按 CREATE_TIME 升序) -->
+  <select id="selectRecordsByActualNo"
+          resultType="com.steerinfo.abnormalHandler.dto.RailwayActualRecord">
+    SELECT ACTUAL_NO AS actualNo,
+           RAILWAY_NO AS railwayNo,
+           CREATE_TIME AS createTime,
+           VALUE_FLAG AS valueFlag
+    FROM METER_WORK_RAILWAY_ACTUAL
+    WHERE ACTUAL_NO = #{actualNo}
+      AND VALUE_FLAG != '0'
+    ORDER BY CREATE_TIME ASC
+  </select>
+
+  <!-- 单条作废 -->
+  <update id="invalidateRailwayActualRecord">
+    UPDATE METER_WORK_RAILWAY_ACTUAL
+    SET VALUE_FLAG = '0',
+        UPDATE_TIME = SYSDATE,
+        UPDATE_MAN_NAME = '定时器-火运洁净表去重'
+    WHERE ACTUAL_NO = #{actualNo}
+      AND VALUE_FLAG != '0'
+  </update>
+
+  <!-- 查询火运一次表重复数据组 -->
+  <select id="selectDuplicateRailwayFirstGroups"
+          resultType="com.steerinfo.abnormalHandler.dto.RailwayFirstDuplicateGroup">
+    WITH BASE_DATA AS (
+      SELECT
+        RAILWAY_NO,
+        ACTUAL_FIRST_NO,
+        METER_WEIGHT,
+        CREATE_TIME,
+        LAG(CREATE_TIME) OVER(
+                PARTITION BY RAILWAY_NO, ROUND(METER_WEIGHT, 0)
+                ORDER BY CREATE_TIME
+            ) AS PREV_CREATE_TIME
+      FROM METER_WORK_RAILWAY_ACT_FIRST
+      WHERE VALUE_FLAG != '0'
+      AND CREATE_TIME >= SYSDATE - 3
+      AND RAILWAY_NO IS NOT NULL
+      AND METER_WEIGHT IS NOT NULL
+      ),
+      MARKED_DATA AS (
+    SELECT
+      RAILWAY_NO,
+      ACTUAL_FIRST_NO,
+      METER_WEIGHT,
+      CREATE_TIME,
+      PREV_CREATE_TIME,
+      CASE WHEN PREV_CREATE_TIME IS NOT NULL
+      AND (CREATE_TIME - PREV_CREATE_TIME) * 24 * 60 <![CDATA[ <= ]]> 30
+      THEN 1 ELSE 0
+      END AS IS_DUPLICATE
+    FROM BASE_DATA
+      ),
+      DUPLICATE_GROUPS AS (
+    SELECT DISTINCT RAILWAY_NO, ROUND(METER_WEIGHT, 0) AS TONNAGE
+    FROM MARKED_DATA
+    WHERE IS_DUPLICATE = 1
+      )
+    SELECT
+      DG.RAILWAY_NO AS railwayNo,
+      DG.TONNAGE AS tonnage,
+      COUNT(1) AS cnt,
+      LISTAGG(MD.ACTUAL_FIRST_NO, ',') WITHIN GROUP (ORDER BY MD.CREATE_TIME ASC) AS actualList
+    FROM DUPLICATE_GROUPS DG
+      INNER JOIN MARKED_DATA MD
+    ON DG.RAILWAY_NO = MD.RAILWAY_NO
+      AND DG.TONNAGE = ROUND(MD.METER_WEIGHT, 0)
+    GROUP BY DG.RAILWAY_NO, DG.TONNAGE
+    HAVING COUNT(1) > 0
+      FETCH NEXT 20 ROWS ONLY
+  </select>
+
+  <!-- 单条作废 -->
+  <update id="invalidateRailwayFirstRecord">
+    UPDATE METER_WORK_RAILWAY_ACT_FIRST
+    SET VALUE_FLAG = '0',
+        UPDATE_TIME = SYSDATE,
+        UPDATE_MAN_NAME = '定时器-火运一次表去重'
+    WHERE ACTUAL_FIRST_NO = #{actualFirstNo}
+      AND VALUE_FLAG != '0'
+  </update>
 
 </mapper>

+ 0 - 17
src/main/java/com/steerinfo/meterwork/rtdb/RtdbClientConfiguration.java

@@ -1,17 +0,0 @@
-package com.steerinfo.meterwork.rtdb;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@EnableConfigurationProperties(RtdbPoolProperties.class)
-public class RtdbClientConfiguration {
-
-    @Bean(destroyMethod = "close")
-    @ConditionalOnProperty(name = "rtdb.monitor.enabled", havingValue = "true", matchIfMissing = true)
-    public RtdbClientPool rtdbClientPool(RtdbPoolProperties properties) {
-        return new RtdbClientPool(properties);
-    }
-}

+ 0 - 189
src/main/java/com/steerinfo/meterwork/rtdb/RtdbClientPool.java

@@ -1,189 +0,0 @@
-package com.steerinfo.meterwork.rtdb;
-
-import com.steerinfo.rtdb.Client;
-import com.steerinfo.rtdb.ClientConfig;
-import com.steerinfo.rtdb.ClientImpl;
-import com.steerinfo.rtdb.SingleSocketChannelProviderImpl;
-import com.steerinfo.rtdb.SocketChannelProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * 基于 icore-rtdb 的多 Client 连接池(借用/归还 + 故障重建)。
- */
-public class RtdbClientPool implements AutoCloseable {
-
-    private static final Logger log = LoggerFactory.getLogger(RtdbClientPool.class);
-
-    private final RtdbPoolProperties properties;
-    private final BlockingQueue<Client> idle;
-    private final AtomicBoolean closed = new AtomicBoolean(false);
-    private final int capacity;
-    private final java.util.concurrent.atomic.AtomicInteger created = new java.util.concurrent.atomic.AtomicInteger(0);
-
-    public RtdbClientPool(RtdbPoolProperties properties) {
-        this.properties = properties;
-        this.capacity = Math.max(1, properties.getPool().getSize());
-        this.idle = new ArrayBlockingQueue<>(capacity);
-        // 启动时尝试预创建,失败不阻断应用(借用时再创建)
-        for (int i = 0; i < capacity; i++) {
-            try {
-                idle.offer(createClient());
-                created.incrementAndGet();
-            } catch (Exception e) {
-                log.warn("RTDB pre-create client failed ({}/{}): {}", i + 1, capacity, e.getMessage());
-                break;
-            }
-        }
-        log.info("RtdbClientPool initialized: address={}, preCreated={}/{}",
-                properties.address(), created.get(), capacity);
-    }
-
-    public Client borrow() throws InterruptedException {
-        ensureOpen();
-        Client client = idle.poll(properties.getPool().getBorrowTimeoutMs(), TimeUnit.MILLISECONDS);
-        if (client == null) {
-            if (created.get() < capacity) {
-                try {
-                    client = createClient();
-                    created.incrementAndGet();
-                } catch (Exception e) {
-                    throw new IllegalStateException("RTDB pool empty and create failed: " + e.getMessage(), e);
-                }
-            } else {
-                throw new IllegalStateException("RTDB pool borrow timeout after "
-                        + properties.getPool().getBorrowTimeoutMs() + "ms");
-            }
-        }
-        if (!isHealthy(client)) {
-            closeQuietly(client);
-            created.decrementAndGet();
-            client = createClient();
-            created.incrementAndGet();
-        }
-        return client;
-    }
-
-    public void release(Client client) {
-        if (client == null || closed.get()) {
-            closeQuietly(client);
-            if (client != null) {
-                created.decrementAndGet();
-            }
-            return;
-        }
-        if (!idle.offer(client)) {
-            closeQuietly(client);
-            created.decrementAndGet();
-        }
-    }
-
-    /**
-     * 业务失败时丢弃坏连接并补一个新连接回池。
-     */
-    public void invalidate(Client client) {
-        closeQuietly(client);
-        created.decrementAndGet();
-        if (closed.get()) {
-            return;
-        }
-        try {
-            idle.offer(createClient());
-            created.incrementAndGet();
-        } catch (Exception e) {
-            log.warn("Failed to recreate RTDB client after invalidate: {}", e.getMessage());
-        }
-    }
-
-    public <T> T execute(RtdbCallback<T> callback) {
-        Client client = null;
-        boolean borrowed = false;
-        try {
-            client = borrow();
-            borrowed = true;
-            return callback.doInRtdb(client);
-        } catch (InterruptedException e) {
-            Thread.currentThread().interrupt();
-            throw new IllegalStateException("Interrupted while borrowing RTDB client", e);
-        } catch (RuntimeException e) {
-            if (borrowed && client != null) {
-                invalidate(client);
-                borrowed = false;
-                client = null;
-            }
-            throw e;
-        } catch (Exception e) {
-            if (borrowed && client != null) {
-                invalidate(client);
-                borrowed = false;
-                client = null;
-            }
-            throw new IllegalStateException("RTDB operation failed", e);
-        } finally {
-            if (borrowed && client != null) {
-                release(client);
-            }
-        }
-    }
-
-    private Client createClient() {
-        ClientConfig config = new ClientConfig();
-        config.username = properties.getUsername();
-        config.password = properties.getPassword() == null ? "" : properties.getPassword();
-        SocketChannelProvider socket =
-                new SingleSocketChannelProviderImpl(properties.address());
-        return new ClientImpl(socket, config);
-    }
-
-    private boolean isHealthy(Client client) {
-        try {
-            if (client == null || client.isClosed() || !client.isAlive()) {
-                return false;
-            }
-            client.syncOps().ping();
-            return true;
-        } catch (Exception e) {
-            log.warn("RTDB client ping failed: {}", e.getMessage());
-            return false;
-        }
-    }
-
-    private void ensureOpen() {
-        if (closed.get()) {
-            throw new IllegalStateException("RtdbClientPool is closed");
-        }
-    }
-
-    private void closeQuietly(Client client) {
-        if (client == null) {
-            return;
-        }
-        try {
-            client.close();
-        } catch (Exception ignored) {
-            // ignore
-        }
-    }
-
-    @Override
-    public void close() {
-        if (!closed.compareAndSet(false, true)) {
-            return;
-        }
-        Client client;
-        while ((client = idle.poll()) != null) {
-            closeQuietly(client);
-        }
-        log.info("RtdbClientPool closed");
-    }
-
-    @FunctionalInterface
-    public interface RtdbCallback<T> {
-        T doInRtdb(Client client) throws Exception;
-    }
-}

+ 0 - 130
src/main/java/com/steerinfo/meterwork/rtdb/RtdbPoolProperties.java

@@ -1,130 +0,0 @@
-package com.steerinfo.meterwork.rtdb;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Tarantool / icore-rtdb 连接池配置。
- */
-@ConfigurationProperties(prefix = "rtdb")
-public class RtdbPoolProperties {
-
-    private String host = "172.22.42.3";
-    private int port = 2101;
-    private String username = "guest";
-    private String password = "";
-    private final Pool pool = new Pool();
-    private final Monitor monitor = new Monitor();
-
-    public String getHost() {
-        return host;
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-    public int getPort() {
-        return port;
-    }
-
-    public void setPort(int port) {
-        this.port = port;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public Pool getPool() {
-        return pool;
-    }
-
-    public Monitor getMonitor() {
-        return monitor;
-    }
-
-    public String address() {
-        return host + ":" + port;
-    }
-
-    public static class Pool {
-        private int size = 8;
-        private long borrowTimeoutMs = 3000L;
-
-        public int getSize() {
-            return size;
-        }
-
-        public void setSize(int size) {
-            this.size = size;
-        }
-
-        public long getBorrowTimeoutMs() {
-            return borrowTimeoutMs;
-        }
-
-        public void setBorrowTimeoutMs(long borrowTimeoutMs) {
-            this.borrowTimeoutMs = borrowTimeoutMs;
-        }
-    }
-
-    public static class Monitor {
-        /** 是否启用 Monitor 写 Tarantool */
-        @Value("${rtdb.monitor.enabled:true}")
-        private boolean enabled = true;
-        /** Tarantool 失败时是否回退 Oracle */
-        @Value("${rtdb.monitor.fallback-oracle:false}")
-        private boolean fallbackOracle;
-        /** 启动时从 Oracle 全量灌入 Tarantool */
-        @Value("${rtdb.monitor.bootstrap-enabled:false}")
-        private boolean bootstrapEnabled;
-
-        @Value("${meter.monitor.sync.enabled:true}")
-        private boolean syncEnabled;
-
-        public boolean isEnabled() {
-            return enabled;
-        }
-
-        public void setEnabled(boolean enabled) {
-            this.enabled = enabled;
-        }
-
-        public boolean isFallbackOracle() {
-            return fallbackOracle;
-        }
-
-        public void setFallbackOracle(boolean fallbackOracle) {
-            this.fallbackOracle = fallbackOracle;
-        }
-
-        public boolean isBootstrapEnabled() {
-            return bootstrapEnabled;
-        }
-
-        public void setBootstrapEnabled(boolean bootstrapEnabled) {
-            this.bootstrapEnabled = bootstrapEnabled;
-        }
-
-        public boolean isSyncEnabled() {
-            return syncEnabled;
-        }
-
-        public void setSyncEnabled(boolean syncEnabled) {
-            this.syncEnabled = syncEnabled;
-        }
-    }
-}

+ 32 - 7
src/main/resources/application-dev.properties

@@ -1,4 +1,4 @@
-server.port=9005
+server.port=${SERVER_PORT:9005}
 #\u5FAE\u670D\u52A1\u7AEF\u53E3
 spring.jmx.default-domain=project1
 #\u6307\u5B9A\u7248\u672C
@@ -27,8 +27,6 @@ shiro.chains=/auth/login/**;/ktr/;/${api.version}/sys/**/export;/${api.version}/
 shiro.chains.append=/swagger**;/idmg/**;/ktr/;/${api.version}/sysposts/list/user**;/webjars/**;/v2/api**;/images/**;/configuration/**;
 
 # TODO[TEMP-AUTH-OFF] 测试完成后改回 true
-security.verification.enabled=true
-
 # Redis\u7F13\u5B58\u914D\u7F6E
 cache.level=1
 #Redis\u7F13\u5B58\u914D\u7F6E
@@ -77,17 +75,30 @@ openfeign.dil.url= ${DIL_URL:192.168.107.61:8000}
 #multiple.datasource.master.username=lims
 #multiple.datasource.master.password=Lims123789
 
+#multiple.datasource.master.driver-class-name=oracle.jdbc.driver.OracleDriver
+#multiple.datasource.master.url=jdbc:oracle:thin:@10.99.200.87:1521/jgwzjl
+#multiple.datasource.master.username=lims
+#multiple.datasource.master.password=lims_2021
 multiple.datasource.master.driver-class-name=oracle.jdbc.driver.OracleDriver
-multiple.datasource.master.url=jdbc:oracle:thin:@10.99.200.87:1521/jgwzjl
+multiple.datasource.master.url=jdbc:oracle:thin:@10.130.1.1:1521/jgwzjl
 multiple.datasource.master.username=lims
 multiple.datasource.master.password=lims_2021
 
-multiple.datasource.master.initial-size=15
-multiple.datasource.master.min-idle=15
+multiple.datasource.master.initial-size=20
+multiple.datasource.master.min-idle=20
 multiple.datasource.master.maxActive=75
-multiple.datasource.master.maxWait=1000
+multiple.datasource.master.maxWait=30000
 multiple.datasource.master.timeBetweenEvictionRunsMillis=60000
 multiple.datasource.master.minEvictableIdleTimeMillis=300000
+multiple.datasource.master.validationQuery=SELECT 1 FROM DUAL
+multiple.datasource.master.testWhileIdle=true
+multiple.datasource.master.testOnBorrow=false
+multiple.datasource.master.testOnReturn=false
+multiple.datasource.master.validationQueryTimeout=5
+multiple.datasource.master.remove-abandoned=true
+multiple.datasource.master.remove-abandoned-timeout=180
+multiple.datasource.master.log-abandoned=true
+
 
 #slave1
 multiple.datasource.slave1.driver-class-name=oracle.jdbc.driver.OracleDriver
@@ -128,3 +139,17 @@ server.tomcat.max-threads=400
 server.connection-timeout=20000
 
 logging.level.com=debug
+rtdb.host=10.99.200.86
+rtdb.port=2101
+rtdb.username=guest
+rtdb.password=
+rtdb.pool.size=8
+rtdb.pool.borrow-timeout-ms=3000
+rtdb.monitor.enabled=true
+rtdb.monitor.fallback-oracle = true
+rtdb.monitor.bootstrap-enabled = false
+meter.monitor.sync.enabled = true
+meter.monitor.sync.cron = * * * * * ?
+meter.status.sync.enabled = true
+meter.status.sync.cron = 0 */3 * * * ?
+security.verification.enabled=true

+ 0 - 9
src/main/resources/application-prod.properties

@@ -139,15 +139,6 @@ server.tomcat.max-threads=400
 server.connection-timeout=20000
 
 logging.level.com=debug
-rtdb.host=10.99.200.86
-rtdb.port=2101
-rtdb.username=guest
-rtdb.password=
-rtdb.pool.size=8
-rtdb.pool.borrow-timeout-ms=3000
-rtdb.monitor.enabled=true
-rtdb.monitor.fallback-oracle = true
-rtdb.monitor.bootstrap-enabled = false
 meter.monitor.sync.enabled = true
 meter.monitor.sync.cron = * * * * * ?
 meter.status.sync.enabled = true

+ 0 - 9
src/main/resources/application.properties

@@ -140,15 +140,6 @@ logging.level.com=debug
 #??
 #rtdb.host=172.22.42.3
 #rtdb.host=10.130.1.3
-rtdb.host=10.99.200.86
-rtdb.port=2101
-rtdb.username=guest
-rtdb.password=
-rtdb.pool.size=8
-rtdb.pool.borrow-timeout-ms=3000
-rtdb.monitor.enabled=true
-rtdb.monitor.fallback-oracle = true
-rtdb.monitor.bootstrap-enabled = false
 meter.monitor.sync.enabled = true
 meter.monitor.sync.cron = * * * * * ?
 meter.status.sync.enabled = true

+ 6 - 6
src/main/resources/bootstrap.yml

@@ -7,12 +7,12 @@ spring:
     sampler:
       #默认值为0.1f,现在为了测试设置100%采集
       percentage: 1.0
-  cloud:
-    config:
-      #      fail-fast: true
-      discovery:
-        enabled: true
-        service-id: config-server
+#  cloud:
+#    config:
+#      #      fail-fast: true
+#      discovery:
+#        enabled: true
+#        service-id: config-server
     bus:
       trace:
         enabled: false # 2021年9月10日取消springcloud中bus总线服务

+ 0 - 155
src/main/resources/jg_wzjl_scheduled_job-prod.properties

@@ -1,155 +0,0 @@
-server.port=${SERVER_PORT:9005}
-#\u5FAE\u670D\u52A1\u7AEF\u53E3
-spring.jmx.default-domain=project1
-#\u6307\u5B9A\u7248\u672C
-api.version=v1
-#\u6307\u5B9Aencoding\u683C\u5F0F
-server.tomcat.uri-encoding=UTF-8
-
-# \u5B9A\u4E49swagger2\u5305\u8DEF\u5F84
-swagger2.enable=true
-swagger2.basepackage=com.steerinfo
-
-#\u542F\u7528shutdown
-# endpoints.shutdown.enabled=true
-#\u7981\u7528\u5BC6\u7801\u9A8C\u8BC1
-# endpoints.shutdown.sensitive=false
-#7*24*60*60*1000
-access.token.ttl=604800000
-#3*7*24*60*60*1000
-refresh.token.ttl=1814400000
-#;/${api.version}/sys/**/export;/${api.version}/sys/**/import;/**,auth
-# \u62E6\u622A\u5668\u9644\u52A0\u914D\u7F6E\uFF1A\u6BCF\u4E2Aurl\u8DEF\u5F84\u4EE5;\u5206\u9694\uFF1Burl\u7684\u9017\u53F7\u540Eauth\u8868\u793A\u9700\u8981\u8BA4\u8BC1\u540E\u624D\u80FD\u8BBF\u95EE\uFF0C\u6CA1\u6709\u6216\u8005anon\u8868\u793A\u4E0D\u6821\u9A8C
-# TODO[TEMP-AUTH-OFF] 测试完成后改回: /**,auth
-# shiro.chains=/auth/login/**;/ktr/;/${api.version}/sys/**/export;/${api.version}/syspromachineauths/verify**;/${api.version}/sys/**/import;/**,auth
-shiro.chains=/auth/login/**;/ktr/;/${api.version}/sys/**/export;/${api.version}/syspromachineauths/verify**;/${api.version}/sys/**/import;/**,anon
-# \u62E6\u622A\u5668\u9644\u52A0\u914D\u7F6E\uFF1A\u6BCF\u4E2Aurl\u8DEF\u5F84\u4EE5;\u5206\u9694\uFF1Burl\u7684\u9017\u53F7\u540Eauth\u8868\u793A\u8BA4\u8BC1\u540E\u624D\u80FD\u8BBF\u95EE\uFF0C\u6CA1\u6709\u6216\u8005anon\u8868\u793A\u4E0D\u6821\u9A8C
-shiro.chains.append=/swagger**;/idmg/**;/ktr/;/${api.version}/sysposts/list/user**;/webjars/**;/v2/api**;/images/**;/configuration/**;
-
-# TODO[TEMP-AUTH-OFF] 测试完成后改回 true
-# Redis\u7F13\u5B58\u914D\u7F6E
-cache.level=1
-#Redis\u7F13\u5B58\u914D\u7F6E
-redis.host=127.0.0.1
-redis.port=6379
-redis.pwd=123456
-redis.project.prefix=sysmanage
-redis.pool.maxTotal=8
-redis.pool.maxWaitMillis=1000
-redis.pool.maxIdle=4
-redis.cache.time=864000000
-redis.database=6
-
-#mq
-#spring.rabbitmq.host=192.168.1.33
-#spring.rabbitmq.port=5672
-#spring.rabbitmq.username=admin
-#spring.rabbitmq.password=admin
-
-#\u65E5\u5FD7 purchase
-#\u652F\u6301\u9AD8\u4EAE\u8F93\u51FA
-spring.output.ansi.enabled=ALWAYS
-spring.main.show-banner=false
-logging.level.com.steer=ERROR
-#DEBUG,INFO,WARN,ERROR
-
-#\u56FD\u9645\u5316
-spring.messages.basename=message
-spring.messages.encoding=UTF-8
-
-# MyBatis \u914D\u7F6E
-mybatis.mapper-locations=classpath*:com/hnshituo/mapper/*.xml
-###spring boot\u81EA\u52A8\u914D\u7F6E\u5355\u6570\u636E\u6E90###
-#spring.datasource.url=jdbc:oracle:thin:@192.168.1.160:1521:orcl
-#spring.datasource.username=sale
-#spring.datasource.password=oracle
-
-#wuliujiekou
-openfeign.dil.url= ${DIL_URL:192.168.107.61:8000}
-#openfeign.dil.url= ${DIL_URL:192.168.0.193:8092}
-
-#\u591A\u6570\u636E\u6E90\u914D\u7F6E
-#master
-#multiple.datasource.master.driver-class-name=oracle.jdbc.driver.OracleDriver
-#multiple.datasource.master.url=jdbc:oracle:thin:@192.168.102.45:1521/cxdb
-#multiple.datasource.master.username=lims
-#multiple.datasource.master.password=Lims123789
-
-multiple.datasource.master.driver-class-name=oracle.jdbc.driver.OracleDriver
-multiple.datasource.master.url=jdbc:oracle:thin:@10.99.200.87:1521/jgwzjl
-multiple.datasource.master.username=lims
-multiple.datasource.master.password=lims_2021
-#multiple.datasource.master.driver-class-name=oracle.jdbc.driver.OracleDriver
-#multiple.datasource.master.url=jdbc:oracle:thin:@10.130.1.1:1521/jgwzjl
-#multiple.datasource.master.username=lims
-#multiple.datasource.master.password=lims_2021
-
-multiple.datasource.master.initial-size=20
-multiple.datasource.master.min-idle=20
-multiple.datasource.master.maxActive=75
-multiple.datasource.master.maxWait=30000
-multiple.datasource.master.timeBetweenEvictionRunsMillis=60000
-multiple.datasource.master.minEvictableIdleTimeMillis=300000
-multiple.datasource.master.validationQuery=SELECT 1 FROM DUAL
-multiple.datasource.master.testWhileIdle=true
-multiple.datasource.master.testOnBorrow=false
-multiple.datasource.master.testOnReturn=false
-multiple.datasource.master.validationQueryTimeout=5
-multiple.datasource.master.remove-abandoned=true
-multiple.datasource.master.remove-abandoned-timeout=180
-multiple.datasource.master.log-abandoned=true
-
-
-#slave1
-multiple.datasource.slave1.driver-class-name=oracle.jdbc.driver.OracleDriver
-multiple.datasource.slave1.url=jdbc:oracle:thin:@10.1.201.50:1521/jgjldata
-multiple.datasource.slave1.username=view_query
-multiple.datasource.slave1.password=view_query
-#slave2
-multiple.datasource.slave2.driver-class-name=
-multiple.datasource.slave2.url=
-multiple.datasource.slave2.username=
-multiple.datasource.slave2.password=
-#other
-multiple.datasource.other.driver-class-name=
-multiple.datasource.other.url=
-multiple.datasource.other.username=
-multiple.datasource.other.password=
-
-
-web.upload-path=/static/
-genxml.pth=/genxml/
-spring.http.encoding.force=true
-spring.mvc.static-path-pattern=/**
-spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,\
-  classpath:/static/,classpath:/genxml/,classpath:/public/,file:${web.upload-path},file:${genxml.pth}
-
-#是否将自己注册到Eureka Server上,默认为true
-eureka.client.register-with-eureka=false  
-#是否从Eureka Server上获取注册信息,默认为true
-eureka.client.fetch-registry=false
-
-#SSO
-sso.url=https://jgwzjl.jiugang.com/icore.icp.web/pass
-sso.appuser=appToken
-sso.password=a1234567
-
-server.tomcat.accept-count=500
-server.tomcat.max-threads=400
-server.connection-timeout=20000
-
-logging.level.com=debug
-rtdb.host=10.99.200.86
-rtdb.port=2101
-rtdb.username=guest
-rtdb.password=
-rtdb.pool.size=8
-rtdb.pool.borrow-timeout-ms=3000
-rtdb.monitor.enabled=true
-rtdb.monitor.fallback-oracle = true
-rtdb.monitor.bootstrap-enabled = false
-meter.monitor.sync.enabled = true
-meter.monitor.sync.cron = * * * * * ?
-meter.status.sync.enabled = true
-meter.status.sync.cron = 0 */3 * * * ?
-security.verification.enabled=true