From acccf8a6aab49208a43fda862487aebcaa2cdb73 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 05 八月 2024 15:31:03 +0800
Subject: [PATCH] 1. 从未开过阀的取水口; 2. 指定时间段内开阀次数超过指定值的取水口; 3. 指定时间段内开阀次数低于指定值的取水口; 4.获取开关阀报(历史)完善接口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml                           |  104 ++++++++++++++
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java        |   65 +++++++++
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeValueQO.java |   23 +++
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java         |  118 ++++++++++++++++
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml                              |    8 
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java                 |   28 ++-
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java            |   45 ++++++
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java                         |   21 +++
 8 files changed, 396 insertions(+), 16 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
index 7474543..ee5171e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
@@ -3,6 +3,8 @@
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveHistory;
 import com.dy.pipIrrGlobal.voRm.VoOpenCloseValve;
+import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
@@ -76,4 +78,47 @@
      * @return
      */
     List<VoOpenCloseValve> getOpenCloseValveReports_history(Map<?, ?> params);
+
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴浠庢湭寮�杩囬榾鐨勫彇姘村彛鏁伴噺
+     * @param params
+     * @return
+     */
+    Long getNeverOpenValveIntakesCount(Map<?, ?> params);
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴浠庢湭寮�杩囬榾鐨勫彇姘村彛
+     * @param params
+     * @return
+     */
+    List<VoIntake> getNeverOpenValveIntakes(Map<?, ?> params);
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙f暟閲�
+     * @param params
+     * @return
+     */
+    Long getOpenValveGtIntakesCount(Map<String, Object> params);
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param params
+     * @return
+     */
+    List<VoIntakeOpenCount> getOpenValveGtIntakes(Map<String, Object> params);
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙f暟閲�
+     * @param params
+     * @return
+     */
+    Long getOpenValveLtIntakesCount(Map<String, Object> params);
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param params
+     * @return
+     */
+    List<VoIntakeOpenCount> getOpenValveLtIntakes(Map<String, Object> params);
 }
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java
new file mode 100644
index 0000000..421b9b2
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java
@@ -0,0 +1,21 @@
+package com.dy.pipIrrGlobal.voSt;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import lombok.Data;
+
+/**
+ * @author :WuZeYu
+ * @Date :2024/8/5  10:45
+ * @LastEditTime :2024/8/5  10:45
+ * @Description 鍙栨按鍙e紑闃� 鎸囧畾鍊� 娆℃暟
+ */
+@Data
+public class VoIntakeOpenCount extends VoIntake{
+    private static final long serialVersionUID = 202408051046001L;
+
+    /**
+     * 鎸囧畾鍊�
+     */
+    private Long recordCount;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
index 16e4487..aefd5fc 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -425,10 +425,10 @@
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
       </if>
-      <if test = "timeStart_open != null and timeStop_open != null">
+      <if test = "timeStart_open != null and timeStart_open != '' and timeStop_open != null and  timeStop_open != '' ">
         AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open}
       </if>
-      <if test = "timeStart_close != null and timeStop_close != null">
+      <if test = "timeStart_close != null and timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
         AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
       </if>
     </where>
@@ -490,10 +490,10 @@
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
       </if>
-      <if test = "timeStart_open != null and timeStop_open != null">
+      <if test = "timeStart_open != null and timeStart_open != '' and timeStop_open != null and  timeStop_open != '' ">
         AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open}
       </if>
-      <if test = "timeStart_close != null and timeStop_close != null">
+      <if test = "timeStart_close != null and timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
         AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
       </if>
     </where>
@@ -504,4 +504,100 @@
       </if>
     </trim>
   </select>
+  <!--鑾峰彇鎸囧畾鏃堕棿娈靛唴浠庢湭寮�杩囬榾鐨勫彇姘村彛鏁伴噺-->
+  <select id="getNeverOpenValveIntakesCount" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    FROM pr_intake inta
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    AND NOT EXISTS(SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop} AND intake_id = inta.id)
+    </select>
+<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴浠庢湭寮�杩囬榾鐨勫彇姘村彛-->
+  <select id="getNeverOpenValveIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake">
+    SELECT
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    blo.name AS blockName
+    FROM pr_intake inta
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    AND NOT EXISTS(SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop} AND intake_id = inta.id)
+    ORDER BY inta.id
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+  <!--鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙f暟閲�-->
+  <select id="getOpenValveGtIntakesCount" resultType="java.lang.Long">
+    select count(*)
+    from    (SELECT
+    COUNT(*) AS recordCount,
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    blo.name AS blockName
+    FROM pr_intake inta
+    LEFT JOIN (SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    GROUP BY intakeId,intakeNum,blockName
+    HAVING recordCount &gt; #{value}) a
+  </select>
+  <!--鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�-->
+  <select id="getOpenValveGtIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount">
+    SELECT
+      COUNT(*) AS recordCount,
+      inta.id AS intakeId,
+      inta.name AS intakeNum,
+      blo.name AS blockName
+    FROM pr_intake inta
+    LEFT JOIN (SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    GROUP BY intakeId,intakeNum,blockName
+    HAVING recordCount &gt; #{value}
+    ORDER BY inta.id
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+  <!--鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙f暟閲�-->
+  <select id="getOpenValveLtIntakesCount" resultType="java.lang.Long">
+    select count(*)
+    from    (SELECT
+    COUNT(*) AS recordCount,
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    blo.name AS blockName
+    FROM pr_intake inta
+    LEFT JOIN (SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    GROUP BY intakeId,intakeNum,blockName
+    HAVING recordCount &lt; #{value}) a
+  </select>
+  <!--鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�-->
+  <select id="getOpenValveLtIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount">
+    SELECT
+    COUNT(*) AS recordCount,
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    blo.name AS blockName
+    FROM pr_intake inta
+    LEFT JOIN (SELECT * FROM rm_open_close_valve_history WHERE op_dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id
+    INNER JOIN ba_block blo ON blo.id = inta.blockId
+    WHERE inta.deleted = 0
+    GROUP BY intakeId,intakeNum,blockName
+    HAVING recordCount &lt; #{value}
+    ORDER BY inta.id
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
 </mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
index 61890c6..fcd8e06 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
@@ -445,10 +445,10 @@
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
       </if>
-      <if test = "timeStart_open != null and timeStop_open != null">
+      <if test = "timeStart_open != null and timeStart_open != '' and timeStop_open != null and  timeStop_open != '' ">
         AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open}
       </if>
-      <if test = "timeStart_close != null and timeStop_close != null">
+      <if test = "timeStart_close != null and timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
         AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
       </if>
     </where>
@@ -510,10 +510,10 @@
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
       </if>
-      <if test = "timeStart_open != null and timeStop_open != null">
+      <if test = "timeStart_open != null and timeStart_open != '' and timeStop_open != null and  timeStop_open != '' ">
         AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open}
       </if>
-      <if test = "timeStart_close != null and timeStop_close != null">
+      <if test = "timeStart_close != null and timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
         AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
       </if>
     </where>
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java
index 2131e44..d17f46c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/report/ReportSv.java
@@ -13,6 +13,8 @@
 import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 
@@ -109,25 +111,35 @@
     public QueryResultVo<List<VoOpenCloseValve>> getOpenCloseValveReports_history(OpenCloseValveQO qo) {
         String timeStart_open = qo.getTimeStart_open();
         String timeStop_open = qo.getTimeStop_open();
-        if(timeStart_open != null) {
+        if(timeStart_open != null && timeStart_open != "") {
             timeStart_open = timeStart_open + " 00:00:00";
-            qo.setTimeStop_open(timeStart_open);
+        } else {
+            timeStart_open = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString();
         }
-        if(timeStop_open != null) {
+        qo.setTimeStop_open(timeStart_open);
+
+        if(timeStop_open != null && timeStop_open != "") {
             timeStop_open = timeStop_open + " 23:59:59";
-            qo.setTimeStop_open(timeStop_open);
+        }else {
+            timeStop_open = LocalDate.now() + " 23:59:59";
         }
+        qo.setTimeStop_open(timeStop_open);
 
         String timeStart_close = qo.getTimeStart_close();
         String timeStop_close = qo.getTimeStop_close();
-        if(timeStart_close != null) {
+        if(timeStart_close != null && timeStart_close != "") {
             timeStart_close = timeStart_close + " 00:00:00";
-            qo.setTimeStart_close(timeStart_close);
+        } else {
+            timeStart_close = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString();
         }
-        if(timeStop_close != null) {
+        qo.setTimeStart_close(timeStart_close);
+
+        if(timeStop_close != null && timeStop_close != "") {
             timeStop_close = timeStop_close + " 23:59:59";
-            qo.setTimeStop_close(timeStop_close);
+        }else {
+            timeStop_close = LocalDate.now() + " 23:59:59";
         }
+        qo.setTimeStop_close(timeStop_close);
 
         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
         Long itemTotal = rmOpenCloseValveHistoryMapper.getOpenCloseValveReportsCount_history(params);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
index c9e3b05..5133da8 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -2,10 +2,13 @@
 
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper;
+import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
 import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
 import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
 import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO;
 import com.dy.pipIrrStatistics.intake.qo.IntakeQO;
+import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +32,8 @@
 public class IntakeSv {
     @Autowired
     private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper;
+    @Autowired
+    private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
 
     /**
      * 鑾峰彇鎸囧畾鏃堕棿娈靛唴鏈笂绾跨殑鍙栨按鍙�
@@ -112,4 +117,117 @@
         rsVo.obj = rmOnHourReportHistoryMapper.getSmallFlowIntakes(params);
         return rsVo ;
     }
+
+    /**
+     * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛
+     * @return
+     */
+    public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(IntakeQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakes(params);
+        return rsVo ;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveGtIntakes(IntakeValueQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveGtIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveGtIntakes(params);
+        return rsVo ;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveLtIntakes(IntakeValueQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveLtIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveLtIntakes(params);
+        return rsVo ;
+    }
 }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
index ac767b9..01bd5ae 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -6,8 +6,10 @@
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
 import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
 import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO;
 import com.dy.pipIrrStatistics.intake.qo.IntakeQO;
+import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO;
 import com.dy.pipIrrStatistics.result.StatisticlResultCode;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -90,4 +92,67 @@
             return BaseResponseUtils.buildException(e.getMessage()) ;
         }
     }
+
+
+    /**
+     * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛
+     * @param
+     * @return
+     */
+    @GetMapping(path = "/getNeverOpenValveIntakes")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(IntakeQO qo) {
+        try {
+            QueryResultVo<List<VoIntake>> res = intakeSv.getNeverOpenValveIntakes(qo);
+            if(res.itemTotal == 0) {
+                return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage());
+            }
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鑾峰彇璁板綍寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param
+     * @return
+     */
+    @GetMapping(path = "/getOpenValveGtIntakes")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveGtIntakes(IntakeValueQO qo) {
+        try {
+            QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveGtIntakes(qo);
+            if(res.itemTotal == 0) {
+                return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage());
+            }
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鑾峰彇璁板綍寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param
+     * @return
+     */
+    @GetMapping(path = "/getOpenValveLtIntakes")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveLtIntakes(IntakeValueQO qo) {
+        try {
+            QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveLtIntakes(qo);
+            if(res.itemTotal == 0) {
+                return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage());
+            }
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鑾峰彇璁板綍寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
 }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeValueQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeValueQO.java
new file mode 100644
index 0000000..bbb1729
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeValueQO.java
@@ -0,0 +1,23 @@
+package com.dy.pipIrrStatistics.intake.qo;
+
+import com.dy.common.webUtil.QueryConditionVo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+/**
+ * @author :WuZeYu
+ * @Date :2024/8/3  9:32
+ * @LastEditTime :2024/8/3  9:32
+ * @Description
+ */
+@Data
+public class IntakeValueQO extends IntakeQO {
+
+
+    /**
+     * 鍊�
+     */
+    @NotBlank(message = "鍊间笉鑳戒负绌�")
+    private int value;
+}

--
Gitblit v1.8.0