From d4c8e72800fcf6fbaa3804d383c7b6a23f826f3e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 八月 2025 14:35:00 +0800
Subject: [PATCH] 修改bug
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml | 308 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 298 insertions(+), 10 deletions(-)
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 e6cad81..bf62b09 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -789,17 +789,17 @@
SELECT COUNT(*)
FROM se_client cli
inner join (
- SELECT client_id, COUNT(*) AS openCount
- FROM rm_open_close_valve_history
- <where>
- <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
- op_dt BETWEEN #{timeStart} AND #{timeStop}
+ SELECT client_id, COUNT(*) AS openCount
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="openCount != null and openCount > 0">
+ having openCount < #{openCount}
</if>
- </where>
- group by client_id
- <if test="openCount != null and openCount > 0">
- having openCount < #{openCount}
- </if>
) as his on his.client_id = cli.id
</select>
<!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
@@ -887,6 +887,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按閲忚秴杩囨寚瀹氬�肩殑鍐滄埛鏁伴噺-->
<select id="getLargeWaterConsumptionClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_amount) AS waterConsumption
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterConsumption != null and waterConsumption > 0">
+ having waterConsumption > #{waterConsumption}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeWaterConsumptionClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -901,6 +919,36 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按閲忚秴杩囨寚瀹氬�肩殑鍐滄埛-->
<select id="getLargeWaterConsumptionClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.waterConsumption
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_amount) AS waterConsumption
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterConsumption != null and waterConsumption > 0">
+ having waterConsumption > #{waterConsumption}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeWaterConsumptionClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
@@ -935,6 +983,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按閲忎綆浜庢寚瀹氬�肩殑鍐滄埛鏁伴噺-->
<select id="getSmallWaterConsumptionClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_amount) AS waterConsumption
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterConsumption != null and waterConsumption > 0">
+ having waterConsumption < #{waterConsumption}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallWaterConsumptionClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -949,6 +1015,36 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按閲忎綆浜庢寚瀹氬�肩殑鍐滄埛-->
<select id="getSmallWaterConsumptionClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.waterConsumption
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_amount) AS waterConsumption
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterConsumption != null and waterConsumption > 0">
+ having waterConsumption < #{waterConsumption}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallWaterConsumptionClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
@@ -983,6 +1079,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴娑堣垂閲戦瓒呰繃鎸囧畾鍊肩殑鍐滄埛鏁伴噺-->
<select id="getLargeAmountSpentClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_money) AS amountSpent
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="amountSpent != null and amountSpent > 0">
+ having amountSpent > #{amountSpent}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeAmountSpentClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -996,6 +1110,36 @@
</select>
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴娑堣垂閲戦瓒呰繃鎸囧畾鍊肩殑鍐滄埛-->
<select id="getLargeAmountSpentClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.amountSpent
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_money) AS amountSpent
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="amountSpent != null and amountSpent > 0">
+ having amountSpent > #{amountSpent}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeAmountSpentClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
@@ -1030,6 +1174,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴娑堣垂閲戦浣庝簬鎸囧畾鍊肩殑鍐滄埛鏁伴噺-->
<select id="getSmallAmountSpentClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_money) AS amountSpent
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="amountSpent != null and amountSpent > 0">
+ having amountSpent < #{amountSpent}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallAmountSpentClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -1043,6 +1205,36 @@
</select>
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴娑堣垂閲戦浣庝簬鎸囧畾鍊肩殑鍐滄埛-->
<select id="getSmallAmountSpentClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.amountSpent
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_money) AS amountSpent
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="amountSpent != null and amountSpent > 0">
+ having amountSpent < #{amountSpent}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallAmountSpentClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
@@ -1077,6 +1269,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按鏃堕暱瓒呰繃鎸囧畾鍊肩殑鍐滄埛鏁伴噺-->
<select id="getLargeWaterDurationClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_time) AS waterDuration
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterDuration != null and waterDuration > 0">
+ having waterDuration > #{waterDuration}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeWaterDurationClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -1091,6 +1301,36 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按鏃堕暱瓒呰繃鎸囧畾鍊肩殑鍐滄埛-->
<select id="getLargeWaterDurationClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.waterDuration
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_time) AS waterDuration
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterDuration != null and waterDuration > 0">
+ having waterDuration > #{waterDuration}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getLargeWaterDurationClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
@@ -1125,6 +1365,24 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按鏃堕暱浣庝簬鎸囧畾鍊肩殑鍐滄埛鏁伴噺-->
<select id="getSmallWaterDurationClientsCount" resultType="java.lang.Long">
+ SELECT COUNT(*)
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_time) AS waterDuration
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterDuration != null and waterDuration > 0">
+ having waterDuration < #{waterDuration}
+ </if>
+ ) as his on his.client_id = cli.id
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallWaterDurationClientsCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM se_client cli
<where>
@@ -1139,6 +1397,36 @@
<!--鑾峰彇鎸囧畾鏃堕棿娈靛唴鐢ㄦ按鏃堕暱浣庝簬鎸囧畾鍊肩殑鍐滄埛-->
<select id="getSmallWaterDurationClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
+ SELECT cli.id AS clientId,
+ cli.name AS clientName,
+ cli.clientNum,
+ cli.address,
+ cli.phone,
+ cli.idCard,
+ his.waterDuration
+ FROM se_client cli
+ inner join (
+ SELECT client_id, SUM(cl_this_time) AS waterDuration
+ FROM rm_open_close_valve_history
+ <where>
+ <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
+ op_dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ group by client_id
+ <if test="waterDuration != null and waterDuration > 0">
+ having waterDuration < #{waterDuration}
+ </if>
+ ) as his on his.client_id = cli.id
+ ORDER BY cli.id
+ <trim prefix="limit ">
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+ <!-- 2025-07-29 涓嬮潰SQL鏌ヨ澶參锛屽簾寮� -->
+ <select id="_getSmallWaterDurationClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
SELECT cli.id AS clientId,
cli.name AS clientName,
cli.clientNum,
--
Gitblit v1.8.0