From c0721ee39952b48f9c46e15f0da16ad0e17f10c4 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 13 Jan 2021 13:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E8=BE=B9=E5=85=9A=E5=91=98=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=8E=92=E5=BA=8Fsql=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E7=9B=B8=E5=90=8C=E7=9A=84=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/UserPointStatisticalDailyDao.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index 4267a9c74f..983301e016 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -133,11 +133,15 @@ SELECT - @curRank := @curRank + 1 AS ranking, + IF ( @point > p.point, + @curRank := @curRank + 1, + @curRank := @curRank + 0 + ) AS ranking, + @point := p.point, P.userId, P.point FROM( @@ -161,7 +169,7 @@ FROM user_point_action_log pl WHERE pl.DEL_FLAG = '0' AND DATE_FORMAT(pl.CREATED_TIME, '%Y%m')= DATE_FORMAT( CURDATE( ) , '%Y%m' ) AND pl.action_flag = 'plus' GROUP BY pl.USER_ID - ) P, ( SELECT @curRank := #{pageNo} * #{pageSize} ) r + ) P, ( SELECT @curRank := #{pageNo} + 1 ) r WHERE userId IN