Pu Zhibing
2025-04-22 fd7b8fb7c89832c28a838b0449bbb8a392433ee2
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
<?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.ruoyi.other.mapper.ShopPointMapper">
 
    <sql id="ShopPointList">
        SELECT
        ts.`name` shopName,
        ts.shop_manager shopLeaderName,
        ts.phone,
        tsp.type,
        tsp.create_time,
        tsp.variable_point,
        tsp.order_num
        FROM
        t_shop_point tsp
        LEFT JOIN t_shop ts ON tsp.shop_id = ts.id
        <where>
            <if test="shopPoint.shopName != null and shopPoint.shopName != ''">
                AND ts.`name` LIKE concat('%',#{shopPoint.shopName},'%')
            </if>
            <if test="shopPoint.shopLeaderName != null and shopPoint.shopLeaderName != ''">
                AND ts.shop_manager LIKE concat('%',#{shopPoint.shopLeaderName},'%')
            </if>
            <if test="shopPoint.phone != null and shopPoint.phone != ''">
                AND ts.phone LIKE concat('%',#{shopPoint.phone},'%')
            </if>
            <if test="shopPoint.type != null">
                AND tsp.type = #{shopPoint.type}
            </if>
            <if test="shopPoint.startTime !=null and shopPoint.endTime !=null">
                AND tsp.create_time BETWEEN #{shopPoint.startTime} AND #{shopPoint.endTime}
            </if>
            <if test="shopPoint.shopId !=null">
                AND tsp.shop_id = #{shopPoint.shopId}
            </if>
        </where>
        order by tsp.create_time desc
    </sql>
 
    <select id="selectShopPointList" resultType="com.ruoyi.other.api.domain.ShopPoint">
        <include refid="ShopPointList"/>
    </select>
    <select id="queryShpointPage" resultType="com.ruoyi.other.api.domain.ShopPoint">
        SELECT
        ts.`name` shopName,
        ts.shop_manager shopLeaderName,
        ts.phone,
        tsp.type,
        tsp.create_time,
        tsp.variable_point,
        tsp.change_direction,
        tsp.order_num as orderNum
        FROM
        (select * from t_shop_point union all select * from t_shop_point_copy) tsp
        LEFT JOIN t_shop ts ON tsp.shop_id = ts.id
        <where>
            <if test="shopPoint.shopId != null and shopPoint.shopId != ''">
                AND tsp.shop_id = #{shopPoint.shopId}
            </if>
            <if test="shopPoint.shopName != null and shopPoint.shopName != ''">
                AND ts.`name` LIKE concat('%',#{shopPoint.shopName},'%')
            </if>
            <if test="shopPoint.shopLeaderName != null and shopPoint.shopLeaderName != ''">
                AND ts.shop_manager LIKE concat('%',#{shopPoint.shopLeaderName},'%')
            </if>
            <if test="shopPoint.phone != null and shopPoint.phone != ''">
                AND ts.phone LIKE concat('%',#{shopPoint.phone},'%')
            </if>
            <if test="shopPoint.type != null">
                AND tsp.type = #{shopPoint.type}
            </if>
            <if test="shopPoint.startTime !=null and shopPoint.endTime !=null">
                AND tsp.create_time BETWEEN #{shopPoint.startTime} AND #{shopPoint.endTime}
            </if>
            <if test="shopPoint.shopId !=null">
                AND tsp.shop_id = #{shopPoint.shopId}
            </if>
        </where>
        order by tsp.create_time desc
    </select>
</mapper>