From 24f91c6e8b6a5e5be813e0b740dec3d381abe254 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 06 一月 2025 10:56:50 +0800
Subject: [PATCH] 农户用水月统计、年统计查询实现

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
index 4bd6635..a6fa3e8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
@@ -117,7 +117,6 @@
     times30, amount31, money31, times31
   </sql>
   <sql id="Base_Column_List_with_alias">
-    <!--@mbg.generated-->
     ${alias}.id, ${alias}.client_id, ${alias}.`year`, ${alias}.`month`, ${alias}.amount1, ${alias}.money1, ${alias}.times1, ${alias}.amount2, ${alias}.money2, ${alias}.times2,
     ${alias}.amount3, ${alias}.money3, ${alias}.times3, ${alias}.amount4, ${alias}.money4, ${alias}.times4, ${alias}.amount5, ${alias}.money5, ${alias}.times5, ${alias}.amount6,
     ${alias}.money6, ${alias}.times6, ${alias}.amount7, ${alias}.money7, ${alias}.times7, ${alias}.amount8, ${alias}.money8, ${alias}.times8, ${alias}.amount9, ${alias}.money9,
@@ -1207,24 +1206,27 @@
     select
     count(*)
     from se_client mtb
-    <where>
+    where mtb.deleted != 0
+    <trim prefix="and" suffixOverrides="and">
       <if test="name != null and name != ''">
         mtb.name like concat('%', #{name}, '%')
       </if>
-    </where>
+    </trim>
   </select>
 
   <select id="selectDayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountDay">
     select
+    mtb.id as clientId,
     mtb.clientNum as clientNum,
-    mtb.phone as clientPhone,
+    mtb.name as clientName,
     mtb.address as clientAddress,
     <include refid="Base_Column_List_with_alias" >
       <property name="alias" value="stTb"/>
     </include>
     from se_client mtb
     LEFT JOIN st_client_amount_day stTb on stTb.client_id = mtb.id
-    <where>
+    where mtb.deleted != 0
+    <trim prefix="and" suffixOverrides="and">
       <if test = "year != null">
         stTb.year = #{year, jdbcType=INTEGER}
       </if>
@@ -1234,8 +1236,8 @@
       <if test="name != null and name != ''">
         AND mtb.name like concat('%', #{name}, '%')
       </if>
-    </where>
-    order by mtb.id ASC
+    </trim>
+    order by mtb.id DESC
     <trim prefix="limit " >
       <if test="start != null and count != null">
         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}

--
Gitblit v1.8.0