无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.communityWorldCup.mapper.WorldCupMapper">
 
 
    <select id="getWorldCupListCoach" resultType="com.dsh.communityWorldCup.model.WorldCupListCoachVo">
        select
        id,
        name,
        CONCAT(DATE_FORMAT(startTime, '%Y.%m.%d %H:%i'), '-', DATE_FORMAT(endTime, '%Y.%m.%d %H:%i'))as activeTime,
        matchNumber,
        status,
        lon,
        lat,
        CASE status WHEN 1 THEN 2 WHEN 2 THEN 1 ELSE status END as sort
        from t_world_cup where status != 3
        <if test="null != item.content and '' != item.content">
            and `name` like CONCAT('%', #{item.content}, '%')
        </if>
        <if test="null != item.storeId">
            and id in (select worldCupId from t_world_cup_store where storeId = #{item.storeId})
        </if>
    </select>
 
 
 
    <select id="getWorldCupList" resultType="com.dsh.communityWorldCup.model.WorldCupListVo">
        select
        a.id,
        a.name,
        DATE_FORMAT(ifnull(a.registrationClosingTime, a.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime,
        CONCAT(a.startAge, '-', a.endAge) as age,
        a.coverImg,
        a.intro as content,
        a.lon,
        a.lat,
        a.basePeople as heat
        from t_world_cup a
        where a.status in (1, 2)
        <if test="null != item.content and '' != item.content">
            and a.name like CONCAT('%', #{item.content}, '%')
        </if>
        <if test="null != item.storeId">
            and a.id in (select worldCupId from t_world_cup_store where storeId = #{item.storeId})
        </if>
        <if test="null != item.gender">
            and #{item.gender} = a.gender
        </if>
        order by a.createTime desc
    </select>
 
 
 
    <select id="getWorldCupInfo" resultType="com.dsh.communityWorldCup.model.WorldCupInfo">
        select
        a.id,
        a.infoImg,
        a.name,
        a.basePeople as heat,
        DATE_FORMAT(a.startTime, '%Y-%m-%d %H:%i') as startTime,
        DATE_FORMAT(a.endTime, '%Y-%m-%d %H:%i') as endTime,
        DATE_FORMAT(ifnull(a.registrationClosingTime, a.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime,
        CONCAT(a.startAge, '-', a.endAge) as age,
        a.gender,
        a.province,
        a.city,
        a.address,
        a.cash,
        a.paiCoin,
        a.classHour,
        a.intro,
        a.content
        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') &gt;= #{item.startTime}
        </if>
        <if test="null != item.endTime and '' != item.endTime">
            and DATE_FORMAT(endTime, '%Y-%m-%d') &lt;= #{item.endTime}
        </if>
        <if test="null != item.status">
            and status= #{item.status}
        </if>
    </select>
 
 
 
    <select id="worldCupGameStatistics" resultType="map">
        select
        a.id,
        a.`name`,
        DATE_FORMAT(a.startTime, '%Y.%m.%d %H:%i') as startTime,
        DATE_FORMAT(a.endTime, '%Y.%m.%d %H:%i') as endTime
        from t_world_cup a
        where 1 = 1
        <if test="null != item.name and '' != item.name">
            and a.`name` like CONCAT('%', #{item.name}, '%')
        </if>
        order by a.createTime desc limit #{item.offset}, #{item.limit}
    </select>
 
    <select id="worldCupGameStatisticsCount" resultType="int">
        select
        count(*)
        from t_world_cup a
        where 1 = 1
        <if test="null != item.name and '' != item.name">
            and a.`name` like CONCAT('%', #{item.name}, '%')
        </if>
    </select>
 
 
 
    <update id="updateWorldCupAll">
        update t_world_cup set name = #{item.name}, startTime = #{item.startTime}, endTime = #{item.endTime}, registrationClosingTime = #{item.registrationClosingTime}, startAge = #{item.startAge}, endAge = #{item.endAge},
        gender = #{item.gender}, payType = #{item.payType}, cash = #{item.cash}, paiCoin = #{item.paiCoin}, classHour = #{item.classHour}, maxPeople = #{item.maxPeople}, basePeople = #{item.basePeople}, participationIntegral = #{item.participationIntegral},
        winIntegral = #{item.winIntegral}, province = #{item.province}, provinceCode = #{item.provinceCode}, city = #{item.city}, cityCode = #{item.cityCode}, address = #{item.address}, lon = #{item.lon}, lat = #{item.lat}, coverImg = #{item.coverImg}, homeBackdropImg = #{item.homeBackdropImg},
        infoImg = #{item.infoImg}, intro = #{item.intro}, content = #{item.content}, status = #{item.status}, createTime = #{item.createTime}, matchNumber = #{item.matchNumber} where id = #{item.id}
    </update>
</mapper>