From 0f2f2cfaeb23fc8f84ce13202bbc94fbc5644531 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 14 七月 2025 11:44:02 +0800 Subject: [PATCH] 修改用水户年用水量统计查询中的bug --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientSv.java | 5 +++-- pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountYearMapper.xml | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountYearMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountYearMapper.xml index 3003517..b876386 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountYearMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountYearMapper.xml @@ -151,7 +151,12 @@ mtb.name like concat('%', #{name}, '%') </if> </trim> - order by mtb.id ASC + 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} + </if> + </trim> </select> <select id="selectYearStatistics4OneYear" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountYearRecord"> @@ -206,7 +211,7 @@ where ctb.deleted != 1 <trim prefix="and" suffixOverrides="and"> <if test="year != null"> - cayTb.`year` = #{year,jdbcType=INTEGER} + (cayTb.`year` = #{year,jdbcType=INTEGER} or cayTb.`year` is null) </if> <if test="name != null and name != ''"> and ctb.name like concat('%', #{clientName}, '%') diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientSv.java index 0cacebe..c6fb7af 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientSv.java @@ -111,8 +111,6 @@ itemTotal = stClientAmountYearDao.selectCountYearStatistics4OneYear(params) ; }else{ itemTotal = stClientAmountYearDao.selectCountYearStatistics(params) ; - List<VoStClientIdAmountYearRecord> clientIds = stClientAmountYearDao.selectClientIds4YearStatistics(params); - clientIdsJson = JSON.toJSONString(clientIds) ; } if(itemTotal != null && itemTotal > 0) { @@ -120,6 +118,9 @@ rsQrVo.pageCurr = qo.pageCurr; rsQrVo.calculateAndSet(itemTotal, params); + List<VoStClientIdAmountYearRecord> clientIds = stClientAmountYearDao.selectClientIds4YearStatistics(params); + clientIdsJson = JSON.toJSONString(clientIds) ; + List<VoStClientAmountYearRecords> group = new ArrayList<>(); int count = 1 ; for(int year: yearGrp){ -- Gitblit v1.8.0