无关风月
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?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.course.mapper.StoreMapper">
    <insert id="addConfigOne">
        insert into t_store_other_config(id,
                                        url,
                                        `name`,
                                        page,
                                        `type`,
                                        turnId,
                                        sort,
                                        state,pageId,typeId
                                        ) value (null ,#{url},#{name},#{s},#{s1},#{turnId},#{sort},1,#{page},#{type})
    </insert>
    <update id="updateBasicConfig">
        update t_img_config
        set content = #{p1}
        where `position` =#{position}
    </update>
 
    <update id="updateBasicBenefits">
        update t_img_config
        set content = #{p1}
        where `position` =#{position}
    </update>
 
    <update id="inset">
        update t_js
        set jieshao = #{jieshao} ,vedio = #{vedio}
        where id = #{id}
 
    </update>
    <delete id="delete1">
        delete from t_store_other_config where id =#{id}
    </delete>
 
    <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo">
        select t1.*,t2.name userName,t2.phone userPhone,t3.name yysName
        from t_store t1
        left join sys_user t2 on t1.storeStaffId = t2.id
        left  join t_operator t3 on t1.operatorId = t3.id
        where 1=1
        <if test="provinceCode !=null and provinceCode !=''">
            and t1.provinceCode = #{provinceCode}
        </if>
        <if test="cityCode !=null and cityCode !=''">
            and t1.cityCode = #{cityCode}
        </if>
        <if test="name !=null and name !=''">
            and t2.name like concat("%",#{name},"%")
        </if>
        <if test="phone !=null and phone !=''">
            and t2.phone like concat("%",#{phone},"%")
        </if>
        <if test="shopName !=null and shopName !=''">
            and t1.name like concat("%",#{shopName},"%")
        </if>
        <if test="operatorId !=null and operatorId !=''">
            and t1.operatorId = #{operatorId}
        </if>
    </select>
    <select id="queryProvince" resultType="map">
        select * from (
        select provinceCode as code, province as name from t_store where state = 1
         <if test="null != cityCode and '' != cityCode">
             and cityCode = #{cityCode}
         </if>
         group by provinceCode
        ) as aa order by aa.code
    </select>
 
 
    <select id="queryCity" resultType="map">
        select * from (
        select cityCode as code, city as name from t_store where state = 1 and provinceCode = #{provinceCode}
        <if test="null != cityCode and '' != cityCode">
            and cityCode = #{cityCode}
        </if>
        group by cityCode
        ) as aa order by aa.code
    </select>
    <select id="queryCity2" resultType="map">
 
        select * from (
        select cityCode as code, city as name
        from t_store where state = 1 and provinceCode = #{provinceCode}
        <if test="null != cityCode and '' != cityCode">
            and cityCode = #{cityCode}
        </if>
        <if test="null != type">
        and `type` = #{type}
        </if>
        <if test="null != operatorId">
        and operatorId = #{operatorId}
        </if>
        group by cityCode
        ) as aa order by aa.code
    </select>
 
    <select id="queryCity1" resultType="map">
        select * from (
        select cityCode as code, city as name from t_store where state = 1
        group by cityCode
        ) as aa order by aa.code
    </select>
    <select id="queryListOfpage" resultType="java.util.Map">
        SELECT `id`, `operatorId`, `province`, `city`, `name`,ids
        from t_store
        where state=1
        <if test="provinceCode != null and provinceCode!=''">
            and provinceCode = #{provinceCode}
        </if>
        <if test="cityCode != null and cityCode!=''">
            and cityCode = #{cityCode}
        </if>
        <if test="operatorId != null and operatorId!=''">
            and operatorId = #{operatorId}
        </if>
        <if test="storeName != null and storeName != ''">
            and `name` like CONCAT('%',#{storeName},'%')
        </if>
    </select>
    <select id="listOne" resultType="java.util.Map">
        select id,name,sort,state from t_store_other where storeId=#{id}
    </select>
    <select id="typeChange" resultType="java.util.Map">
        select t1.id,t1.name from t_turn t1 left join  t_turn t2 on t1.pid = t2.id where t2.name  =#{name}
    </select>
    <select id="typeChangeOne" resultType="java.util.Map">
        select id,name from t_turn  where pid  =#{id}
    </select>
    <select id="getConfig" resultType="java.lang.String">
        select name from t_turn where id =#{page}
    </select>
    <select id="listTwo" resultType="java.util.Map">
        select id,url,name ,  page,sort from t_store_other_config
    </select>
 
    <select id="getPage" resultType="com.dsh.guns.modular.system.model.TTurn">
        select * from t_turn
        <where>
            <if test="ids != null and ids.size()>0">
                AND t_turn.pid IN
                <foreach collection="ids" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>
    <select id="pageList" resultType="com.dsh.guns.modular.system.model.TTurn">
        select * from t_turn where pid = 0
    </select>
    <select id="get" resultType="com.dsh.course.dto.JsDto">
        select * from t_js where  id = #{id}
 
    </select>
 
 
    <select id="getConfig1" resultType="com.dsh.guns.modular.system.model.TImgConfig">
        select * from t_img_config
    </select>
 
 
    <select id="getSelect" resultType="com.dsh.guns.modular.system.model.dto.SelectDto">
 
 
        SELECT op.id , CONCAT(us.name,'-',us.`phone`) as value
        FROM t_operator op
            LEFT JOIN sys_user us on op.userId = us.id
 
 
 
 
    </select>
    <select id="listAllStore" resultType="com.dsh.guns.modular.system.model.TStoreListVo">
        select t1.*,t2.name userName,t2.phone userPhone,t3.name yysName from t_store t1 left join sys_user t2 on t1.storeStaffId = t2.id left  join t_operator t3 on t1.operatorId = t3.id
        where t1.id =#{id}
        <if test="provinceCode !=null and provinceCode !=''">
            and t1.provinceCode = #{provinceCode}
        </if>
        <if test="cityCode !=null and cityCode !=''">
            and t1.cityCode = #{cityCode}
        </if>
        <if test="name !=null and name !=''">
            and t2.name like concat("%",#{name},"%")
        </if>
        <if test="phone !=null and phone !=''">
            and t2.phone like concat("%",#{phone},"%")
        </if>
        <if test="shopName !=null and shopName !=''">
            and t1.name like concat("%",#{shopName},"%")
        </if>
    </select>
    <select id="querySiteListOfpage" resultType="java.util.Map">
        SELECT t1.id, t1.operatorId, t1.province, t1.city, t2.name,t1.ids,t1.name as siteName
        ,t2.type as `type`
        from t_site t1
        left join t_store t2 on t1.storeId =t2.id
        where t1.state=1 and t2.state=1 and t1.isCanBeBooked = 0 and t1.reservation=0
        <if test="provinceCode != null and provinceCode!=''">
            and t1.provinceCode = #{provinceCode}
        </if>
        <if test="cityCode != null and cityCode!=''">
            and t1.cityCode = #{cityCode}
        </if>
        <if test="operatorId != null and operatorId!=''">
            and t1.operatorId = #{operatorId}
        </if>
        <if test="storeName != null and storeName != ''">
            and t2.name like CONCAT('%',#{storeName},'%')
        </if>
        <if test="storeId != null">
            and t1.storeId = #{storeId}
        </if>
    </select>
 
    <select id="listStoreAll" resultType="map">
        select
        a.id,
        CONCAT(a.province, a.city) as province,
        b.name as operator,
        a.name,
        c.gate
        from t_store a
        left join t_operator b on (a.operatorId = b.id)
        left join (select GROUP_CONCAT(id) as gate, storeId from t_gate group by storeId) c on (a.id = c.storeId)
        where a.state = 1
        <if test="null != name and '' != name">
            and a.name like CONCAT('%', #{name}, '%')
        </if>
        <if test="null != operator">
            and a.operatorId = #{operator}
        </if>
        <if test="null != provinceCode and '' != provinceCode">
            and a.provinceCode = #{provinceCode}
        </if>
        <if test="null != cityCode and '' != cityCode">
            and a.cityCode = #{cityCode}
        </if>
    </select>
 
 
 
    <select id="listStoreAllByIds" resultType="map">
        select
            a.id,
            CONCAT(a.province, a.city) as province,
            b.name as operator,
            a.name,
            c.gate
        from t_store a
        left join t_operator b on (a.operatorId = b.id)
        left join (select GROUP_CONCAT(id) as gate, storeId from t_gate group by storeId) c on (a.id = c.storeId)
        where a.id in
        <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>