puzhibing
2024-03-04 7e7f901b2172281dc294dfbc67e6ad00625f09f4
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
<?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
            )
    </select>
 
 
 
    <select id="getMyWorldCupList" resultType="com.dsh.communityWorldCup.model.WorldCupListVo">
        select
        a.id,
        c.name,
        DATE_FORMATc.registrationClosingTime, '%Y-%m-%d %H:%i') as registrationClosingTime,
        CONCAT(c.startAge, '-', c.endAge) as age,
        c.coverImg,
        c.intro as content,
        c.lon,
        c.lat,
        ifnull(d.num, 0) + c.basePeople as heat
        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)
        left join (select worldCupId, count(*) as num from t_world_cup_payment_participant where worldCupPaymentId in (select id from t_world_cup_payment where payStatus = 2 and refundTime is null and state = 1) group by worldCupId) d on (c.id = d.worldCupId)
        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>
</mapper>