44323
2024-03-13 eadc1f646e81e8ffbe940b13163aee9d107d6663
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupCompetitorMapper.xml
@@ -13,7 +13,7 @@
            participantId,
            count(*) as num
            from t_world_cup_competitor
            where DATE_FORMAT(NOW(), '%Y-%m-%d') = DATE_FORMAT(startTime, '%Y-%m-%d')
            where matchResult is not null and DATE_FORMAT(NOW(), '%Y') = DATE_FORMAT(startTime, '%Y')
            <if test="null != appUserIds and appUserIds.size() > 0">
                and appUserId in
                <foreach collection="appUserIds" item="item" index="index" open="(" separator="," close=")">
@@ -21,7 +21,7 @@
                </foreach>
            </if>
            group by participantType, participantId
        ) as aa order by aa.num desc
        ) as aa order by aa.num desc,aa.participantId
    </select>
@@ -36,7 +36,7 @@
            (a.participationIntegral + a.winIntegral) as award
        from t_world_cup_competitor a
        left join t_world_cup b on (a.worldCupId = b.id)
        where a.participantId = #{item.id} and a.participantType = #{item.isStudent}
        where a.matchResult is not null and a.participantId = #{item.id} and a.participantType = #{item.isStudent}
        order by a.startTime desc limit #{item.pageNo}, #{item.pageSize}
    </select>
@@ -97,10 +97,10 @@
            ) as b on (a.participantId = b.participantId and a.participantType = b.participantType)
        ) as aa
        <if test="null != item.sort and item.sort == 1">
            order by aa.totalSession desc
            order by aa.totalSession desc,aa.participantId
        </if>
        <if test="null != item.sort and item.sort == 2">
            order by aa.winRate desc
            order by aa.winRate desc,aa.participantId
        </if>
    </select>
@@ -279,4 +279,10 @@
            group by participantType, participantId, appUserId
        ) as b on (a.participantId = b.participantId and a.participantType = b.participantType)
    </select>
    <select id="getMatchTime" resultType="int">
        select count(*) as matchTime from (select code from t_world_cup_competitor where worldCupId = #{worldCupId} group by code) as b
    </select>
</mapper>