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
| <?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.TechnicianSubscribeMapper">
|
| <select id="getTechnicianSubscribeByUserAndShop" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
| SELECT
| CAST(tts.id AS CHAR) id,
| tts.user_address,
| ts.`name` shopName,
| ts.address shopAddress,
| tt.name technicianName,
| ts.longitude,
| ts.latitude,
| tts.subscribe_time,
| tts.service_mode,
| tts.user_address,
| tts.status
| FROM
| t_technician_subscribe tts
| LEFT JOIN t_technician tt ON tts.technician_id = tt.id
| LEFT JOIN t_shop ts ON tt.shop_id = ts.id
| WHERE
| ts.id = #{shopId}
| AND tts.del_flag = 0
| <if test="status != null">
| AND tts.status = #{status}
| </if>
| <if test="technicianId != null">
| AND tts.technician_id = #{technicianId}
| </if>
| ORDER BY tts.create_time DESC
| </select>
| <select id="getTechnicianSubscribeByUserAndShop1" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
| SELECT
| tts.id,
| tts.user_address,
| ts.`name` shopName,
| ts.address shopAddress,
| tt.name technicianName,
| ts.longitude,
| ts.latitude,
| tts.subscribe_time,
| tts.service_mode,
| tts.status,
| tts.app_user_id as appUserId
| FROM
| t_technician_subscribe tts
| LEFT JOIN t_technician tt ON tts.technician_id = tt.id
| LEFT JOIN t_shop ts ON tt.shop_id = ts.id
| WHERE
| ts.id = #{shopId}
| AND tts.del_flag = 0
| <if test="status != null">
| AND tts.status = #{status}
| </if>
|
| <if test="serviceMode != null">
| AND tts.service_mode = #{serviceMode}
| </if>
|
| ORDER BY tts.create_time DESC
| </select>
|
| <select id="getTechnicianSubscribeByUser" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO">
| SELECT * from (
| SELECT
| CAST(tts.id AS CHAR) id,
| tts.user_address,
| ts.`name` shopName,
| ts.address shopAddress,
| tt.name technicianName,
| ts.longitude,
| ts.latitude,
| tts.subscribe_time,
| tts.service_mode,
| CASE
| WHEN tts.subscribe_time <![CDATA[<]]> NOW() THEN 3
| ELSE tts.status
| END AS status,
| tts.create_time
| FROM
| t_technician_subscribe tts
| LEFT JOIN t_technician tt ON tts.technician_id = tt.id
| LEFT JOIN t_shop ts ON tt.shop_id = ts.id
| WHERE
| tts.app_user_id = #{userId}
| AND tts.del_flag = 0
| ORDER BY tts.create_time DESC
|
| ) o
| <where>
| <if test="status !=null">
| o.status = #{status}
| </if>
| </where>
| ORDER BY
| create_time DESC
|
| </select>
| </mapper>
|
|