| | |
| | | appUserId, |
| | | count(*) as num |
| | | from t_world_cup_competitor |
| | | where worldCupId = #{worldCupId} group by participantType, participantId, appUserId |
| | | where 1 = 1 |
| | | <if test="null != worldCupId"> |
| | | and worldCupId = #{worldCupId} |
| | | </if> |
| | | group by participantType, participantId, appUserId |
| | | ) as a |
| | | left join ( |
| | | select |
| | |
| | | appUserId, |
| | | count(*) as num |
| | | from t_world_cup_competitor |
| | | where matchResult = 1 and worldCupId = #{worldCupId} group by participantType, participantId, appUserId |
| | | where matchResult = 1 |
| | | <if test="null != worldCupId"> |
| | | and worldCupId = #{worldCupId} |
| | | </if> |
| | | 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> |