puzhibing
2024-03-08 2a3d0885c11a73d41fb03c985f0032086cd8fa07
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupCompetitorMapper.xml
@@ -3,7 +3,11 @@
<mapper namespace="com.dsh.communityWorldCup.mapper.WorldCupCompetitorMapper">
    <select id="getNumberOfGamesRanked" resultType="map">
        select * from (
        select
        aa.participantType,
        aa.participantId,
        aa.num
        from (
            select
            CASE WHEN participantType = 2 THEN 0 ELSE 1 END as participantType,
            participantId,
@@ -40,13 +44,19 @@
    <select id="getWorldCupRank" resultType="java.util.Map">
        select * from (
        select
        aa.participantType,
        aa.participantId,
        aa.appUserId,
        aa.winRate,
        aa.totalSession
        from (
            select
            a.participantType,
            a.participantId,
            a.appUserId,
            a.num as totalSession,
            (ifnull(b.num, 0) / a.num * 100) as winRate
            ifnull(a.num, 0) as totalSession,
            (ifnull(b.num, 0) / ifnull(a.num, 0) * 100) as winRate
            from (
                select
                participantType,