From f79e169e0f00b253e3df4f9e1f3535c8dcad61f9 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 30 七月 2024 17:34:44 +0800
Subject: [PATCH] 完善代码
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
index 69b434b..4def2f1 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
@@ -155,13 +155,65 @@
rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟-->
+ <select id="getRecordCount" resultType="java.lang.Long">
+ select count(*)
+ from rm_intake_amount_day riad
+ Left join pr_intake pint on pint.id = riad.intake_id
+ <where>
+ <if test="intakeName != null">
+ and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
+ </if>
+ <if test="intakeId != null">
+ and riad.intake_id = #{intakeId}
+ </if>
+ <if test="startDt != null">
+ and riad.dt >= #{startDt,jdbcType=DATE}
+ </if>
+ <if test="endDt != null">
+ and riad.dt <= #{endDt,jdbcType=DATE}
+ </if>
+ </where>
+ </select>
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
+ <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
+ select
+ CAST(riad.intake_id AS char)AS intakeId,
+ pint.name as intakeName,
+ riad.dt as dt,
+ riad.amount as amount,
+ riad.dt_last as dtLast,
+ riad.rtu_addr_last as rtuAddrLast,
+ CAST(riad.controller_id_last AS char)AS controllerIdLast,
+ riad.total_amount_last as totalAmountLast,
+ riad.rtu_dt_last as rtuDtLast
+ from rm_intake_amount_day riad
+ Left join pr_intake pint on pint.id = riad.intake_id
+ <where>
+ <if test="intakeName != null">
+ and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
+ </if>
+ <if test="intakeId != null">
+ and riad.intake_id = #{intakeId}
+ </if>
+ <if test="startDt != null">
+ and riad.dt >= #{startDt,jdbcType=DATE}
+ </if>
+ <if test="endDt != null">
+ and riad.dt <= #{endDt,jdbcType=DATE}
+ </if>
+ </where>
+ ORDER BY riad.id DESC
+ <if test="pageCurr != null and pageSize != null">
+ LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
+ </if>
+ </select>
<select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics">
- select intake_id, sum(amount) as amount
+ select intake_id, sum(amount) amount
from rm_intake_amount_day
- where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT}
+ where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
group by intake_id
</select>
-
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0