wzp
2025-05-23 53443db90d66094124dbbeebbcf763032a2333d0
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
<?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.system.mapper.TbOrdersMapper">
    
    <resultMap type="TbOrders" id="TbOrdersResult">
        <result property="OrderID"    column="OrderID"    />
        <result property="LinkPerson"    column="LinkPerson"    />
        <result property="LinkTel"    column="LinkTel"    />
        <result property="AlarmTel"    column="AlarmTel"    />
        <result property="PatientName"    column="PatientName"    />
        <result property="Sex"    column="Sex"    />
        <result property="Age"    column="Age"    />
        <result property="Kg"    column="Kg"    />
        <result property="Sense"    column="Sense"    />
        <result property="LocalAddress"    column="LocalAddress"    />
        <result property="LocalLongitude"    column="LocalLongitude"    />
        <result property="LocalLatitude"    column="LocalLatitude"    />
        <result property="LocalProvince"    column="LocalProvince"    />
        <result property="LocalCity"    column="LocalCity"    />
        <result property="LocalDistrict"    column="LocalDistrict"    />
        <result property="SendAddress"    column="SendAddress"    />
        <result property="SendLongitude"    column="SendLongitude"    />
        <result property="SendLatitude"    column="SendLatitude"    />
        <result property="SendProvince"    column="SendProvince"    />
        <result property="SendCity"    column="SendCity"    />
        <result property="SendDistrict"    column="SendDistrict"    />
        <result property="BookingPrice"    column="BookingPrice"    />
        <result property="BookingDate"    column="BookingDate"    />
        <result property="Remark"    column="Remark"    />
        <result property="Complaint"    column="Complaint"    />
        <result property="PatientCount"    column="PatientCount"    />
        <result property="BookingKM"    column="BookingKM"    />
        <result property="EscortCode"    column="EscortCode"    />
        <result property="LiftingCode"    column="LiftingCode"    />
        <result property="LiftingFloor"    column="LiftingFloor"    />
        <result property="RequirementCode"    column="RequirementCode"    />
        <result property="TypeCode"    column="TypeCode"    />
        <result property="ThirdPartyResult"    column="ThirdPartyResult"    />
        <result property="ServiceOrdID"    column="ServiceOrdID"    />
        <result property="ServiceOrdNo"    column="ServiceOrdNo"    />
        <result property="CreateTime"    column="CreateTime"    />
        <result property="UpdateTime"    column="UpdateTime"    />
        <result property="OrderStatus"    column="OrderStatus"    />
        <result property="AppId"    column="AppId"    />
    </resultMap>
 
    <sql id="selectTbOrdersVo">
        select OrderID, LinkPerson, LinkTel, AlarmTel, PatientName, Sex, Age, Kg, Sense, LocalAddress, LocalLongitude, LocalLatitude, LocalProvince, LocalCity, LocalDistrict, SendAddress, SendLongitude, SendLatitude, SendProvince, SendCity, SendDistrict, BookingPrice, BookingDate, Remark, Complaint, PatientCount, BookingKM, EscortCode, LiftingCode, LiftingFloor, RequirementCode, TypeCode, ThirdPartyResult, ServiceOrdID, ServiceOrdNo, CreateTime, UpdateTime, OrderStatus, AppId from tb_orders
    </sql>
 
    <select id="selectTbOrdersList" parameterType="TbOrders" resultMap="TbOrdersResult">
        <include refid="selectTbOrdersVo"/>
        <where>  
            <if test="LinkPerson != null  and LinkPerson != ''"> and LinkPerson = #{LinkPerson}</if>
            <if test="LinkTel != null  and LinkTel != ''"> and LinkTel = #{LinkTel}</if>
            <if test="AlarmTel != null  and AlarmTel != ''"> and AlarmTel = #{AlarmTel}</if>
            <if test="PatientName != null  and PatientName != ''"> and PatientName like concat('%', #{PatientName}, '%')</if>
            <if test="Sex != null "> and Sex = #{Sex}</if>
            <if test="Age != null  and Age != ''"> and Age = #{Age}</if>
            <if test="Kg != null  and Kg != ''"> and Kg = #{Kg}</if>
            <if test="Sense != null  and Sense != ''"> and Sense = #{Sense}</if>
            <if test="LocalAddress != null  and LocalAddress != ''"> and LocalAddress = #{LocalAddress}</if>
            <if test="LocalLongitude != null "> and LocalLongitude = #{LocalLongitude}</if>
            <if test="LocalLatitude != null "> and LocalLatitude = #{LocalLatitude}</if>
            <if test="LocalProvince != null  and LocalProvince != ''"> and LocalProvince = #{LocalProvince}</if>
            <if test="LocalCity != null  and LocalCity != ''"> and LocalCity = #{LocalCity}</if>
            <if test="LocalDistrict != null  and LocalDistrict != ''"> and LocalDistrict = #{LocalDistrict}</if>
            <if test="SendAddress != null  and SendAddress != ''"> and SendAddress = #{SendAddress}</if>
            <if test="SendLongitude != null "> and SendLongitude = #{SendLongitude}</if>
            <if test="SendLatitude != null "> and SendLatitude = #{SendLatitude}</if>
            <if test="SendProvince != null  and SendProvince != ''"> and SendProvince = #{SendProvince}</if>
            <if test="SendCity != null  and SendCity != ''"> and SendCity = #{SendCity}</if>
            <if test="SendDistrict != null  and SendDistrict != ''"> and SendDistrict = #{SendDistrict}</if>
            <if test="BookingPrice != null "> and BookingPrice = #{BookingPrice}</if>
            <if test="BookingDate != null "> and BookingDate = #{BookingDate}</if>
            <if test="Remark != null  and Remark != ''"> and Remark = #{Remark}</if>
            <if test="Complaint != null  and Complaint != ''"> and Complaint = #{Complaint}</if>
            <if test="PatientCount != null "> and PatientCount = #{PatientCount}</if>
            <if test="BookingKM != null "> and BookingKM = #{BookingKM}</if>
            <if test="EscortCode != null "> and EscortCode = #{EscortCode}</if>
            <if test="LiftingCode != null "> and LiftingCode = #{LiftingCode}</if>
            <if test="LiftingFloor != null "> and LiftingFloor = #{LiftingFloor}</if>
            <if test="RequirementCode != null "> and RequirementCode = #{RequirementCode}</if>
            <if test="TypeCode != null "> and TypeCode = #{TypeCode}</if>
            <if test="ThirdPartyResult != null "> and ThirdPartyResult = #{ThirdPartyResult}</if>
            <if test="ServiceOrdID != null  and ServiceOrdID != ''"> and ServiceOrdID = #{ServiceOrdID}</if>
            <if test="ServiceOrdNo != null  and ServiceOrdNo != ''"> and ServiceOrdNo = #{ServiceOrdNo}</if>
            <if test="CreateTime != null "> and CreateTime = #{CreateTime}</if>
            <if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
            <if test="OrderStatus != null "> and OrderStatus = #{OrderStatus}</if>
            <if test="AppId != null  and AppId != ''"> and AppId = #{AppId}</if>
        </where>
        ORDER BY CreateTime DESC
    </select>
    
    <select id="selectTbOrdersByOrderID" parameterType="Long" resultMap="TbOrdersResult">
        <include refid="selectTbOrdersVo"/>
        where OrderID = #{OrderID}
        ORDER BY CreateTime DESC
    </select>
 
    <insert id="insertTbOrders" parameterType="TbOrders">
        insert into tb_orders
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="OrderID != null">OrderID,</if>
            <if test="LinkPerson != null">LinkPerson,</if>
            <if test="LinkTel != null">LinkTel,</if>
            <if test="AlarmTel != null">AlarmTel,</if>
            <if test="PatientName != null">PatientName,</if>
            <if test="Sex != null">Sex,</if>
            <if test="Age != null">Age,</if>
            <if test="Kg != null">Kg,</if>
            <if test="Sense != null">Sense,</if>
            <if test="LocalAddress != null">LocalAddress,</if>
            <if test="LocalLongitude != null">LocalLongitude,</if>
            <if test="LocalLatitude != null">LocalLatitude,</if>
            <if test="LocalProvince != null">LocalProvince,</if>
            <if test="LocalCity != null">LocalCity,</if>
            <if test="LocalDistrict != null">LocalDistrict,</if>
            <if test="SendAddress != null">SendAddress,</if>
            <if test="SendLongitude != null">SendLongitude,</if>
            <if test="SendLatitude != null">SendLatitude,</if>
            <if test="SendProvince != null">SendProvince,</if>
            <if test="SendCity != null">SendCity,</if>
            <if test="SendDistrict != null">SendDistrict,</if>
            <if test="BookingPrice != null">BookingPrice,</if>
            <if test="BookingDate != null">BookingDate,</if>
            <if test="Remark != null">Remark,</if>
            <if test="Complaint != null">Complaint,</if>
            <if test="PatientCount != null">PatientCount,</if>
            <if test="BookingKM != null">BookingKM,</if>
            <if test="EscortCode != null">EscortCode,</if>
            <if test="LiftingCode != null">LiftingCode,</if>
            <if test="LiftingFloor != null">LiftingFloor,</if>
            <if test="RequirementCode != null">RequirementCode,</if>
            <if test="TypeCode != null">TypeCode,</if>
            <if test="ThirdPartyResult != null">ThirdPartyResult,</if>
            <if test="ServiceOrdID != null">ServiceOrdID,</if>
            <if test="ServiceOrdNo != null">ServiceOrdNo,</if>
            <if test="CreateTime != null">CreateTime,</if>
            <if test="UpdateTime != null">UpdateTime,</if>
            <if test="OrderStatus != null">OrderStatus,</if>
            <if test="AppId != null">AppId,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="OrderID != null">#{OrderID},</if>
            <if test="LinkPerson != null">#{LinkPerson},</if>
            <if test="LinkTel != null">#{LinkTel},</if>
            <if test="AlarmTel != null">#{AlarmTel},</if>
            <if test="PatientName != null">#{PatientName},</if>
            <if test="Sex != null">#{Sex},</if>
            <if test="Age != null">#{Age},</if>
            <if test="Kg != null">#{Kg},</if>
            <if test="Sense != null">#{Sense},</if>
            <if test="LocalAddress != null">#{LocalAddress},</if>
            <if test="LocalLongitude != null">#{LocalLongitude},</if>
            <if test="LocalLatitude != null">#{LocalLatitude},</if>
            <if test="LocalProvince != null">#{LocalProvince},</if>
            <if test="LocalCity != null">#{LocalCity},</if>
            <if test="LocalDistrict != null">#{LocalDistrict},</if>
            <if test="SendAddress != null">#{SendAddress},</if>
            <if test="SendLongitude != null">#{SendLongitude},</if>
            <if test="SendLatitude != null">#{SendLatitude},</if>
            <if test="SendProvince != null">#{SendProvince},</if>
            <if test="SendCity != null">#{SendCity},</if>
            <if test="SendDistrict != null">#{SendDistrict},</if>
            <if test="BookingPrice != null">#{BookingPrice},</if>
            <if test="BookingDate != null">#{BookingDate},</if>
            <if test="Remark != null">#{Remark},</if>
            <if test="Complaint != null">#{Complaint},</if>
            <if test="PatientCount != null">#{PatientCount},</if>
            <if test="BookingKM != null">#{BookingKM},</if>
            <if test="EscortCode != null">#{EscortCode},</if>
            <if test="LiftingCode != null">#{LiftingCode},</if>
            <if test="LiftingFloor != null">#{LiftingFloor},</if>
            <if test="RequirementCode != null">#{RequirementCode},</if>
            <if test="TypeCode != null">#{TypeCode},</if>
            <if test="ThirdPartyResult != null">#{ThirdPartyResult},</if>
            <if test="ServiceOrdID != null">#{ServiceOrdID},</if>
            <if test="ServiceOrdNo != null">#{ServiceOrdNo},</if>
            <if test="CreateTime != null">#{CreateTime},</if>
            <if test="UpdateTime != null">#{UpdateTime},</if>
            <if test="OrderStatus != null">#{OrderStatus},</if>
            <if test="AppId != null">#{AppId},</if>
         </trim>
    </insert>
 
    <update id="updateTbOrders" parameterType="TbOrders">
        update tb_orders
        <trim prefix="SET" suffixOverrides=",">
            <if test="LinkPerson != null">LinkPerson = #{LinkPerson},</if>
            <if test="LinkTel != null">LinkTel = #{LinkTel},</if>
            <if test="AlarmTel != null">AlarmTel = #{AlarmTel},</if>
            <if test="PatientName != null">PatientName = #{PatientName},</if>
            <if test="Sex != null">Sex = #{Sex},</if>
            <if test="Age != null">Age = #{Age},</if>
            <if test="Kg != null">Kg = #{Kg},</if>
            <if test="Sense != null">Sense = #{Sense},</if>
            <if test="LocalAddress != null">LocalAddress = #{LocalAddress},</if>
            <if test="LocalLongitude != null">LocalLongitude = #{LocalLongitude},</if>
            <if test="LocalLatitude != null">LocalLatitude = #{LocalLatitude},</if>
            <if test="LocalProvince != null">LocalProvince = #{LocalProvince},</if>
            <if test="LocalCity != null">LocalCity = #{LocalCity},</if>
            <if test="LocalDistrict != null">LocalDistrict = #{LocalDistrict},</if>
            <if test="SendAddress != null">SendAddress = #{SendAddress},</if>
            <if test="SendLongitude != null">SendLongitude = #{SendLongitude},</if>
            <if test="SendLatitude != null">SendLatitude = #{SendLatitude},</if>
            <if test="SendProvince != null">SendProvince = #{SendProvince},</if>
            <if test="SendCity != null">SendCity = #{SendCity},</if>
            <if test="SendDistrict != null">SendDistrict = #{SendDistrict},</if>
            <if test="BookingPrice != null">BookingPrice = #{BookingPrice},</if>
            <if test="BookingDate != null">BookingDate = #{BookingDate},</if>
            <if test="Remark != null">Remark = #{Remark},</if>
            <if test="Complaint != null">Complaint = #{Complaint},</if>
            <if test="PatientCount != null">PatientCount = #{PatientCount},</if>
            <if test="BookingKM != null">BookingKM = #{BookingKM},</if>
            <if test="EscortCode != null">EscortCode = #{EscortCode},</if>
            <if test="LiftingCode != null">LiftingCode = #{LiftingCode},</if>
            <if test="LiftingFloor != null">LiftingFloor = #{LiftingFloor},</if>
            <if test="RequirementCode != null">RequirementCode = #{RequirementCode},</if>
            <if test="TypeCode != null">TypeCode = #{TypeCode},</if>
            <if test="ThirdPartyResult != null">ThirdPartyResult = #{ThirdPartyResult},</if>
            <if test="ServiceOrdID != null">ServiceOrdID = #{ServiceOrdID},</if>
            <if test="ServiceOrdNo != null">ServiceOrdNo = #{ServiceOrdNo},</if>
            <if test="CreateTime != null">CreateTime = #{CreateTime},</if>
            <if test="UpdateTime != null">UpdateTime = #{UpdateTime},</if>
            <if test="OrderStatus != null">OrderStatus = #{OrderStatus},</if>
            <if test="AppId != null">AppId = #{AppId},</if>
        </trim>
        where OrderID = #{OrderID}
    </update>
 
    <delete id="deleteTbOrdersByOrderID" parameterType="Long">
        delete from tb_orders where OrderID = #{OrderID}
    </delete>
 
    <delete id="deleteTbOrdersByOrderIDs" parameterType="String">
        delete from tb_orders where OrderID in 
        <foreach item="OrderID" collection="array" open="(" separator="," close=")">
            #{OrderID}
        </foreach>
    </delete>
 
    <select id="checkServiceOrdIDExists" parameterType="String" resultType="Integer">
        select count(1) from tb_orders where ServiceOrdID = #{ServiceOrdID}
    </select>
 
    <select id="selectTbOrdersByServiceOrdID" parameterType="String" resultMap="TbOrdersResult">
        <include refid="selectTbOrdersVo"/>
        where ServiceOrdID = #{ServiceOrdID}
        LIMIT 1
    </select>
 
</mapper>