| | |
| | | <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, |
| | |
| | | |
| | | |
| | | <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, |