Commit ab0f076f authored by daniel's avatar daniel

fix(guide): 组委会列表接口重写

parent e71cde67
...@@ -44,6 +44,10 @@ public interface CmptMapper { ...@@ -44,6 +44,10 @@ public interface CmptMapper {
List<Cmpt> queryCmpt(@Param("page") Pageable page, @Param("param") Map<String,String> param); List<Cmpt> queryCmpt(@Param("page") Pageable page, @Param("param") Map<String,String> param);
long countCommitteeCmpt(@Param("param") Map<String,String> param);
List<Cmpt> queryCommitteeCmpt(@Param("page") Pageable page, @Param("param") Map<String,String> param);
void updateCmpt(Cmpt cmpt); void updateCmpt(Cmpt cmpt);
Integer getCommonUserId(Integer userId); Integer getCommonUserId(Integer userId);
......
...@@ -197,6 +197,68 @@ ...@@ -197,6 +197,68 @@
and c.createUserId=#{param.userId} and c.createUserId=#{param.userId}
and a.cmpt_status = 2 and a.cmpt_status = 2
</if> </if>
<if test="param.userId lt 0">
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)
and a.cmpt_status = 2
</if>
<if test="param.partnerId == 'PRODF4E96E99A2B48AEA' ">
AND '2022-12-12 22:20:00' > a.create_date
</if>
<if test="param.partnerId == 'zOA0p24qhnrdxXeCZU' ">
AND c.type != 5 and c.type != 10
</if>
</sql>
<select id="countCommitteeCmpt" resultType="long">
select count(1)
from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
</select>
<select id="queryCommitteeCmpt" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
select a.cmpt_id,
a.cmpt_name as cmptName,
a.logo,
b.gCmptId,
date_format(start_time,'%Y-%m-%d') startTime,
date_format(end_time,'%Y-%m-%d') endTime,
date_format(a.start_time,'%Y-%m-%d %H:%i:%s') as startTimeStr,
date_format(a.end_time,'%Y-%m-%d %H:%i:%s') as endTimeStr,
date_format(c.openTime,'%Y-%m-%d %H:%i:%s') as openTime,
date_format(c.deadLine,'%Y-%m-%d %H:%i:%s') as deadLine,
a.bg_color as cmptbgColor,
a.create_by AS "createBy",
a.create_date AS "createDate",
a.update_by AS "updateBy",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
c.city as city,
c.province as province,
c.area as area,
c.location as location
from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
order by c.startTime desc
limit #{page.offset},#{page.size}
</select>
<sql id="committee-cmpt-where-sql">
<if test="@org.apache.commons.lang3.StringUtils@isNotBlank(param.keyword)">
and a.cmpt_name like concat('%',#{param.keyword},'%')
</if>
<if test="param.type == 1">
and now() >= c.openTime and c.deadLine >= now()
</if>
<if test="param.type == 2">
and now() >= c.startTime and c.endTime >= now()
</if>
<if test="param.userId > 0">
and c.createUserId=#{param.userId}
</if>
<if test="param.userId lt 0"> <if test="param.userId lt 0">
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0) AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)
</if> </if>
......
...@@ -259,6 +259,18 @@ public class CmptService { ...@@ -259,6 +259,18 @@ public class CmptService {
return PageFactory.setContent(list, page, count); return PageFactory.setContent(list, page, count);
} }
/**
* 查询组委会的赛事列表
* @param page 分页参数
* @param param 查询参数
* @return 组委会的赛事列表
*/
public Page<List<Cmpt>> queryCommitteeCmpt(Pageable page, Map<String, String> param) {
long count = cmptMapper.countCommitteeCmpt(param);
List<Cmpt> list = cmptMapper.queryCommitteeCmpt(page, param);
return PageFactory.setContent(list, page, count);
}
public void update(Cmpt cmpt) { public void update(Cmpt cmpt) {
// 不知道为什么要更新计时的赛事名称更新成null,注释掉 by linc 2023/04/04 // 不知道为什么要更新计时的赛事名称更新成null,注释掉 by linc 2023/04/04
// cmptMapper.updateGeerunnerCmptName(cmpt.getCmptId(),cmpt.getCmptName()); // cmptMapper.updateGeerunnerCmptName(cmpt.getCmptId(),cmpt.getCmptName());
......
...@@ -55,7 +55,7 @@ public class GuideController { ...@@ -55,7 +55,7 @@ public class GuideController {
Map<String,String> param = new HashMap<>(); Map<String,String> param = new HashMap<>();
param.put("partnerId",partnerId); param.put("partnerId",partnerId);
param.put("userId",partner.getUserId()+""); param.put("userId",partner.getUserId()+"");
Page<List<Cmpt>> result = cmptService.queryCmpt(cmptPageDTO.toPageable(), param); Page<List<Cmpt>> result = cmptService.queryCommitteeCmpt(cmptPageDTO.toPageable(), param);
result.setCode(200); result.setCode(200);
return result; return result;
} }
......
...@@ -56,11 +56,9 @@ ...@@ -56,11 +56,9 @@
<title>赛事引导</title> <title>赛事引导</title>
<style> <style>
.inner { .inner {
width: 100%;
height: 180px; height: 180px;
background: #ce3939; background: #ce3939;
border-radius: 4px; border-radius: 4px;
margin: 20px 20px;
position: relative; position: relative;
color: white; color: white;
} }
...@@ -84,7 +82,7 @@ ...@@ -84,7 +82,7 @@
<div class="page"> <div class="page">
<jsp:include page="../common/header.jsp"></jsp:include> <jsp:include page="../common/header.jsp"></jsp:include>
<div id="app" <div id="app"
class="page-content main-body grid grid-cols-3 gap-5 box-border"> class="page-content main-body grid grid-cols-3 gap-5 p-3 box-border">
<div class="inner p-3 shadow-sm" <div class="inner p-3 shadow-sm"
style="background: #ce3939;" v-for="item in cmpts" style="background: #ce3939;" v-for="item in cmpts"
@click="toDetail(item)" :key="item.cmptId"> @click="toDetail(item)" :key="item.cmptId">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment