From 03bff35b0d011eb7d822ff021c8908566268b95c Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期一, 05 八月 2024 18:58:26 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml | 190 +++++++++++++++++
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java | 74 ++++++
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 | 126 +++++++++++
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java | 8
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml | 117 ++++++++--
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 +
9 files changed, 597 insertions(+), 35 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
index 95e1da3..115539b 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
@@ -178,8 +178,8 @@
* 10:寮�鍏抽榾鍗″叧闃�锛�
* 11:寮�鍏抽榾鍗″埛鍗″崱寮�闃�锛�
* 12:榛戝悕鍗曞懡浠ゅ叧闃�锛�
- * 13:鐢ㄦ埛杩滅▼瀹氭椂鍏抽榾锛�
- * 14:鐢ㄦ埛杩滅▼瀹氶噺鍏抽榾锛�
+ * 13:杩滅▼瀹氭椂鍏抽榾锛�
+ * 14:杩滅▼瀹氶噺鍏抽榾锛�
* )
* @param type 瀛楄妭
* @return 鍚嶇О
@@ -198,8 +198,8 @@
case 10 -> "寮�鍏抽榾鍗″叧闃�";
case 11 -> "寮�鍏抽榾鍗″紑闃�";
case 12 -> "榛戝悕鍗曞懡浠ゅ叧闃�";
- case 13 -> "鐢ㄦ埛杩滅▼瀹氭椂鍏抽榾";
- case 14 -> "鐢ㄦ埛杩滅▼瀹氶噺鍏抽榾";
+ case 13 -> "杩滅▼瀹氭椂鍏抽榾";
+ case 14 -> "杩滅▼瀹氶噺鍏抽榾";
default -> "鏈煡";
};
}
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 b332c90..366c85b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -435,6 +435,30 @@
where id = #{id,jdbcType=BIGINT}
</update>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ュ巻鍙茶褰曟暟閲�-->
+ <select id="getOpenCloseValveReportsCount_history" resultType="java.lang.Long">
+ SELECT
+ COUNT(*) AS recordCount
+ FROM rm_open_close_valve_history oh
+ INNER JOIN pr_intake inta ON inta.id = oh.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND oh.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <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 timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
+ AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
+ </if>
+ </where>
+ </select>
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ュ巻鍙茶褰曟暟閲�-->
<select id="getOpenCloseValveReportsCount_history" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
@@ -528,4 +552,170 @@
</if>
</trim>
</select>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ュ巻鍙茶褰�-->
+ <select id="getOpenCloseValveReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoOpenCloseValve">
+ SELECT
+ oh.intake_id AS intakeId,
+ inta.name AS intakenum,
+ oh.rtu_addr AS rtuAddr,
+ oh.client_name AS clientName,
+ oh.op_ic_card_no AS openIcNum,
+ oh.op_ic_card_addr AS openIcAddr,
+ oh.op_dt AS openTime,
+ CASE
+ WHEN oh.op_type = 1 THEN "鍒峰崱寮�闃�"
+ WHEN oh.op_type = 3 THEN "涓績绔欏紑闃�"
+ WHEN oh.op_type = 5 THEN "娆犺垂鍏抽榾"
+ WHEN oh.op_type = 8 THEN "鐢ㄦ埛杩滅▼寮�闃�"
+ WHEN oh.op_type = 11 THEN "寮�鍏抽榾鍗″紑闃�"
+ ELSE "鏈煡"
+ END AS openType,
+ oh.op_order_no AS openOrderNo,
+ oh.op_total_amount AS openTotalAmount,
+ oh.op_remain_money AS openRemainMoney,
+ oh.op_water_remain_user AS openWaterRemain,
+ oh.op_ele_total_amount AS openEleTotalAmount,
+ oh.cl_ic_card_no AS closeIcNum,
+ oh.cl_ic_card_addr AS closeIcAddr,
+ oh.cl_dt AS closeTime,
+ CASE
+ WHEN oh.cl_type = 2 THEN "鍒峰崱鍏抽榾"
+ WHEN oh.cl_type = 4 THEN "涓績绔欏叧闃�"
+ WHEN oh.cl_type = 5 THEN "娆犺垂鍏抽榾"
+ WHEN oh.cl_type = 6 THEN "娴侀噺璁℃晠闅滃叧闃�"
+ WHEN oh.cl_type = 7 THEN "绱ф�ュ叧闂�"
+ WHEN oh.cl_type = 9 THEN "鐢ㄦ埛杩滅▼鍏抽榾"
+ WHEN oh.cl_type = 10 THEN "寮�鍏抽榾鍗″叧闃�"
+ WHEN oh.cl_type = 12 THEN "榛戝悕鍗曞懡浠ゅ叧闃�"
+ WHEN oh.cl_type = 13 THEN "鐢ㄦ埛杩滅▼瀹氭椂鍏抽榾"
+ WHEN oh.cl_type = 14 THEN "鐢ㄦ埛杩滅▼瀹氶噺鍏抽榾"
+ ELSE "鏈煡"
+ END AS closeType,
+ oh.cl_this_amount AS closeThisAmount,
+ oh.cl_this_time AS thisTime,
+ oh.cl_this_money AS thisMoney,
+ oh.cl_remain_money AS closeRemainMoney,
+ oh.cl_total_amount AS closeTotalAmount
+ FROM rm_open_close_valve_history oh
+ INNER JOIN pr_intake inta ON inta.id = oh.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND oh.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <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 timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
+ AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
+ </if>
+ </where>
+ ORDER BY oh.op_dt DESC
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </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 > #{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 > #{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 < #{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 < #{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 dba5edd..c5a9b85 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
@@ -454,30 +454,101 @@
where id = #{id,jdbcType=BIGINT}
</update>
- <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ユ渶鏂拌褰曟暟閲�-->
- <select id="getOpenCloseValveReportsCount_last" resultType="java.lang.Long">
- SELECT COUNT(*) AS recordCount
- FROM rm_open_close_valve_last oh
- INNER JOIN pr_intake inta ON inta.id = oh.intake_id
- <where>
- <if test="intakeId != null and intakeId > 0">
- AND oh.intake_id = #{intakeId}
- </if>
- <if test="intakeNum != null and intakeNum != ''">
- AND inta.name LIKE CONCAT('%', #{intakeNum}, '%')
- </if>
- <if test="rtuAddr != null and rtuAddr != ''">
- AND oh.rtu_addr LIKE CONCAT('%', #{rtuAddr}, '%')
- </if>
- <if test="timeStart_open != null and timeStop_open != null">
- AND oh.op_dt BETWEEN #{timeStart_open} AND #{timeStop_open}
- </if>
- <if test="timeStart_close != null and timeStop_close != null">
- AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
- </if>
- </where>
- </select>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ユ渶鏂拌褰曟暟閲�-->
+ <select id="getOpenCloseValveReportsCount_last" resultType="java.lang.Long">
+ SELECT
+ COUNT(*) AS recordCount
+ FROM rm_open_close_valve_last oh
+ INNER JOIN pr_intake inta ON inta.id = oh.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND oh.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <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 timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
+ AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
+ </if>
+ </where>
+ </select>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ユ渶鏂拌褰�-->
+ <select id="getOpenCloseValveReports_last" resultType="com.dy.pipIrrGlobal.voRm.VoOpenCloseValve">
+ SELECT
+ oh.intake_id AS intakeId,
+ inta.name AS intakeNum,
+ oh.rtu_addr AS rtuAddr,
+ oh.client_name AS clientName,
+ oh.op_ic_card_no AS openIcNum,
+ oh.op_ic_card_addr AS openIcAddr,
+ oh.op_dt AS openTime,
+ CASE
+ WHEN oh.op_type = 1 THEN "鍒峰崱寮�闃�"
+ WHEN oh.op_type = 3 THEN "涓績绔欏紑闃�"
+ WHEN oh.op_type = 5 THEN "娆犺垂鍏抽榾"
+ WHEN oh.op_type = 8 THEN "鐢ㄦ埛杩滅▼寮�闃�"
+ WHEN oh.op_type = 11 THEN "寮�鍏抽榾鍗″紑闃�"
+ ELSE "鏈煡"
+ END AS openType,
+ oh.op_order_no AS openOrderNo,
+ oh.op_total_amount AS openTotalAmount,
+ oh.op_remain_money AS openRemainMoney,
+ oh.op_water_remain_user AS openWaterRemain,
+ oh.op_ele_total_amount AS openEleTotalAmount,
+ oh.cl_ic_card_no AS closeIcNum,
+ oh.cl_ic_card_addr AS closeIcAddr,
+ oh.cl_dt AS closeTime,
+ CASE
+ WHEN oh.cl_type = 2 THEN "鍒峰崱鍏抽榾"
+ WHEN oh.cl_type = 4 THEN "涓績绔欏叧闃�"
+ WHEN oh.cl_type = 5 THEN "娆犺垂鍏抽榾"
+ WHEN oh.cl_type = 6 THEN "娴侀噺璁℃晠闅滃叧闃�"
+ WHEN oh.cl_type = 7 THEN "绱ф�ュ叧闂�"
+ WHEN oh.cl_type = 9 THEN "鐢ㄦ埛杩滅▼鍏抽榾"
+ WHEN oh.cl_type = 10 THEN "寮�鍏抽榾鍗″叧闃�"
+ WHEN oh.cl_type = 12 THEN "榛戝悕鍗曞懡浠ゅ叧闃�"
+ WHEN oh.cl_type = 13 THEN "鐢ㄦ埛杩滅▼瀹氭椂鍏抽榾"
+ WHEN oh.cl_type = 14 THEN "鐢ㄦ埛杩滅▼瀹氶噺鍏抽榾"
+ ELSE "鏈煡"
+ END AS closeType,
+ oh.cl_this_amount AS closeThisAmount,
+ oh.cl_this_time AS thisTime,
+ oh.cl_this_money AS thisMoney,
+ oh.cl_remain_money AS closeRemainMoney,
+ oh.cl_total_amount AS closeTotalAmount
+ FROM rm_open_close_valve_last oh
+ INNER JOIN pr_intake inta ON inta.id = oh.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND oh.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <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 timeStart_close != '' and timeStop_close != null and timeStop_close != '' ">
+ AND oh.cl_dt BETWEEN #{timeStart_close} AND #{timeStop_close}
+ </if>
+ </where>
+ ORDER BY oh.op_dt DESC
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇寮�鍏抽榾鎶ユ渶鏂拌褰�-->
<select id="getOpenCloseValveReports_last" resultType="com.dy.pipIrrGlobal.voRm.VoOpenCloseValve">
SELECT oh.intake_id AS intakeId,
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 c248646..24b04e4 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,21 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper;
+import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
import com.dy.pipIrrGlobal.daoRm.RmOnHourReportLastMapper;
import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper;
import com.dy.pipIrrGlobal.voSt.*;
import com.dy.pipIrrStatistics.intake.qo.*;
+import com.dy.pipIrrGlobal.voSt.VoBatteryVolt;
+import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
+import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
+import com.dy.pipIrrGlobal.voSt.VoSignalIntensity;
+import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO;
+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.intake.qo.SignalIntensityQO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +41,8 @@
public class IntakeSv {
@Autowired
private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper;
+ @Autowired
+ private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
@Autowired
private RmOnHourReportLastMapper rmOnHourReportLastMapper;
@@ -177,6 +190,119 @@
}
/**
+ * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛
+ * @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 ;
+ }
+
+ /**
* 鏍规嵁寮�闃�绫诲瀷鑾峰彇鎿嶄綔娆℃暟
* @param qo
* @return
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 57374a7..1353e04 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,6 +6,17 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.voSt.*;
import com.dy.pipIrrStatistics.intake.qo.*;
+import com.dy.pipIrrGlobal.voSt.VoBatteryVolt;
+import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
+import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoSignalIntensity;
+import com.dy.pipIrrStatistics.intake.qo.BatteryVoltQO;
+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.SignalIntensityQO;
+import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO;
+import com.dy.pipIrrStatistics.result.StatisticlResultCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
@@ -139,4 +150,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