From c0f6294b0be6789fddd652f89f820fcf6d5526cf Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 06 七月 2023 17:32:39 +0800 Subject: [PATCH] 合并代码 --- cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml b/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml index 0a11da1..df40070 100644 --- a/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml +++ b/cloud-server-competition/src/main/resources/mapper/CompetitionMapper.xml @@ -3,4 +3,36 @@ <mapper namespace="com.dsh.competition.mapper.CompetitionMapper"> + <select id="queryCompetitionList" resultType="com.dsh.competition.model.CompetitionListVo"> + select * 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') as registerEndTime, + CONCAT(a.startAge, '-', a.endAge) as age, + a.baseNumber + a.applicantsNumber as heat + from t_competition a + where a.auditStatus = 2 and a.`status` = 2 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> + order by a.insertTime desc + ) as aa + <if test="null != heat 1 == heat"> + order by aa.heat + </if> + <if test="null != heat 2 == heat"> + order by aa.heat desc + </if> + </select> </mapper> -- Gitblit v1.7.1