puzhibing
2023-07-12 aa43a92c7ec9053dbaef92fe5ccb3011b670442c
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
<?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.PaymentCompetitionMapper">
 
 
    <select id="queryMyCompetitionList" resultType="com.dsh.competition.model.CompetitionListVo">
        select
        a.id,
        b.`name`,
        b.coverDrawing,
        b.city as cityName,
        b.registerCondition,
        b.introduction,
        DATE_FORMAT(b.registerEndTime, '%Y-%m-%d %H:%i') as registerEndTime,
        CONCAT(b.startAge, '-', b.endAge) as age,
        b.baseNumber + b.applicantsNumber as heat
        from t_payment_competition a
        left join t_competition b on (a.competitionId = b.id)
        where a.state = 1 and a.appUserId = #{uid} and a.payStatus != 1
        <!--1=未开始,2=进行中,3=已结束,4=已取消-->
        <if test="null != type and 1 == type">
            and b.status = 1
        </if>
        <if test="null != type and 2 == type">
            and b.status = 2
        </if>
        <if test="null != type and 3 == type">
            and b.status = 3
        </if>
        <if test="null != type and 4 == type">
            and a.payStatus = 3
        </if>
        order by a.insertTime desc limit #{pageSize}, #{pageNo}
    </select>
</mapper>