无关风月
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
<?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.competition.mapper.ParticipantMapper">
    <select id="getPeopleFromId" resultType="com.dsh.competition.feignclient.model.CompetitionUser">
        select t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state
        from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id
        left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id
        where t1.competitionId =#{id} and t2.id is not null and t3.id is not null
        <if test="state !=null and state !='' and state ==1">
            and t3.payStatus in (1,2)
        </if>
        <if test="state !=null and state !='' and state ==3">
            and t3.payStatus =3
        </if>
    </select>
 
    <select id="getPeopleFromId1" resultType="com.dsh.competition.entity.UserCompetition">
        select * from t_user_competition where competitionId = #{id} and paymentCompetitionId in (
        select id from t_payment_competition where state = 1 and payStatus != 1
        <if test="null != state and state == 1">
            and payStatus = 2
        </if>
        <if test="null != state and state == 3">
            and payStatus = 3
        </if>
        ) order by insertTime desc limit #{offset}, #{limit}
    </select>
 
    <select id="getPeopleFromIdCount" resultType="java.lang.Integer">
        select count(1) from t_user_competition where competitionId = #{id} and paymentCompetitionId in (
        select id from t_payment_competition where state = 1 and payStatus != 1
        <if test="null != state and state == 1">
            and payStatus = 2
        </if>
        <if test="null != state and state == 3">
            and payStatus = 3
        </if>
        )
    </select>
 
 
    <select id="getPeoples" resultType="com.dsh.competition.feignclient.model.CompetitionUser">
        select t2.id, t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state
        from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id
        left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id
        where t1.competitionId =#{id} and t2.id is not null and t3.id is not null
        <if test="state !=null and state !='' and state ==1">
            and t3.payStatus in (1,2)
        </if>
        <if test="state !=null and state !='' and state ==3">
            and t3.payStatus =3
        </if>
    </select>
 
</mapper>