陈昶聿
昨天 fcb98e4558897945a316d04555923355b8e60605
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
<?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.smartor.mapper.ServiceAppointRecordMapper">
 
    <resultMap type="com.smartor.domain.ServiceAppointRecord" id="ServiceAppointRecordResult">
        <result property="id" column="id"/>
        <result property="appointRecSn" column="appoint_rec_sn"/>
        <result property="changeAppointRecSn" column="change_appoint_rec_sn"/>
        <result property="orgCode" column="org_code"/>
        <result property="patFileSn" column="pat_file_sn"/>
        <result property="patMediaSn" column="pat_media_sn"/>
        <result property="patMediaNum" column="pat_media_num"/>
        <result property="patCateSn" column="pat_cate_sn"/>
        <result property="patNatureSn" column="pat_nature_sn"/>
        <result property="patFileName" column="pat_file_name"/>
        <result property="patFileGender" column="pat_file_gender"/>
        <result property="patAge" column="pat_age"/>
        <result property="patBirthday" column="pat_birthday"/>
        <result property="patCardTypeCode" column="pat_card_type_code"/>
        <result property="patCardType" column="pat_card_type"/>
        <result property="patIdCardNum" column="pat_id_card_num"/>
        <result property="patAddr" column="pat_addr"/>
        <result property="patTel" column="pat_tel"/>
        <result property="patWayCode" column="pat_way_code"/>
        <result property="patWay" column="pat_way"/>
        <result property="appointTypeSn" column="appoint_type_sn"/>
        <result property="appointDate" column="appoint_date"/>
        <result property="appointOperatorId" column="appoint_operator_id"/>
        <result property="appointOperatorName" column="appoint_operator_name"/>
        <result property="appointRegistDate" column="appoint_regist_date"/>
        <result property="registerScheduleSn" column="register_schedule_sn"/>
        <result property="outpatCateSn" column="outpat_cate_sn"/>
        <result property="outpatCateName" column="outpat_cate_name"/>
        <result property="registDeptCode" column="regist_dept_code"/>
        <result property="registDeptName" column="regist_dept_name"/>
        <result property="deptPinyinCode" column="dept_pinyin_code"/>
        <result property="registDoctCode" column="regist_doct_code"/>
        <result property="registDoctName" column="regist_doct_name"/>
        <result property="staffPinyinCode" column="staff_pinyin_code"/>
        <result property="registTimeCate" column="regist_time_cate"/>
        <result property="patiRegistSn" column="pati_regist_sn"/>
        <result property="scheduleRegistCharge" column="schedule_regist_charge"/>
        <result property="registRecSn" column="regist_rec_sn"/>
        <result property="regUserSn" column="reg_user_sn"/>
        <result property="regUserName" column="reg_user_name"/>
        <result property="regOptTime" column="reg_opt_time"/>
        <result property="revokeUserSn" column="revoke_user_sn"/>
        <result property="revokeUserName" column="revoke_user_name"/>
        <result property="revokeOptTime" column="revoke_opt_time"/>
        <result property="withdrawalTime" column="withdrawal_time"/>
        <result property="scheduleStatusFlag" column="schedule_status_flag"/>
        <result property="scheduleMemoDesc" column="schedule_memo_desc"/>
        <result property="scheduleCredenceNum" column="schedule_credence_num"/>
        <result property="registTimeRange" column="regist_time_range"/>
        <result property="scheduleDetailSn" column="schedule_detail_sn"/>
        <result property="treatDate" column="treat_date"/>
        <result property="treatDoctCode" column="treat_doct_code"/>
        <result property="treatDoctName" column="treat_doct_name"/>
        <result property="regWayCode" column="reg_way_code"/>
        <result property="regWay" column="reg_way"/>
        <result property="regSystemWayCode" column="reg_system_way_code"/>
        <result property="regSystemWay" column="reg_system_way"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="visitFlag" column="visit_flag"/>
        <result property="senderId" column="sender_id"/>
        <result property="senderName" column="sender_name"/>
        <result property="sendTime" column="send_time"/>
    </resultMap>
 
    <sql id="selectServiceAppointRecordVo">
        select id,
               appoint_rec_sn,
               change_appoint_rec_sn,
               org_code,
               pat_file_sn,
               pat_media_sn,
               pat_media_num,
               pat_cate_sn,
               pat_nature_sn,
               pat_file_name,
               pat_file_gender,
               pat_age,
               pat_birthday,
               pat_card_type_code,
               pat_card_type,
               pat_id_card_num,
               pat_addr,
               pat_tel,
               pat_way_code,
               pat_way,
               appoint_type_sn,
               appoint_date,
               appoint_operator_id,
               appoint_operator_name,
               appoint_regist_date,
               register_schedule_sn,
               outpat_cate_sn,
               outpat_cate_name,
               regist_dept_code,
               regist_dept_name,
               dept_pinyin_code,
               regist_doct_code,
               regist_doct_name,
               staff_pinyin_code,
               regist_time_cate,
               pati_regist_sn,
               schedule_regist_charge,
               regist_rec_sn,
               reg_user_sn,
               reg_user_name,
               reg_opt_time,
               revoke_user_sn,
               revoke_user_name,
               revoke_opt_time,
               withdrawal_time,
               schedule_status_flag,
               schedule_memo_desc,
               schedule_credence_num,
               regist_time_range,
               schedule_detail_sn,
               treat_date,
               treat_doct_code,
               treat_doct_name,
               reg_way_code,
               reg_way,
               reg_system_way_code,
               reg_system_way,
               create_time,
               update_time,
               visit_flag,
               sender_id,
               sender_name,
               send_time
        from service_appoint_record
    </sql>
 
    <select id="selectServiceAppointRecordList" parameterType="com.smartor.domain.ServiceAppointRecord"
            resultMap="ServiceAppointRecordResult">
        <include refid="selectServiceAppointRecordVo"/>
        where 1=1
        and del_flag=0
        <if test="appointRecSn != null  and appointRecSn != ''">
            and appoint_rec_sn = #{appointRecSn}
        </if>
        <if test="changeAppointRecSn != null  and changeAppointRecSn != ''">
            and change_appoint_rec_sn = #{changeAppointRecSn}
        </if>
        <if test="orgCode != null  and orgCode != ''">
            and org_code = #{orgCode}
        </if>
        <if test="patFileSn != null  and patFileSn != ''">
            and pat_file_sn = #{patFileSn}
        </if>
        <if test="patMediaSn != null  and patMediaSn != ''">
            and pat_media_sn = #{patMediaSn}
        </if>
        <if test="patMediaNum != null  and patMediaNum != ''">
            and pat_media_num = #{patMediaNum}
        </if>
        <if test="patCateSn != null  and patCateSn != ''">
            and pat_cate_sn = #{patCateSn}
        </if>
        <if test="patNatureSn != null  and patNatureSn != ''">
            and pat_nature_sn = #{patNatureSn}
        </if>
        <if test="patFileName != null  and patFileName != ''">
            and pat_file_name like concat('%', #{patFileName}, '%')
        </if>
        <if test="patFileGender != null  and patFileGender != ''">
            and pat_file_gender = #{patFileGender}
        </if>
        <if test="patAge != null  and patAge != ''">
            and pat_age = #{patAge}
        </if>
        <if test="patBirthday != null  and patBirthday != ''">
            and pat_birthday = #{patBirthday}
        </if>
        <if test="patCardTypeCode != null  and patCardTypeCode != ''">
            and pat_card_type_code = #{patCardTypeCode}
        </if>
        <if test="patCardType != null  and patCardType != ''">
            and pat_card_type = #{patCardType}
        </if>
        <if test="patIdCardNum != null  and patIdCardNum != ''">
            and pat_id_card_num = #{patIdCardNum}
        </if>
        <if test="patAddr != null  and patAddr != ''">
            and pat_addr = #{patAddr}
        </if>
        <if test="patTel != null  and patTel != ''">
            and pat_tel = #{patTel}
        </if>
        <if test="patWayCode != null  and patWayCode != ''">
            and pat_way_code = #{patWayCode}
        </if>
        <if test="patWay != null  and patWay != ''">
            and pat_way = #{patWay}
        </if>
        <if test="appointTypeSn != null  and appointTypeSn != ''">
            and appoint_type_sn = #{appointTypeSn}
        </if>
        <if test="appointDate != null  and appointDate != ''">
            and appoint_date = #{appointDate}
        </if>
        <if test="appointOperatorId != null  and appointOperatorId != ''">
            and appoint_operator_id = #{appointOperatorId}
        </if>
        <if test="appointOperatorName != null  and appointOperatorName != ''">
            and appoint_operator_name like concat('%', #{appointOperatorName}, '%')
        </if>
        <if test="appointRegistDate != null  and appointRegistDate != ''">
            and appoint_regist_date = #{appointRegistDate}
        </if>
        <if test="registerScheduleSn != null  and registerScheduleSn != ''">
            and register_schedule_sn = #{registerScheduleSn}
        </if>
        <if test="outpatCateSn != null  and outpatCateSn != ''">
            and outpat_cate_sn = #{outpatCateSn}
        </if>
        <if test="outpatCateName != null  and outpatCateName != ''">
            and outpat_cate_name like concat('%', #{outpatCateName}, '%')
        </if>
        <if test="registDeptCode != null  and registDeptCode != ''">
            and regist_dept_code = #{registDeptCode}
        </if>
        <if test="registDeptName != null  and registDeptName != ''">
            and regist_dept_name like concat('%', #{registDeptName}, '%')
        </if>
        <if test="deptPinyinCode != null  and deptPinyinCode != ''">
            and dept_pinyin_code = #{deptPinyinCode}
        </if>
        <if test="registDoctCode != null  and registDoctCode != ''">
            and regist_doct_code = #{registDoctCode}
        </if>
        <if test="registDoctName != null  and registDoctName != ''">
            and regist_doct_name like concat('%', #{registDoctName}, '%')
        </if>
        <if test="staffPinyinCode != null  and staffPinyinCode != ''">
            and staff_pinyin_code = #{staffPinyinCode}
        </if>
        <if test="registTimeCate != null ">
            and regist_time_cate = #{registTimeCate}
        </if>
        <if test="patiRegistSn != null ">
            and pati_regist_sn = #{patiRegistSn}
        </if>
        <if test="scheduleRegistCharge != null ">
            and schedule_regist_charge = #{scheduleRegistCharge}
        </if>
        <if test="registRecSn != null  and registRecSn != ''">
            and regist_rec_sn = #{registRecSn}
        </if>
        <if test="regUserSn != null  and regUserSn != ''">
            and reg_user_sn = #{regUserSn}
        </if>
        <if test="regUserName != null  and regUserName != ''">
            and reg_user_name like concat('%', #{regUserName}, '%')
        </if>
        <if test="regOptTime != null  and regOptTime != ''">
            and reg_opt_time = #{regOptTime}
        </if>
        <if test="revokeUserSn != null  and revokeUserSn != ''">
            and revoke_user_sn = #{revokeUserSn}
        </if>
        <if test="revokeUserName != null  and revokeUserName != ''">
            and revoke_user_name like concat('%', #{revokeUserName}, '%')
        </if>
        <if test="revokeOptTime != null  and revokeOptTime != ''">
            and revoke_opt_time = #{revokeOptTime}
        </if>
        <if test="withdrawalTime != null  and withdrawalTime != ''">
            and withdrawal_time = #{withdrawalTime}
        </if>
        <if test="scheduleStatusFlag != null ">
            and schedule_status_flag = #{scheduleStatusFlag}
        </if>
        <if test="scheduleMemoDesc != null  and scheduleMemoDesc != ''">
            and schedule_memo_desc = #{scheduleMemoDesc}
        </if>
        <if test="scheduleCredenceNum != null  and scheduleCredenceNum != ''">
            and schedule_credence_num = #{scheduleCredenceNum}
        </if>
        <if test="registTimeRange != null  and registTimeRange != ''">
            and regist_time_range = #{registTimeRange}
        </if>
        <if test="scheduleDetailSn != null  and scheduleDetailSn != ''">
            and schedule_detail_sn = #{scheduleDetailSn}
        </if>
        <if test="treatDate != null  and treatDate != ''">
            and treat_date = #{treatDate}
        </if>
        <if test="treatDoctCode != null  and treatDoctCode != ''">
            and treat_doct_code = #{treatDoctCode}
        </if>
        <if test="treatDoctName != null  and treatDoctName != ''">
            and treat_doct_name like concat('%', #{treatDoctName}, '%')
        </if>
        <if test="regWayCode != null  and regWayCode != ''">
            and reg_way_code = #{regWayCode}
        </if>
        <if test="regWay != null  and regWay != ''">
            and reg_way = #{regWay}
        </if>
        <if test="regSystemWayCode != null  and regSystemWayCode != ''">
            and reg_system_way_code = #{regSystemWayCode}
        </if>
        <if test="regSystemWay != null  and regSystemWay != ''">
            and reg_system_way = #{regSystemWay}
        </if>
        <if test="visitFlag != null ">
            and visit_flag = #{visitFlag}
        </if>
        <if test="senderId != null  and senderId != ''">
            and sender_id = #{senderId}
        </if>
        <if test="senderName != null  and senderName != ''">
            and sender_name like concat('%', #{senderName}, '%')
        </if>
        <if test="sendTime != null  and sendTime != ''">
            and send_time = #{sendTime}
        </if>
    </select>
 
    <select id="selectServiceAppointRecordById" parameterType="Long"
            resultMap="ServiceAppointRecordResult">
        <include refid="selectServiceAppointRecordVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertServiceAppointRecord" parameterType="com.smartor.domain.ServiceAppointRecord"
            useGeneratedKeys="true" keyProperty="id">
        insert into service_appoint_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="appointRecSn != null">appoint_rec_sn,
            </if>
            <if test="changeAppointRecSn != null">change_appoint_rec_sn,
            </if>
            <if test="orgCode != null">org_code,
            </if>
            <if test="patFileSn != null">pat_file_sn,
            </if>
            <if test="patMediaSn != null">pat_media_sn,
            </if>
            <if test="patMediaNum != null">pat_media_num,
            </if>
            <if test="patCateSn != null">pat_cate_sn,
            </if>
            <if test="patNatureSn != null">pat_nature_sn,
            </if>
            <if test="patFileName != null">pat_file_name,
            </if>
            <if test="patFileGender != null">pat_file_gender,
            </if>
            <if test="patAge != null">pat_age,
            </if>
            <if test="patBirthday != null">pat_birthday,
            </if>
            <if test="patCardTypeCode != null">pat_card_type_code,
            </if>
            <if test="patCardType != null">pat_card_type,
            </if>
            <if test="patIdCardNum != null">pat_id_card_num,
            </if>
            <if test="patAddr != null">pat_addr,
            </if>
            <if test="patTel != null">pat_tel,
            </if>
            <if test="patWayCode != null">pat_way_code,
            </if>
            <if test="patWay != null">pat_way,
            </if>
            <if test="appointTypeSn != null">appoint_type_sn,
            </if>
            <if test="appointDate != null">appoint_date,
            </if>
            <if test="appointOperatorId != null">appoint_operator_id,
            </if>
            <if test="appointOperatorName != null">appoint_operator_name,
            </if>
            <if test="appointRegistDate != null">appoint_regist_date,
            </if>
            <if test="registerScheduleSn != null">register_schedule_sn,
            </if>
            <if test="outpatCateSn != null">outpat_cate_sn,
            </if>
            <if test="outpatCateName != null">outpat_cate_name,
            </if>
            <if test="registDeptCode != null">regist_dept_code,
            </if>
            <if test="registDeptName != null">regist_dept_name,
            </if>
            <if test="deptPinyinCode != null">dept_pinyin_code,
            </if>
            <if test="registDoctCode != null">regist_doct_code,
            </if>
            <if test="registDoctName != null">regist_doct_name,
            </if>
            <if test="staffPinyinCode != null">staff_pinyin_code,
            </if>
            <if test="registTimeCate != null">regist_time_cate,
            </if>
            <if test="patiRegistSn != null">pati_regist_sn,
            </if>
            <if test="scheduleRegistCharge != null">schedule_regist_charge,
            </if>
            <if test="registRecSn != null">regist_rec_sn,
            </if>
            <if test="regUserSn != null">reg_user_sn,
            </if>
            <if test="regUserName != null">reg_user_name,
            </if>
            <if test="regOptTime != null">reg_opt_time,
            </if>
            <if test="revokeUserSn != null">revoke_user_sn,
            </if>
            <if test="revokeUserName != null">revoke_user_name,
            </if>
            <if test="revokeOptTime != null">revoke_opt_time,
            </if>
            <if test="withdrawalTime != null">withdrawal_time,
            </if>
            <if test="scheduleStatusFlag != null">schedule_status_flag,
            </if>
            <if test="scheduleMemoDesc != null">schedule_memo_desc,
            </if>
            <if test="scheduleCredenceNum != null">schedule_credence_num,
            </if>
            <if test="registTimeRange != null">regist_time_range,
            </if>
            <if test="scheduleDetailSn != null">schedule_detail_sn,
            </if>
            <if test="treatDate != null">treat_date,
            </if>
            <if test="treatDoctCode != null">treat_doct_code,
            </if>
            <if test="treatDoctName != null">treat_doct_name,
            </if>
            <if test="regWayCode != null">reg_way_code,
            </if>
            <if test="regWay != null">reg_way,
            </if>
            <if test="regSystemWayCode != null">reg_system_way_code,
            </if>
            <if test="regSystemWay != null">reg_system_way,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="updateTime != null">update_time,
            </if>
            <if test="visitFlag != null">visit_flag,
            </if>
            <if test="senderId != null">sender_id,
            </if>
            <if test="senderName != null">sender_name,
            </if>
            <if test="sendTime != null">send_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="appointRecSn != null">#{appointRecSn},
            </if>
            <if test="changeAppointRecSn != null">#{changeAppointRecSn},
            </if>
            <if test="orgCode != null">#{orgCode},
            </if>
            <if test="patFileSn != null">#{patFileSn},
            </if>
            <if test="patMediaSn != null">#{patMediaSn},
            </if>
            <if test="patMediaNum != null">#{patMediaNum},
            </if>
            <if test="patCateSn != null">#{patCateSn},
            </if>
            <if test="patNatureSn != null">#{patNatureSn},
            </if>
            <if test="patFileName != null">#{patFileName},
            </if>
            <if test="patFileGender != null">#{patFileGender},
            </if>
            <if test="patAge != null">#{patAge},
            </if>
            <if test="patBirthday != null">#{patBirthday},
            </if>
            <if test="patCardTypeCode != null">#{patCardTypeCode},
            </if>
            <if test="patCardType != null">#{patCardType},
            </if>
            <if test="patIdCardNum != null">#{patIdCardNum},
            </if>
            <if test="patAddr != null">#{patAddr},
            </if>
            <if test="patTel != null">#{patTel},
            </if>
            <if test="patWayCode != null">#{patWayCode},
            </if>
            <if test="patWay != null">#{patWay},
            </if>
            <if test="appointTypeSn != null">#{appointTypeSn},
            </if>
            <if test="appointDate != null">#{appointDate},
            </if>
            <if test="appointOperatorId != null">#{appointOperatorId},
            </if>
            <if test="appointOperatorName != null">#{appointOperatorName},
            </if>
            <if test="appointRegistDate != null">#{appointRegistDate},
            </if>
            <if test="registerScheduleSn != null">#{registerScheduleSn},
            </if>
            <if test="outpatCateSn != null">#{outpatCateSn},
            </if>
            <if test="outpatCateName != null">#{outpatCateName},
            </if>
            <if test="registDeptCode != null">#{registDeptCode},
            </if>
            <if test="registDeptName != null">#{registDeptName},
            </if>
            <if test="deptPinyinCode != null">#{deptPinyinCode},
            </if>
            <if test="registDoctCode != null">#{registDoctCode},
            </if>
            <if test="registDoctName != null">#{registDoctName},
            </if>
            <if test="staffPinyinCode != null">#{staffPinyinCode},
            </if>
            <if test="registTimeCate != null">#{registTimeCate},
            </if>
            <if test="patiRegistSn != null">#{patiRegistSn},
            </if>
            <if test="scheduleRegistCharge != null">#{scheduleRegistCharge},
            </if>
            <if test="registRecSn != null">#{registRecSn},
            </if>
            <if test="regUserSn != null">#{regUserSn},
            </if>
            <if test="regUserName != null">#{regUserName},
            </if>
            <if test="regOptTime != null">#{regOptTime},
            </if>
            <if test="revokeUserSn != null">#{revokeUserSn},
            </if>
            <if test="revokeUserName != null">#{revokeUserName},
            </if>
            <if test="revokeOptTime != null">#{revokeOptTime},
            </if>
            <if test="withdrawalTime != null">#{withdrawalTime},
            </if>
            <if test="scheduleStatusFlag != null">#{scheduleStatusFlag},
            </if>
            <if test="scheduleMemoDesc != null">#{scheduleMemoDesc},
            </if>
            <if test="scheduleCredenceNum != null">#{scheduleCredenceNum},
            </if>
            <if test="registTimeRange != null">#{registTimeRange},
            </if>
            <if test="scheduleDetailSn != null">#{scheduleDetailSn},
            </if>
            <if test="treatDate != null">#{treatDate},
            </if>
            <if test="treatDoctCode != null">#{treatDoctCode},
            </if>
            <if test="treatDoctName != null">#{treatDoctName},
            </if>
            <if test="regWayCode != null">#{regWayCode},
            </if>
            <if test="regWay != null">#{regWay},
            </if>
            <if test="regSystemWayCode != null">#{regSystemWayCode},
            </if>
            <if test="regSystemWay != null">#{regSystemWay},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
            <if test="visitFlag != null">#{visitFlag},
            </if>
            <if test="senderId != null">#{senderId},
            </if>
            <if test="senderName != null">#{senderName},
            </if>
            <if test="sendTime != null">#{sendTime},
            </if>
        </trim>
    </insert>
 
    <update id="updateServiceAppointRecord" parameterType="com.smartor.domain.ServiceAppointRecord">
        update service_appoint_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="appointRecSn != null">appoint_rec_sn =
                #{appointRecSn},
            </if>
            <if test="changeAppointRecSn != null">change_appoint_rec_sn =
                #{changeAppointRecSn},
            </if>
            <if test="orgCode != null">org_code =
                #{orgCode},
            </if>
            <if test="patFileSn != null">pat_file_sn =
                #{patFileSn},
            </if>
            <if test="patMediaSn != null">pat_media_sn =
                #{patMediaSn},
            </if>
            <if test="patMediaNum != null">pat_media_num =
                #{patMediaNum},
            </if>
            <if test="patCateSn != null">pat_cate_sn =
                #{patCateSn},
            </if>
            <if test="patNatureSn != null">pat_nature_sn =
                #{patNatureSn},
            </if>
            <if test="patFileName != null">pat_file_name =
                #{patFileName},
            </if>
            <if test="patFileGender != null">pat_file_gender =
                #{patFileGender},
            </if>
            <if test="patAge != null">pat_age =
                #{patAge},
            </if>
            <if test="patBirthday != null">pat_birthday =
                #{patBirthday},
            </if>
            <if test="patCardTypeCode != null">pat_card_type_code =
                #{patCardTypeCode},
            </if>
            <if test="patCardType != null">pat_card_type =
                #{patCardType},
            </if>
            <if test="patIdCardNum != null">pat_id_card_num =
                #{patIdCardNum},
            </if>
            <if test="patAddr != null">pat_addr =
                #{patAddr},
            </if>
            <if test="patTel != null">pat_tel =
                #{patTel},
            </if>
            <if test="patWayCode != null">pat_way_code =
                #{patWayCode},
            </if>
            <if test="patWay != null">pat_way =
                #{patWay},
            </if>
            <if test="appointTypeSn != null">appoint_type_sn =
                #{appointTypeSn},
            </if>
            <if test="appointDate != null">appoint_date =
                #{appointDate},
            </if>
            <if test="appointOperatorId != null">appoint_operator_id =
                #{appointOperatorId},
            </if>
            <if test="appointOperatorName != null">appoint_operator_name =
                #{appointOperatorName},
            </if>
            <if test="appointRegistDate != null">appoint_regist_date =
                #{appointRegistDate},
            </if>
            <if test="registerScheduleSn != null">register_schedule_sn =
                #{registerScheduleSn},
            </if>
            <if test="outpatCateSn != null">outpat_cate_sn =
                #{outpatCateSn},
            </if>
            <if test="outpatCateName != null">outpat_cate_name =
                #{outpatCateName},
            </if>
            <if test="registDeptCode != null">regist_dept_code =
                #{registDeptCode},
            </if>
            <if test="registDeptName != null">regist_dept_name =
                #{registDeptName},
            </if>
            <if test="deptPinyinCode != null">dept_pinyin_code =
                #{deptPinyinCode},
            </if>
            <if test="registDoctCode != null">regist_doct_code =
                #{registDoctCode},
            </if>
            <if test="registDoctName != null">regist_doct_name =
                #{registDoctName},
            </if>
            <if test="staffPinyinCode != null">staff_pinyin_code =
                #{staffPinyinCode},
            </if>
            <if test="registTimeCate != null">regist_time_cate =
                #{registTimeCate},
            </if>
            <if test="patiRegistSn != null">pati_regist_sn =
                #{patiRegistSn},
            </if>
            <if test="scheduleRegistCharge != null">schedule_regist_charge =
                #{scheduleRegistCharge},
            </if>
            <if test="registRecSn != null">regist_rec_sn =
                #{registRecSn},
            </if>
            <if test="regUserSn != null">reg_user_sn =
                #{regUserSn},
            </if>
            <if test="regUserName != null">reg_user_name =
                #{regUserName},
            </if>
            <if test="regOptTime != null">reg_opt_time =
                #{regOptTime},
            </if>
            <if test="revokeUserSn != null">revoke_user_sn =
                #{revokeUserSn},
            </if>
            <if test="revokeUserName != null">revoke_user_name =
                #{revokeUserName},
            </if>
            <if test="revokeOptTime != null">revoke_opt_time =
                #{revokeOptTime},
            </if>
            <if test="withdrawalTime != null">withdrawal_time =
                #{withdrawalTime},
            </if>
            <if test="scheduleStatusFlag != null">schedule_status_flag =
                #{scheduleStatusFlag},
            </if>
            <if test="scheduleMemoDesc != null">schedule_memo_desc =
                #{scheduleMemoDesc},
            </if>
            <if test="scheduleCredenceNum != null">schedule_credence_num =
                #{scheduleCredenceNum},
            </if>
            <if test="registTimeRange != null">regist_time_range =
                #{registTimeRange},
            </if>
            <if test="scheduleDetailSn != null">schedule_detail_sn =
                #{schedDetailSn},
            </if>
            <if test="treatDate != null">treat_date =
                #{treatDate},
            </if>
            <if test="treatDoctCode != null">treat_doct_code =
                #{treatDoctCode},
            </if>
            <if test="treatDoctName != null">treat_doct_name =
                #{treatDoctName},
            </if>
            <if test="regWayCode != null">reg_way_code =
                #{regWayCode},
            </if>
            <if test="regWay != null">reg_way =
                #{regWay},
            </if>
            <if test="regSystemWayCode != null">reg_system_way_code =
                #{regSystemWayCode},
            </if>
            <if test="regSystemWay != null">reg_system_way =
                #{regSystemWay},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="visitFlag != null">visit_flag =
                #{visitFlag},
            </if>
            <if test="senderId != null">sender_id =
                #{senderId},
            </if>
            <if test="senderName != null">sender_name =
                #{senderName},
            </if>
            <if test="sendTime != null">send_time =
                #{sendTime},
            </if>
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceAppointRecordById" parameterType="Long">
        update service_appoint_record
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceAppointRecordByIds" parameterType="String">
        update service_appoint_record
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
 
 
</mapper>