puzhibing
2023-11-25 7fe6d026bcc8f993ce76437d01607e591cc671fe
cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml
@@ -5,7 +5,7 @@
    <delete id="deleteTenMinutes">
        delete from t_user_competition
            where paymentCompetitionId in
        where paymentCompetitionId in
        <foreach collection="pays" item="pay" separator="," open="(" close=")">
            #{pay}
        </foreach>
@@ -37,26 +37,26 @@
        CONCAT(a.startAge, '-', a.endAge) AS age,
        a.baseNumber,
        CASE
        WHEN NOW() &lt; a.startTime THEN 1  -- 未开始
        WHEN now() between a.startTime and a.endTime THEN 2  -- 进行中
        ELSE 3  -- 已结束
        WHEN NOW() &lt; a.startTime THEN 1 -- 未开始
        WHEN now() between a.startTime and a.endTime THEN 2 -- 进行中
        ELSE 3 -- 已结束
        END AS status
        FROM
        t_competition a
        WHERE
        a.auditStatus = 2 and a.status != 4
        AND a.state = 1
            <if test="null != cityCode and '' != cityCode">
                and a.cityCode = #{cityCode}
            </if>
            <if test="null != content and '' != content">
                and a.name like CONCAT('%', #{content}, '%')
            </if>
            <if test="null != registerCondition">
                and a.registerCondition = #{registerCondition}
            </if>
        <if test="null != cityCode and '' != cityCode">
            and a.cityCode = #{cityCode}
        </if>
        <if test="null != content and '' != content">
            and a.name like CONCAT('%', #{content}, '%')
        </if>
        <if test="null != registerCondition">
            and a.registerCondition = #{registerCondition}
        </if>
        GROUP BY a.id
            order by a.insertTime desc
        order by a.insertTime desc
        ) as aa
        <if test="null != heat and '' != heat">
            order by aa.heat ${heat}