puzhibing
2024-01-30 80b3ea5587ff7ec20541d9ca7c6c28739e4d615b
cloud-server-competition/src/main/resources/mapper/ParticipantMapper.xml
@@ -14,18 +14,43 @@
        </if>
    </select>
    <select id="getPeopleFromId1" 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)
    <select id="getPeopleFromId1" resultType="com.dsh.competition.entity.UserCompetition">
        select * from (
        select
        a.*
        from t_user_competition a
        left join t_payment_competition b on (a.paymentCompetitionId = b.id)
        where b.state = 1 and b.payStatus != 1 and a.competitionId = #{id}
        <if test="null != state and state == 1">
            and b.payStatus = 2
        </if>
        <if test="state !=null and state !='' and state ==3">
            and t3.payStatus =3
        <if test="null != state and state == 3">
            and b.payStatus = 3
        </if>
        group by a.id
        ) as aa where aa.id is not null order by aa.insertTime desc limit #{offset}, #{limit}
    </select>
    <select id="getPeopleFromIdCount" resultType="java.lang.Integer">
        select
        count(*)
        from (
        select
        a.id
        from t_user_competition a
        left join t_payment_competition b on (a.paymentCompetitionId = b.id)
        where b.state = 1 and b.payStatus != 1 and a.competitionId = #{id}
        <if test="null != state and state == 1">
            and b.payStatus = 2
        </if>
        <if test="null != state and state == 3">
            and b.payStatus = 3
        </if>
        group by a.id
        ) as aa where aa.id is not null
    </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