| | |
| | | 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> |
| | |
| | | <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"> |