44323
2023-10-30 21ee583563d59d9d04840f65cb0053df9b183554
cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml
@@ -13,20 +13,27 @@
        aa.introduction,
        aa.registerEndTime,
        aa.age,
        aa.heat
        (aa.baseNumber+aa.userCompetitionCount) as heat
        from (
            select
            a.id,
            a.`name`,
            a.coverDrawing,
            a.city as cityName,
            a.registerCondition,
            a.introduction,
            DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') registerEndTime,
            CONCAT(a.startAge, '-', a.endAge) age,
            (a.baseNumber + a.applicantsNumber) heat
            from t_competition a
            where a.auditStatus = 2 and a.`status` = 2 and a.state = 1
        SELECT
        a.id,
        a.`name`,
        a.coverDrawing,
        a.city AS cityName,
        a.registerCondition,
        a.introduction,
        DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') AS registerEndTime,
        CONCAT(a.startAge, '-', a.endAge) AS age,
        a.baseNumber,
        COUNT(uc.competitionId) AS userCompetitionCount
        FROM
        t_competition a
        LEFT JOIN
        t_user_competition5 uc ON a.id = uc.competitionId
        WHERE
        a.auditStatus = 2
        AND a.`status` IN (1, 2)
        AND a.state = 1
            <if test="null != cityCode and '' != cityCode">
                and a.cityCode = #{cityCode}
            </if>
@@ -36,6 +43,7 @@
            <if test="null != registerCondition">
                and a.registerCondition = #{registerCondition}
            </if>
        GROUP BY a.id
            order by a.insertTime desc
        ) as aa
        <if test="null != heat and '' != heat">