无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.communityWorldCup.mapper.WorldCupPaymentParticipantMapper">
 
 
 
    <select id="getWorldCupPaymentParticipant" resultType="com.dsh.communityWorldCup.entity.WorldCupPaymentParticipant">
        select *
        from t_world_cup_payment_participant
        where worldCupId = #{worldCupId} and participantType = #{participantType} and participantId = #{participantId} and worldCupPaymentId in (
            select id from t_world_cup_payment where worldCupId = #{worldCupId} and payStatus = 2 and state = 1
            ) order by createTime desc limit 0, 1
    </select>
 
 
 
    <select id="getMyWorldCupList" resultType="com.dsh.communityWorldCup.model.WorldCupListVo">
        select
        a.id,
        b.worldCupId,
        c.name,
        DATE_FORMAT(ifnull(c.registrationClosingTime, c.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime,
        CONCAT(c.startAge, '-', c.endAge) as age,
        c.coverImg,
        c.intro as content,
        c.lon,
        c.lat,
        c.basePeople as heat,
        c.status
        from t_world_cup_payment_participant a
        left join t_world_cup_payment b on (a.worldCupPaymentId = b.id)
        left join t_world_cup c on (b.worldCupId = c.id)
        where a.participantType = #{item.isStudent} and a.participantId = #{item.id} and b.payStatus = 2 and b.refundTime is null and b.state = 1
        <if test="null != item.state">
            and c.status = #{item.state}
        </if>
        order by b.createTime desc limit #{item.pageNo}, #{item.pageSize}
    </select>
 
 
 
    <select id="getCount" resultType="int">
        select count(*) from (
          select
          participantId,
          participantType
          from t_world_cup_payment_participant where worldCupId = #{worldCupId} and worldCupPaymentId in
          <foreach collection="worldCupPaymentId" item="item" index="index" open="(" separator="," close=")">
              #{item}
          </foreach>
          group by participantId, participantType
        ) as aa
    </select>
 
 
 
    <select id="getUserGameRecordList" resultType="map">
        select
        participantType,
        participantId,
        appUserId
        from t_world_cup_payment_participant group by participantType, participantId, appUserId
    </select>
</mapper>