| | |
| | | group by participantType, participantId, appUserId |
| | | } as aa |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="worldCupGameStatisticsInfoList" resultType="map"> |
| | | select * from ( |
| | | select |
| | | a.participantType, |
| | | a.participantId, |
| | | a.appUserId, |
| | | a.num as totalSession, |
| | | ifnull(b.num, 0) as win, |
| | | (ifnull(b.num, 0) / a.num * 100) as winRate |
| | | from ( |
| | | select |
| | | participantType, |
| | | participantId, |
| | | appUserId, |
| | | count(*) as num |
| | | from t_world_cup_competitor |
| | | where worldCupId = #{worldCupId} group by participantType, participantId, appUserId |
| | | ) as a |
| | | left join ( |
| | | select |
| | | participantType, |
| | | participantId, |
| | | appUserId, |
| | | count(*) as num |
| | | from t_world_cup_competitor |
| | | where matchResult = 1 and worldCupId = #{worldCupId} group by participantType, participantId, appUserId |
| | | ) as b on (a.participantId = b.participantId and a.participantType = b.participantType) |
| | | ) as aa order by aa.totalSession desc |
| | | </select> |
| | | </mapper> |