| | |
| | | return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>() |
| | | .eq("participantId", studentId).eq("participantType", 1).eq("matchResult", 1)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取比赛管理列表数据 |
| | | * @param worldCupListAll |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/getWorldCupListAll") |
| | | public Map<String, Object> getWorldCupListAll(@RequestBody WorldCupListAll worldCupListAll){ |
| | | return worldCupService.getWorldCupListAll(worldCupListAll); |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | WorldCupInfo getWorldCupInfo(@Param("id") Integer id); |
| | | |
| | | |
| | | /** |
| | | * 获取比赛管理列表数据 |
| | | * @param worldCupListAll |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWorldCupListAll(@Param("item") WorldCupListAll worldCupListAll); |
| | | |
| | | |
| | | |
| | | Integer getWorldCupListAllCount(@Param("item") WorldCupListAll worldCupListAll); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.communityWorldCup.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/3/2 11:01 |
| | | */ |
| | | @Data |
| | | public class WorldCupListAll { |
| | | /** |
| | | * 比赛名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String endTime; |
| | | /** |
| | | * 比赛状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 页码 |
| | | */ |
| | | private Integer offset; |
| | | /** |
| | | * 页条数 |
| | | */ |
| | | private Integer limit; |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * @return |
| | | */ |
| | | ResultUtil paymentWorldCupCallback(String code, String outTradeNo); |
| | | |
| | | |
| | | /** |
| | | * 获取比赛管理列表数据 |
| | | * @param worldCupListAll |
| | | * @return |
| | | */ |
| | | Map<String, Object> getWorldCupListAll(WorldCupListAll worldCupListAll); |
| | | } |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取比赛管理列表数据 |
| | | * @param worldCupListAll |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> getWorldCupListAll(WorldCupListAll worldCupListAll) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = this.baseMapper.getWorldCupListAll(worldCupListAll); |
| | | for (Map<String, Object> map1 : list) { |
| | | String maxPeople = map1.get("maxPeople").toString(); |
| | | Integer id = Integer.valueOf(map1.get("id").toString()); |
| | | List<WorldCupPayment> lists = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", id).eq("payStatus", 2).eq("state", 1)); |
| | | List<Long> collect = lists.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); |
| | | Integer count = 0; |
| | | if(collect.size() > 0){ |
| | | count = worldCupPaymentParticipantService.count(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect)); |
| | | } |
| | | map1.put("maxPeople", maxPeople + " - " + count); |
| | | } |
| | | Integer count = this.baseMapper.getWorldCupListAllCount(worldCupListAll); |
| | | map.put("rows", list); |
| | | map.put("total", count); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | from t_world_cup a |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="getWorldCupListAll" resultType="map"> |
| | | select |
| | | id, |
| | | `name`, |
| | | DATE_FORMAT(startTime, '%Y.%m.%d %H:%i') as startTime, |
| | | DATE_FORMAT(endTime, '%Y.%m.%d %H:%i') as endTime, |
| | | CONCAT(startAge, '至', endAge) as age, |
| | | gender, |
| | | maxPeople, |
| | | status |
| | | from t_world_cup |
| | | where 1 = 1 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and `name` like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and '' != item.startTime"> |
| | | and DATE_FORMAT(startTime, '%Y-%m-%d') >= #{item.startTime} |
| | | </if> |
| | | <if test="null != item.endTime and '' != item.endTime"> |
| | | and DATE_FORMAT(endTime, '%Y-%m-%d') <= #{item.endTime} |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and status= #{item.status} |
| | | </if> |
| | | order by createTime desc limit #{item.offset}, #{item.limit} |
| | | </select> |
| | | |
| | | |
| | | <select id="getWorldCupListAllCount" resultType="int"> |
| | | select |
| | | count(*) |
| | | from t_world_cup |
| | | where 1 = 1 |
| | | <if test="null != item.name and '' != item.name"> |
| | | and `name` like CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and '' != item.startTime"> |
| | | and DATE_FORMAT(startTime, '%Y-%m-%d') >= #{item.startTime} |
| | | </if> |
| | | <if test="null != item.endTime and '' != item.endTime"> |
| | | and DATE_FORMAT(endTime, '%Y-%m-%d') <= #{item.endTime} |
| | | </if> |
| | | <if test="null != item.status"> |
| | | and status= #{item.status} |
| | | </if> |
| | | </select> |
| | | </mapper> |