From c036557db88c6297b9a626a892dce35c14ab8ee5 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期四, 09 十一月 2023 18:30:31 +0800
Subject: [PATCH] 11.6

---
 cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml b/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml
index 3ea04a5..ff7613c 100644
--- a/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml
+++ b/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml
@@ -13,8 +13,8 @@
         aa.introduction,
         aa.registerEndTime,
         aa.age,
-        (aa.baseNumber+aa.userCompetitionCount) as heat,
-        aa.status
+        aa.status,
+        aa.heat
         from (
         SELECT
         a.id,
@@ -23,10 +23,10 @@
         a.city AS cityName,
         a.registerCondition,
         a.introduction,
+        a.baseNumber as heat,
         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,
         CASE
         WHEN NOW() &lt; a.startTime THEN 1  -- 未开始
         WHEN now() between a.startTime and a.endTime THEN 2  -- 进行中
@@ -34,11 +34,8 @@
         END AS status
         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}
@@ -56,6 +53,10 @@
             order by aa.heat ${heat}
         </if>
     </select>
+    <select id="counts" resultType="java.lang.Integer">
+            select  count(1)
+            from t_user_competition where competitionId = #{id}
+    </select>
 
 
     <update id="taskSetStatusStart">

--
Gitblit v1.7.1