From b8470f5e90d0aed22bf2c4bf9f5d2a13cd60b15f Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 30 十二月 2024 14:03:41 +0800 Subject: [PATCH] 1、统计模块实现农户日用水量纵转横转存,月、年用水量统计; 2、临时模块农户日用水量纵转横转存,月、年用水量统计; --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 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 cd1e7c5..60fc47a 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml @@ -1187,12 +1187,36 @@ <!-- ////////////////////////////////// --> <!-- 缁熻鐩稿叧 --> <!-- ////////////////////////////////// --> - <select id="selectByClientIdAndYearAndMonthAndDay" resultType="com.dy.pipIrrGlobal.pojoSt.StClientAmountDay"> + <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics"> + select client_id as clientId, + sum( + IFNULL(amount1,0) + IFNULL(amount2,0) + IFNULL(amount3,0) + IFNULL(amount4,0) + IFNULL(amount5,0) + IFNULL(amount6,0) + IFNULL(amount7,0) + IFNULL(amount8,0) + IFNULL(amount9,0) + + IFNULL(amount10,0) + IFNULL(amount11,0) + IFNULL(amount12,0) + IFNULL(amount13,0) + IFNULL(amount14,0) + IFNULL(amount15,0) + IFNULL(amount16,0) + IFNULL(amount17,0) + IFNULL(amount18,0) + IFNULL(amount19,0) + + IFNULL(amount20,0) + IFNULL(amount21,0) + IFNULL(amount22,0) + IFNULL(amount23,0) + IFNULL(amount24,0) + IFNULL(amount25,0) + IFNULL(amount26,0) + IFNULL(amount27,0) + IFNULL(amount28,0) + IFNULL(amount29,0) + + IFNULL(amount30,0) + IFNULL(amount31,0) + ) as amount, + sum( + IFNULL(money1,0) + IFNULL(money2,0) + IFNULL(money3,0) + IFNULL(money4,0) + IFNULL(money5,0) + IFNULL(money6,0) + IFNULL(money7,0) + IFNULL(money8,0) + IFNULL(money9,0) + + IFNULL(money10,0) + IFNULL(money11,0) + IFNULL(money12,0) + IFNULL(money13,0) + IFNULL(money14,0) + IFNULL(money15,0) + IFNULL(money16,0) + IFNULL(money17,0) + IFNULL(money18,0) + IFNULL(money19,0) + + IFNULL(money20,0) + IFNULL(money21,0) + IFNULL(money22,0) + IFNULL(money23,0) + IFNULL(money24,0) + IFNULL(money25,0) + IFNULL(money26,0) + IFNULL(money27,0) + IFNULL(money28,0) + IFNULL(money29,0) + + IFNULL(money30,0) + IFNULL(money31,0) + ) as money, + sum( + IFNULL(times1,0) + IFNULL(times2,0) + IFNULL(times3,0) + IFNULL(times4,0) + IFNULL(times5,0) + IFNULL(times6,0) + IFNULL(times7,0) + IFNULL(times8,0) + IFNULL(times9,0) + + IFNULL(times10,0) + IFNULL(times11,0) + IFNULL(times12,0) + IFNULL(times13,0) + IFNULL(times14,0) + IFNULL(times15,0) + IFNULL(times16,0) + IFNULL(times17,0) + IFNULL(times18,0) + IFNULL(times19,0) + + IFNULL(times20,0) + IFNULL(times21,0) + IFNULL(times22,0) + IFNULL(times23,0) + IFNULL(times24,0) + IFNULL(times25,0) + IFNULL(times26,0) + IFNULL(times27,0) + IFNULL(times28,0) + IFNULL(times29,0) + + IFNULL(times30,0) + IFNULL(times31,0) + ) as times + from st_client_amount_day + where year = #{year, jdbcType=INTEGER} + and month = #{month, jdbcType=INTEGER} + group by client_id + </select> + <select id="selectByYearAndMonthAndDay" resultType="com.dy.pipIrrGlobal.pojoSt.StClientAmountDay"> select <include refid="Base_Column_List" /> from st_client_amount_day - where client_id = #{clientId,jdbcType=BIGINT} - and year = #{year,jdbcType=INTEGER} + where year = #{year,jdbcType=INTEGER} and month = #{month,jdbcType=INTEGER} </select> -- Gitblit v1.8.0