From 60fe15f3a5e572b5393374c741cf645966e54cde Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 29 七月 2025 14:26:35 +0800 Subject: [PATCH] 修改农户开关阀次数统计中的bug --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml | 52 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 20 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 3c10897..f27912b 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml @@ -692,11 +692,14 @@ SELECT COUNT(*) AS recordCount FROM se_client cli <where> - <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null"> - (SELECT COUNT(*) - FROM rm_open_close_valve_history his - WHERE his.client_id = cli.id + (SELECT COUNT(*) + FROM rm_open_close_valve_history his + WHERE his.client_id = cli.id + <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount} + </if> + <if test="openCount != null"> + > #{openCount} </if> </where> </select> @@ -714,16 +717,19 @@ <where> his.client_id = cli.id <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> - AND his.op_dt BETWEEN #{timeStart} AND #{timeStop} + AND his.op_dt BETWEEN #{timeStart} AND #{timeStop} </if> </where>) AS openCount FROM se_client cli <where> - <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null"> - (SELECT COUNT(*) - FROM rm_open_close_valve_history his - WHERE his.client_id = cli.id - AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount} + (SELECT COUNT(*) + FROM rm_open_close_valve_history his + WHERE his.client_id = cli.id + <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> + AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount} + </if> + <if test="openCount != null"> + > #{openCount} </if> </where> ORDER BY cli.id @@ -739,11 +745,14 @@ SELECT COUNT(*) AS recordCount FROM se_client cli <where> - <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null"> - (SELECT COUNT(*) - FROM rm_open_close_valve_history his - WHERE his.client_id = cli.id - AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) < #{openCount} + (SELECT COUNT(*) + FROM rm_open_close_valve_history his + WHERE his.client_id = cli.id + <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> + AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount} + </if> + <if test="openCount != null"> + < #{openCount} </if> </where> </select> @@ -766,11 +775,14 @@ </where>) AS openCount FROM se_client cli <where> - <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null"> - (SELECT COUNT(*) - FROM rm_open_close_valve_history his - WHERE his.client_id = cli.id - AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) < #{openCount} + (SELECT COUNT(*) + FROM rm_open_close_valve_history his + WHERE his.client_id = cli.id + <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> + AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount} + </if> + <if test="openCount != null"> + < #{openCount} </if> </where> ORDER BY cli.id -- Gitblit v1.8.0