Commit b84fff36 by giaogiao

修改排名bug

parent b7724893
......@@ -15,11 +15,11 @@
<description>项目启动模块</description>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring-boot-admin.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.codecentric</groupId>-->
<!-- <artifactId>spring-boot-admin-starter-client</artifactId>-->
<!-- <version>${spring-boot-admin.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.geekidea.springbootplus</groupId>
<artifactId>framework</artifactId>
......
......@@ -24,13 +24,18 @@
</select>
<select id="getDonationRankAndTotal" resultType="com.sien.common.vo.DonationRankAndTotal">
SELECT
tb.*,
@curRank := @curRank + 1 AS rank
*
FROM
( SELECT fk_user_id, sum( money ) AS drTotal FROM donation_record WHERE donation_record.pay_status = 1 GROUP BY fk_user_id ORDER BY drTotal DESC ) AS tb,
( SELECT @curRank := 0 ) r
(
SELECT
tb.*,
@curRank := @curRank + 1 AS rank
FROM
( SELECT fk_user_id, sum( money ) AS drTotal FROM donation_record WHERE donation_record.pay_status = 1 GROUP BY fk_user_id ORDER BY drTotal DESC ) AS tb,
( SELECT @curRank := 0 ) r
) AS abc
WHERE
fk_user_id = #{userId}
abc.fk_user_id = #{userId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment