From daa7c1b49bec0e07aa94ffedcb410ddeed2f4c61 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 21 一月 2025 10:26:19 +0800
Subject: [PATCH] 取水统合数据功能部分实现
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmTimingReportHistoryMapper.xml | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmTimingReportHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmTimingReportHistoryMapper.xml
index 8b2b2e0..a2650e4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmTimingReportHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmTimingReportHistoryMapper.xml
@@ -219,4 +219,65 @@
battery_volt = #{batteryVolt,jdbcType=FLOAT}
where id = #{id,jdbcType=BIGINT}
</update>
+
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇瀹氭椂鎶ュ巻鍙茶褰曟暟閲�-->
+ <select id="getTimingReportsCount_history" resultType="java.lang.Long">
+ SELECT
+ COUNT(*) AS recordCount
+ FROM rm_timing_report_history tim
+ INNER JOIN pr_intake inta ON inta.id = tim.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND tim.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND tim.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <if test = "timeStart != null and timeStop != null">
+ AND tim.dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ </select>
+
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇瀹氭椂鎶ュ巻鍙茶褰�-->
+ <select id="getTimingReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoTiming">
+ SELECT
+ tim.intake_id AS intakeId,
+ inta.name AS intakenum,
+ tim.rtu_addr AS rtuAddr,
+ tim.dt AS receiveTime,
+ tim.water_total_amount_year AS waterTotalAmountYear,
+ tim.water_total_amount_meter AS waterTotalAmountMeter,
+ tim.ele_total_amount_year AS eleTotalAmountYear,
+ tim.ele_total_amount_meter AS eleTotalAmountMeter,
+ tim.water_total_amount_day AS waterTotalAmountDay,
+ tim.water_user_total_amount_day AS waterUserTotalAmountDay,
+ tim.loss_total_amount_day AS lossTotalAmountDay,
+ tim.battery_volt AS batteryVolt
+ FROM rm_timing_report_history tim
+ INNER JOIN pr_intake inta ON inta.id = tim.intake_id
+ <where>
+ <if test="intakeId != null and intakeId >0">
+ AND tim.intake_id = #{intakeId}
+ </if>
+ <if test = "intakeNum != null and intakeNum !=''">
+ AND inta.name LIKE CONCAT('%',#{intakeNum},'%')
+ </if>
+ <if test = "rtuAddr != null and rtuAddr !=''">
+ AND tim.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%')
+ </if>
+ <if test = "timeStart != null and timeStop != null">
+ AND tim.dt BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ ORDER BY tim.dt DESC, tim.loss_total_amount_day DESC
+ <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
--
Gitblit v1.8.0