| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.competition.mapper.CompetitionMapper"> |
| | | |
| | | <delete id="deleteTenMinutes"> |
| | | delete from t_payment_competition |
| | | WHERE payStatus = 1 |
| | | AND DATE_ADD(insertTime, INTERVAL 10 MINUTE) <= NOW() |
| | | </delete> |
| | | |
| | | |
| | | <select id="queryCompetitionList" resultType="com.dsh.competition.model.CompetitionListVo"> |
| | | select |
| | |
| | | aa.introduction, |
| | | aa.registerEndTime, |
| | | aa.age, |
| | | (aa.baseNumber+aa.userCompetitionCount) as heat, |
| | | aa.status |
| | | aa.status, |
| | | aa.heat |
| | | from ( |
| | | SELECT |
| | | a.id, |
| | |
| | | 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() < a.startTime THEN 1 -- 未开始 |
| | | WHEN now() between a.startTime and a.endTime THEN 2 -- 进行中 |
| | |
| | | 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} |
| | |
| | | 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"> |