puzhibing
2023-07-10 e899587f6d4abdc299b82bed0c043f88276a64c3
cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml
@@ -1,4 +1,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>