Commit b84fff36 by giaogiao

修改排名bug

parent b7724893
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<description>项目启动模块</description> <description>项目启动模块</description>
<dependencies> <dependencies>
<dependency> <!-- <dependency>-->
<groupId>de.codecentric</groupId> <!-- <groupId>de.codecentric</groupId>-->
<artifactId>spring-boot-admin-starter-client</artifactId> <!-- <artifactId>spring-boot-admin-starter-client</artifactId>-->
<version>${spring-boot-admin.version}</version> <!-- <version>${spring-boot-admin.version}</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>io.geekidea.springbootplus</groupId> <groupId>io.geekidea.springbootplus</groupId>
<artifactId>framework</artifactId> <artifactId>framework</artifactId>
......
...@@ -24,13 +24,18 @@ ...@@ -24,13 +24,18 @@
</select> </select>
<select id="getDonationRankAndTotal" resultType="com.sien.common.vo.DonationRankAndTotal"> <select id="getDonationRankAndTotal" resultType="com.sien.common.vo.DonationRankAndTotal">
SELECT SELECT
*
FROM
(
SELECT
tb.*, tb.*,
@curRank := @curRank + 1 AS rank @curRank := @curRank + 1 AS rank
FROM 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 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 @curRank := 0 ) r
) AS abc
WHERE WHERE
fk_user_id = #{userId} abc.fk_user_id = #{userId}
</select> </select>
</mapper> </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