nickchange
2023-10-17 a830a73fd10a21e3793c79a35be4e532de124c6f
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
<?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.other.mapper.GameMapper">
 
    <select id="queryAll" resultType="com.dsh.other.entity.Game">
        SELECT
            ga.*,st.`name` as store,op.`name` as operation,si.`name` as site
        FROM
            t_game ga
                LEFT JOIN t_store st ON ga.storeId = st.id
                LEFT JOIN t_operator op ON ga.operationId = op.id
                LEFT JOIN t_site si on ga.siteId = si.id
        <where>
            <if test="provinceCode!=null and provinceCode!=''">
                ga.provinceCode = #{provinceCode}
 
            </if>
            <if test="cityCode!=null and cityCode!=''">
               and ga.cityCode = #{cityCode}
 
            </if>
            <if test="store!=null and store!=''">
               and  st.`name` = #{store}
 
            </if>
            <if test="site!=null and site!=''">
              and  si.`name` = #{site}
 
            </if>
        </where>
 
 
    </select>
    <select id="orderlist" resultType="map">
        SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange
        FROM t_site_booking bk
                 LEFT JOIN t_store st on bk.storeId = st.id
                 LEFT JOIN t_site si on bk.siteId = si.id
        <where>
        <if test="provinceCode!=null and provinceCode!= ''">
          and  bk.provinceCode=#{provinceCode}
        </if>
            <if test="cityCode!=null and cityCode!= ''">
                and  bk.cityCode=#{cityCode}
            </if>
 
            <if test="store!=null and store!= ''">
                and  st.name=#{store}
            </if>
 
            <if test="peopleName!=null and peopleName!= ''">
                and  bk.booker=#{peopleName}
            </if>
 
            <if test="phone!=null and phone!= ''">
                and  bk.phone=#{phone}
            </if>
 
 
            <if test="date!=null and date!= ''">
                and bk.times like concat('%',#{date},'%')            </if>
            <if test="payMethod!=null ">
                and  bk.payType=#{payMethod}
            </if>
 
            <if test="state!=null ">
                and  bk.status=#{state}
            </if>
 
        
        </where>
 
 
 
 
    </select>
</mapper>