liusheng
9 天以前 9cc2f53b11205309754c2451be061ef5fc337f32
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
<?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.HospitalUserinfoMapper">
 
    <resultMap type="com.smartor.domain.HospitalUserinfo" id="HospitalUserinfoResult">
        <result property="ID" column="ID"/>
        <result property="SourceSystem" column="SourceSystem"/>
        <result property="MessageID" column="MessageID"/>
        <result property="CreateTime" column="CreateTime"/>
        <result property="MethodName" column="MethodName"/>
        <result property="ReqIimRules" column="ReqIimRules"/>
        <result property="PatientID" column="PatientID"/>
        <result property="VisitNum" column="VisitNum"/>
        <result property="RegDate" column="RegDate"/>
        <result property="IdentityID" column="IdentityID"/>
        <result property="PatName" column="PatName"/>
        <result property="Phone" column="Phone"/>
        <result property="PatSex" column="PatSex"/>
        <result property="BirthDate" column="BirthDate"/>
        <result property="Address" column="Address"/>
        <result property="AddProvince" column="AddProvince"/>
        <result property="AddCity" column="AddCity"/>
        <result property="AddCounty" column="AddCounty"/>
        <result property="AddTown" column="AddTown"/>
        <result property="AddVillage" column="AddVillage"/>
        <result property="AddHouseNo" column="AddHouseNo"/>
        <result property="HouseAddress" column="HouseAddress"/>
        <result property="HouseAddProvince" column="HouseAddProvince"/>
        <result property="HouseAddCity" column="HouseAddCity"/>
        <result property="HouseAddCounty" column="HouseAddCounty"/>
        <result property="HouseAddTown" column="HouseAddTown"/>
        <result property="HouseAddVillage" column="HouseAddVillage"/>
        <result property="HouseAddHouseNo" column="HouseAddHouseNo"/>
        <result property="BirthAddress" column="BirthAddress"/>
        <result property="BirthAddProvince" column="BirthAddProvince"/>
        <result property="BirthAddCity" column="BirthAddCity"/>
        <result property="BirthAddCounty" column="BirthAddCounty"/>
        <result property="BirthAddTown" column="BirthAddTown"/>
        <result property="BirthAddVillage" column="BirthAddVillage"/>
        <result property="BirthAddHouseNo" column="BirthAddHouseNo"/>
        <result property="ContactsAddress" column="ContactsAddress"/>
        <result property="ContactsAddProvince" column="ContactsAddProvince"/>
        <result property="ContactsAddCity" column="ContactsAddCity"/>
        <result property="ContactsAddCounty" column="ContactsAddCounty"/>
        <result property="ContactsAddTown" column="ContactsAddTown"/>
        <result property="ContactsAddVillage" column="ContactsAddVillage"/>
        <result property="ContactsAddHouseNo" column="ContactsAddHouseNo"/>
        <result property="NativeAddress" column="NativeAddress"/>
        <result property="NativeAddProvince" column="NativeAddProvince"/>
        <result property="NativeAddCity" column="NativeAddCity"/>
        <result property="NativeAddCounty" column="NativeAddCounty"/>
        <result property="NativeAddTown" column="NativeAddTown"/>
        <result property="NativeAddVillage" column="NativeAddVillage"/>
        <result property="NativeAddHouseNo" column="NativeAddHouseNo"/>
        <result property="PostalCode" column="PostalCode"/>
        <result property="HouseCode" column="HouseCode"/>
        <result property="WorkCode" column="WorkCode"/>
        <result property="MaritalStatus" column="MaritalStatus"/>
        <result property="Country" column="Country"/>
        <result property="Nation" column="Nation"/>
        <result property="NationCode" column="NationCode"/>
        <result property="OccupType" column="OccupType"/>
        <result property="OccupTypeCode" column="OccupTypeCode"/>
        <result property="WorkUnit" column="WorkUnit"/>
        <result property="WorkPhone" column="WorkPhone"/>
        <result property="HCardNo" column="HCardNo"/>
        <result property="HCIssuersCode" column="HCIssuersCode"/>
        <result property="HUrbanCode" column="HUrbanCode"/>
        <result property="MedOrgCode" column="MedOrgCode"/>
        <result property="paycode" column="paycode"/>
        <result property="payname" column="payname"/>
        <result property="ConRelShip" column="ConRelShip"/>
        <result property="ConPerPhone" column="ConPerPhone"/>
        <result property="ConPerName" column="ConPerName"/>
        <result property="RegOrgCode" column="RegOrgCode"/>
        <result property="RegOrgDesc" column="RegOrgDesc"/>
        <result property="InsureOrgName" column="InsureOrgName"/>
        <result property="InsureOrgCode" column="InsureOrgCode"/>
        <result property="RegEmpCode" column="RegEmpCode"/>
        <result property="RegEmpName" column="RegEmpName"/>
        <result property="INEnroomno" column="INEnroomno"/>
        <result property="OUTEnroomno" column="OUTEnroomno"/>
        <result property="EncAdmSource" column="EncAdmSource"/>
        <result property="Directordoc" column="Directordoc"/>
        <result property="Attenddoc" column="Attenddoc"/>
        <result property="Beddoc" column="Beddoc"/>
        <result property="Bednur" column="Bednur"/>
        <result property="Regdoc" column="Regdoc"/>
        <result property="guid" column="guid"/>
        <result property="orgid" column="orgid"/>
    </resultMap>
 
    <sql id="selectHospitalUserinfoVo">
        select ID,
               SourceSystem,
               MessageID,
               CreateTime,
               MethodName,
               ReqIimRules,
               PatientID,
               VisitNum,
               RegDate,
               IdentityID,
               PatName,
               Phone,
               PatSex,
               BirthDate,
               Address,
               AddProvince,
               AddCity,
               AddCounty,
               AddTown,
               AddVillage,
               AddHouseNo,
               HouseAddress,
               HouseAddProvince,
               HouseAddCity,
               HouseAddCounty,
               HouseAddTown,
               HouseAddVillage,
               HouseAddHouseNo,
               BirthAddress,
               BirthAddProvince,
               BirthAddCity,
               BirthAddCounty,
               BirthAddTown,
               BirthAddVillage,
               BirthAddHouseNo,
               ContactsAddress,
               ContactsAddProvince,
               ContactsAddCity,
               ContactsAddCounty,
               ContactsAddTown,
               ContactsAddVillage,
               ContactsAddHouseNo,
               NativeAddress,
               NativeAddProvince,
               NativeAddCity,
               NativeAddCounty,
               NativeAddTown,
               NativeAddVillage,
               NativeAddHouseNo,
               PostalCode,
               HouseCode,
               WorkCode,
               MaritalStatus,
               Country,
               Nation,
               NationCode,
               OccupType,
               OccupTypeCode,
               WorkUnit,
               WorkPhone,
               HCardNo,
               HCIssuersCode,
               HUrbanCode,
               MedOrgCode,
               paycode,
               payname,
               ConRelShip,
               ConPerPhone,
               ConPerName,
               RegOrgCode,
               RegOrgDesc,
               orgid,
               InsureOrgName,
               InsureOrgCode,
               RegEmpCode,
               RegEmpName,
               INEnroomno,
               OUTEnroomno,
               EncAdmSource,
               Directordoc,
               Attenddoc,
               Beddoc,
               Bednur,
               guid,
               Regdoc
        from hospital_userinfo
    </sql>
 
    <select id="selectHospitalUserinfoList" parameterType="HospitalUserinfo" resultMap="HospitalUserinfoResult">
        <include refid="selectHospitalUserinfoVo"/>
        <where>
            <if test="SourceSystem != null  and SourceSystem != ''">and SourceSystem = #{SourceSystem}</if>
            <if test="MessageID != null  and MessageID != ''">and MessageID = #{MessageID}</if>
            <if test="CreateTime != null  and CreateTime != ''">and CreateTime = #{CreateTime}</if>
            <if test="MethodName != null  and MethodName != ''">and MethodName like concat('%', #{MethodName}, '%')</if>
            <if test="ReqIimRules != null  and ReqIimRules != ''">and ReqIimRules = #{ReqIimRules}</if>
            <if test="PatientID != null  and PatientID != ''">and PatientID = #{PatientID}</if>
            <if test="VisitNum != null  and VisitNum != ''">and VisitNum = #{VisitNum}</if>
            <if test="RegDate != null  and RegDate != ''">and RegDate = #{RegDate}</if>
            <if test="IdentityID != null  and IdentityID != ''">and IdentityID = #{IdentityID}</if>
            <if test="PatName != null  and PatName != ''">and PatName like concat('%', #{PatName}, '%')</if>
            <if test="Phone != null  and Phone != ''">and Phone = #{Phone}</if>
            <if test="PatSex != null  and PatSex != ''">and PatSex = #{PatSex}</if>
            <if test="BirthDate != null  and BirthDate != ''">and BirthDate = #{BirthDate}</if>
            <if test="Address != null  and Address != ''">and Address = #{Address}</if>
            <if test="AddProvince != null  and AddProvince != ''">and AddProvince = #{AddProvince}</if>
            <if test="AddCity != null  and AddCity != ''">and AddCity = #{AddCity}</if>
            <if test="AddCounty != null  and AddCounty != ''">and AddCounty = #{AddCounty}</if>
            <if test="AddTown != null  and AddTown != ''">and AddTown = #{AddTown}</if>
            <if test="AddVillage != null  and AddVillage != ''">and AddVillage = #{AddVillage}</if>
            <if test="AddHouseNo != null  and AddHouseNo != ''">and AddHouseNo = #{AddHouseNo}</if>
            <if test="HouseAddress != null  and HouseAddress != ''">and HouseAddress = #{HouseAddress}</if>
            <if test="HouseAddProvince != null  and HouseAddProvince != ''">and HouseAddProvince = #{HouseAddProvince}
            </if>
            <if test="HouseAddCity != null  and HouseAddCity != ''">and HouseAddCity = #{HouseAddCity}</if>
            <if test="HouseAddCounty != null  and HouseAddCounty != ''">and HouseAddCounty = #{HouseAddCounty}</if>
            <if test="HouseAddTown != null  and HouseAddTown != ''">and HouseAddTown = #{HouseAddTown}</if>
            <if test="HouseAddVillage != null  and HouseAddVillage != ''">and HouseAddVillage = #{HouseAddVillage}</if>
            <if test="HouseAddHouseNo != null  and HouseAddHouseNo != ''">and HouseAddHouseNo = #{HouseAddHouseNo}</if>
            <if test="BirthAddress != null  and BirthAddress != ''">and BirthAddress = #{BirthAddress}</if>
            <if test="BirthAddProvince != null  and BirthAddProvince != ''">and BirthAddProvince = #{BirthAddProvince}
            </if>
            <if test="BirthAddCity != null  and BirthAddCity != ''">and BirthAddCity = #{BirthAddCity}</if>
            <if test="BirthAddCounty != null  and BirthAddCounty != ''">and BirthAddCounty = #{BirthAddCounty}</if>
            <if test="BirthAddTown != null  and BirthAddTown != ''">and BirthAddTown = #{BirthAddTown}</if>
            <if test="BirthAddVillage != null  and BirthAddVillage != ''">and BirthAddVillage = #{BirthAddVillage}</if>
            <if test="BirthAddHouseNo != null  and BirthAddHouseNo != ''">and BirthAddHouseNo = #{BirthAddHouseNo}</if>
            <if test="ContactsAddress != null  and ContactsAddress != ''">and ContactsAddress = #{ContactsAddress}</if>
            <if test="ContactsAddProvince != null  and ContactsAddProvince != ''">and ContactsAddProvince =
                #{ContactsAddProvince}
            </if>
            <if test="ContactsAddCity != null  and ContactsAddCity != ''">and ContactsAddCity = #{ContactsAddCity}</if>
            <if test="ContactsAddCounty != null  and ContactsAddCounty != ''">and ContactsAddCounty =
                #{ContactsAddCounty}
            </if>
            <if test="ContactsAddTown != null  and ContactsAddTown != ''">and ContactsAddTown = #{ContactsAddTown}</if>
            <if test="ContactsAddVillage != null  and ContactsAddVillage != ''">and ContactsAddVillage =
                #{ContactsAddVillage}
            </if>
            <if test="ContactsAddHouseNo != null  and ContactsAddHouseNo != ''">and ContactsAddHouseNo =
                #{ContactsAddHouseNo}
            </if>
            <if test="NativeAddress != null  and NativeAddress != ''">and NativeAddress = #{NativeAddress}</if>
            <if test="NativeAddProvince != null  and NativeAddProvince != ''">and NativeAddProvince =
                #{NativeAddProvince}
            </if>
            <if test="NativeAddCity != null  and NativeAddCity != ''">and NativeAddCity = #{NativeAddCity}</if>
            <if test="NativeAddCounty != null  and NativeAddCounty != ''">and NativeAddCounty = #{NativeAddCounty}</if>
            <if test="NativeAddTown != null  and NativeAddTown != ''">and NativeAddTown = #{NativeAddTown}</if>
            <if test="NativeAddVillage != null  and NativeAddVillage != ''">and NativeAddVillage = #{NativeAddVillage}
            </if>
            <if test="NativeAddHouseNo != null  and NativeAddHouseNo != ''">and NativeAddHouseNo = #{NativeAddHouseNo}
            </if>
            <if test="PostalCode != null  and PostalCode != ''">and PostalCode = #{PostalCode}</if>
            <if test="HouseCode != null  and HouseCode != ''">and HouseCode = #{HouseCode}</if>
            <if test="WorkCode != null  and WorkCode != ''">and WorkCode = #{WorkCode}</if>
            <if test="MaritalStatus != null  and MaritalStatus != ''">and MaritalStatus = #{MaritalStatus}</if>
            <if test="Country != null  and Country != ''">and Country = #{Country}</if>
            <if test="Nation != null  and Nation != ''">and Nation = #{Nation}</if>
            <if test="NationCode != null  and NationCode != ''">and NationCode = #{NationCode}</if>
            <if test="OccupType != null  and OccupType != ''">and OccupType = #{OccupType}</if>
            <if test="OccupTypeCode != null  and OccupTypeCode != ''">and OccupTypeCode = #{OccupTypeCode}</if>
            <if test="WorkUnit != null  and WorkUnit != ''">and WorkUnit = #{WorkUnit}</if>
            <if test="WorkPhone != null  and WorkPhone != ''">and WorkPhone = #{WorkPhone}</if>
            <if test="HCardNo != null  and HCardNo != ''">and HCardNo = #{HCardNo}</if>
            <if test="HCIssuersCode != null  and HCIssuersCode != ''">and HCIssuersCode = #{HCIssuersCode}</if>
            <if test="HUrbanCode != null  and HUrbanCode != ''">and HUrbanCode = #{HUrbanCode}</if>
            <if test="MedOrgCode != null  and MedOrgCode != ''">and MedOrgCode = #{MedOrgCode}</if>
            <if test="paycode != null  and paycode != ''">and paycode = #{paycode}</if>
            <if test="payname != null  and payname != ''">and payname like concat('%', #{payname}, '%')</if>
            <if test="ConRelShip != null  and ConRelShip != ''">and ConRelShip = #{ConRelShip}</if>
            <if test="ConPerPhone != null  and ConPerPhone != ''">and ConPerPhone = #{ConPerPhone}</if>
            <if test="ConPerName != null  and ConPerName != ''">and ConPerName like concat('%', #{ConPerName}, '%')</if>
            <if test="RegOrgCode != null  and RegOrgCode != ''">and RegOrgCode = #{RegOrgCode}</if>
            <if test="RegOrgDesc != null  and RegOrgDesc != ''">and RegOrgDesc = #{RegOrgDesc}</if>
            <if test="InsureOrgName != null  and InsureOrgName != ''">and InsureOrgName like concat('%',
                #{InsureOrgName}, '%')
            </if>
            <if test="InsureOrgCode != null  and InsureOrgCode != ''">and InsureOrgCode = #{InsureOrgCode}</if>
            <if test="RegEmpCode != null  and RegEmpCode != ''">and RegEmpCode = #{RegEmpCode}</if>
            <if test="RegEmpName != null  and RegEmpName != ''">and RegEmpName like concat('%', #{RegEmpName}, '%')</if>
            <if test="INEnroomno != null  and INEnroomno != ''">and INEnroomno = #{INEnroomno}</if>
            <if test="OUTEnroomno != null  and OUTEnroomno != ''">and OUTEnroomno = #{OUTEnroomno}</if>
            <if test="EncAdmSource != null  and EncAdmSource != ''">and EncAdmSource = #{EncAdmSource}</if>
            <if test="Directordoc != null  and Directordoc != ''">and Directordoc = #{Directordoc}</if>
            <if test="Attenddoc != null  and Attenddoc != ''">and Attenddoc = #{Attenddoc}</if>
            <if test="Beddoc != null  and Beddoc != ''">and Beddoc = #{Beddoc}</if>
            <if test="Bednur != null  and Bednur != ''">and Bednur = #{Bednur}</if>
            <if test="Regdoc != null  and Regdoc != ''">and Regdoc = #{Regdoc}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
        </where>
    </select>
 
    <select id="selectHospitalUserinfoByID" parameterType="Long" resultMap="HospitalUserinfoResult">
        <include refid="selectHospitalUserinfoVo"/>
        where ID = #{ID}
    </select>
 
    <insert id="insertHospitalUserinfo" parameterType="com.smartor.domain.HospitalUserinfo" useGeneratedKeys="true" keyProperty="ID">
        insert into hospital_userinfo
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="SourceSystem != null">SourceSystem,</if>
            <if test="MessageID != null">MessageID,</if>
            <if test="CreateTime != null  and CreateTime != ''">CreateTime,</if>
            <if test="MethodName != null">MethodName,</if>
            <if test="ReqIimRules != null">ReqIimRules,</if>
            <if test="PatientID != null">PatientID,</if>
            <if test="VisitNum != null">VisitNum,</if>
            <if test="RegDate != null">RegDate,</if>
            <if test="IdentityID != null">IdentityID,</if>
            <if test="PatName != null">PatName,</if>
            <if test="Phone != null">Phone,</if>
            <if test="PatSex != null">PatSex,</if>
            <if test="BirthDate != null">BirthDate,</if>
            <if test="Address != null">Address,</if>
            <if test="AddProvince != null">AddProvince,</if>
            <if test="AddCity != null">AddCity,</if>
            <if test="AddCounty != null">AddCounty,</if>
            <if test="AddTown != null">AddTown,</if>
            <if test="AddVillage != null">AddVillage,</if>
            <if test="AddHouseNo != null">AddHouseNo,</if>
            <if test="HouseAddress != null">HouseAddress,</if>
            <if test="HouseAddProvince != null">HouseAddProvince,</if>
            <if test="HouseAddCity != null">HouseAddCity,</if>
            <if test="HouseAddCounty != null">HouseAddCounty,</if>
            <if test="HouseAddTown != null">HouseAddTown,</if>
            <if test="HouseAddVillage != null">HouseAddVillage,</if>
            <if test="HouseAddHouseNo != null">HouseAddHouseNo,</if>
            <if test="BirthAddress != null">BirthAddress,</if>
            <if test="BirthAddProvince != null">BirthAddProvince,</if>
            <if test="BirthAddCity != null">BirthAddCity,</if>
            <if test="BirthAddCounty != null">BirthAddCounty,</if>
            <if test="BirthAddTown != null">BirthAddTown,</if>
            <if test="BirthAddVillage != null">BirthAddVillage,</if>
            <if test="BirthAddHouseNo != null">BirthAddHouseNo,</if>
            <if test="ContactsAddress != null">ContactsAddress,</if>
            <if test="ContactsAddProvince != null">ContactsAddProvince,</if>
            <if test="ContactsAddCity != null">ContactsAddCity,</if>
            <if test="ContactsAddCounty != null">ContactsAddCounty,</if>
            <if test="ContactsAddTown != null">ContactsAddTown,</if>
            <if test="ContactsAddVillage != null">ContactsAddVillage,</if>
            <if test="ContactsAddHouseNo != null">ContactsAddHouseNo,</if>
            <if test="NativeAddress != null">NativeAddress,</if>
            <if test="NativeAddProvince != null">NativeAddProvince,</if>
            <if test="NativeAddCity != null">NativeAddCity,</if>
            <if test="NativeAddCounty != null">NativeAddCounty,</if>
            <if test="NativeAddTown != null">NativeAddTown,</if>
            <if test="NativeAddVillage != null">NativeAddVillage,</if>
            <if test="NativeAddHouseNo != null">NativeAddHouseNo,</if>
            <if test="PostalCode != null">PostalCode,</if>
            <if test="HouseCode != null">HouseCode,</if>
            <if test="WorkCode != null">WorkCode,</if>
            <if test="MaritalStatus != null">MaritalStatus,</if>
            <if test="Country != null">Country,</if>
            <if test="Nation != null">Nation,</if>
            <if test="NationCode != null">NationCode,</if>
            <if test="OccupType != null">OccupType,</if>
            <if test="OccupTypeCode != null">OccupTypeCode,</if>
            <if test="WorkUnit != null">WorkUnit,</if>
            <if test="WorkPhone != null">WorkPhone,</if>
            <if test="HCardNo != null">HCardNo,</if>
            <if test="HCIssuersCode != null">HCIssuersCode,</if>
            <if test="HUrbanCode != null">HUrbanCode,</if>
            <if test="MedOrgCode != null">MedOrgCode,</if>
            <if test="paycode != null">paycode,</if>
            <if test="payname != null">payname,</if>
            <if test="ConRelShip != null">ConRelShip,</if>
            <if test="ConPerPhone != null">ConPerPhone,</if>
            <if test="ConPerName != null">ConPerName,</if>
            <if test="RegOrgCode != null">RegOrgCode,</if>
            <if test="RegOrgDesc != null">RegOrgDesc,</if>
            <if test="InsureOrgName != null">InsureOrgName,</if>
            <if test="InsureOrgCode != null">InsureOrgCode,</if>
            <if test="RegEmpCode != null">RegEmpCode,</if>
            <if test="RegEmpName != null">RegEmpName,</if>
            <if test="INEnroomno != null">INEnroomno,</if>
            <if test="OUTEnroomno != null">OUTEnroomno,</if>
            <if test="EncAdmSource != null">EncAdmSource,</if>
            <if test="Directordoc != null">Directordoc,</if>
            <if test="Attenddoc != null">Attenddoc,</if>
            <if test="Beddoc != null">Beddoc,</if>
            <if test="Bednur != null">Bednur,</if>
            <if test="Regdoc != null">Regdoc,</if>
            <if test="guid != null">guid,</if>
            <if test="orgid != null">orgid,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="SourceSystem != null">#{SourceSystem},</if>
            <if test="MessageID != null">#{MessageID},</if>
            <if test="CreateTime != null and CreateTime != ''">#{CreateTime},</if>
            <if test="MethodName != null">#{MethodName},</if>
            <if test="ReqIimRules != null">#{ReqIimRules},</if>
            <if test="PatientID != null">#{PatientID},</if>
            <if test="VisitNum != null">#{VisitNum},</if>
            <if test="RegDate != null">#{RegDate},</if>
            <if test="IdentityID != null">#{IdentityID},</if>
            <if test="PatName != null">#{PatName},</if>
            <if test="Phone != null">#{Phone},</if>
            <if test="PatSex != null">#{PatSex},</if>
            <if test="BirthDate != null">#{BirthDate},</if>
            <if test="Address != null">#{Address},</if>
            <if test="AddProvince != null">#{AddProvince},</if>
            <if test="AddCity != null">#{AddCity},</if>
            <if test="AddCounty != null">#{AddCounty},</if>
            <if test="AddTown != null">#{AddTown},</if>
            <if test="AddVillage != null">#{AddVillage},</if>
            <if test="AddHouseNo != null">#{AddHouseNo},</if>
            <if test="HouseAddress != null">#{HouseAddress},</if>
            <if test="HouseAddProvince != null">#{HouseAddProvince},</if>
            <if test="HouseAddCity != null">#{HouseAddCity},</if>
            <if test="HouseAddCounty != null">#{HouseAddCounty},</if>
            <if test="HouseAddTown != null">#{HouseAddTown},</if>
            <if test="HouseAddVillage != null">#{HouseAddVillage},</if>
            <if test="HouseAddHouseNo != null">#{HouseAddHouseNo},</if>
            <if test="BirthAddress != null">#{BirthAddress},</if>
            <if test="BirthAddProvince != null">#{BirthAddProvince},</if>
            <if test="BirthAddCity != null">#{BirthAddCity},</if>
            <if test="BirthAddCounty != null">#{BirthAddCounty},</if>
            <if test="BirthAddTown != null">#{BirthAddTown},</if>
            <if test="BirthAddVillage != null">#{BirthAddVillage},</if>
            <if test="BirthAddHouseNo != null">#{BirthAddHouseNo},</if>
            <if test="ContactsAddress != null">#{ContactsAddress},</if>
            <if test="ContactsAddProvince != null">#{ContactsAddProvince},</if>
            <if test="ContactsAddCity != null">#{ContactsAddCity},</if>
            <if test="ContactsAddCounty != null">#{ContactsAddCounty},</if>
            <if test="ContactsAddTown != null">#{ContactsAddTown},</if>
            <if test="ContactsAddVillage != null">#{ContactsAddVillage},</if>
            <if test="ContactsAddHouseNo != null">#{ContactsAddHouseNo},</if>
            <if test="NativeAddress != null">#{NativeAddress},</if>
            <if test="NativeAddProvince != null">#{NativeAddProvince},</if>
            <if test="NativeAddCity != null">#{NativeAddCity},</if>
            <if test="NativeAddCounty != null">#{NativeAddCounty},</if>
            <if test="NativeAddTown != null">#{NativeAddTown},</if>
            <if test="NativeAddVillage != null">#{NativeAddVillage},</if>
            <if test="NativeAddHouseNo != null">#{NativeAddHouseNo},</if>
            <if test="PostalCode != null">#{PostalCode},</if>
            <if test="HouseCode != null">#{HouseCode},</if>
            <if test="WorkCode != null">#{WorkCode},</if>
            <if test="MaritalStatus != null">#{MaritalStatus},</if>
            <if test="Country != null">#{Country},</if>
            <if test="Nation != null">#{Nation},</if>
            <if test="NationCode != null">#{NationCode},</if>
            <if test="OccupType != null">#{OccupType},</if>
            <if test="OccupTypeCode != null">#{OccupTypeCode},</if>
            <if test="WorkUnit != null">#{WorkUnit},</if>
            <if test="WorkPhone != null">#{WorkPhone},</if>
            <if test="HCardNo != null">#{HCardNo},</if>
            <if test="HCIssuersCode != null">#{HCIssuersCode},</if>
            <if test="HUrbanCode != null">#{HUrbanCode},</if>
            <if test="MedOrgCode != null">#{MedOrgCode},</if>
            <if test="paycode != null">#{paycode},</if>
            <if test="payname != null">#{payname},</if>
            <if test="ConRelShip != null">#{ConRelShip},</if>
            <if test="ConPerPhone != null">#{ConPerPhone},</if>
            <if test="ConPerName != null">#{ConPerName},</if>
            <if test="RegOrgCode != null">#{RegOrgCode},</if>
            <if test="RegOrgDesc != null">#{RegOrgDesc},</if>
            <if test="InsureOrgName != null">#{InsureOrgName},</if>
            <if test="InsureOrgCode != null">#{InsureOrgCode},</if>
            <if test="RegEmpCode != null">#{RegEmpCode},</if>
            <if test="RegEmpName != null">#{RegEmpName},</if>
            <if test="INEnroomno != null">#{INEnroomno},</if>
            <if test="OUTEnroomno != null">#{OUTEnroomno},</if>
            <if test="EncAdmSource != null">#{EncAdmSource},</if>
            <if test="Directordoc != null">#{Directordoc},</if>
            <if test="Attenddoc != null">#{Attenddoc},</if>
            <if test="Beddoc != null">#{Beddoc},</if>
            <if test="Bednur != null">#{Bednur},</if>
            <if test="Regdoc != null">#{Regdoc},</if>
            <if test="guid != null">#{guid},</if>
            <if test="orgid != null">#{orgid},</if>
        </trim>
    </insert>
 
    <update id="updateHospitalUserinfo" parameterType="com.smartor.domain.HospitalUserinfo">
        update hospital_userinfo
        <trim prefix="SET" suffixOverrides=",">
            <if test="SourceSystem != null">SourceSystem = #{SourceSystem},</if>
            <if test="MessageID != null">MessageID = #{MessageID},</if>
            <if test="CreateTime != null">CreateTime = #{CreateTime},</if>
            <if test="MethodName != null">MethodName = #{MethodName},</if>
            <if test="ReqIimRules != null">ReqIimRules = #{ReqIimRules},</if>
            <if test="PatientID != null">PatientID = #{PatientID},</if>
            <if test="VisitNum != null">VisitNum = #{VisitNum},</if>
            <if test="RegDate != null">RegDate = #{RegDate},</if>
            <if test="IdentityID != null">IdentityID = #{IdentityID},</if>
            <if test="PatName != null">PatName = #{PatName},</if>
            <if test="Phone != null">Phone = #{Phone},</if>
            <if test="PatSex != null">PatSex = #{PatSex},</if>
            <if test="BirthDate != null">BirthDate = #{BirthDate},</if>
            <if test="Address != null">Address = #{Address},</if>
            <if test="AddProvince != null">AddProvince = #{AddProvince},</if>
            <if test="AddCity != null">AddCity = #{AddCity},</if>
            <if test="AddCounty != null">AddCounty = #{AddCounty},</if>
            <if test="AddTown != null">AddTown = #{AddTown},</if>
            <if test="AddVillage != null">AddVillage = #{AddVillage},</if>
            <if test="AddHouseNo != null">AddHouseNo = #{AddHouseNo},</if>
            <if test="HouseAddress != null">HouseAddress = #{HouseAddress},</if>
            <if test="HouseAddProvince != null">HouseAddProvince = #{HouseAddProvince},</if>
            <if test="HouseAddCity != null">HouseAddCity = #{HouseAddCity},</if>
            <if test="HouseAddCounty != null">HouseAddCounty = #{HouseAddCounty},</if>
            <if test="HouseAddTown != null">HouseAddTown = #{HouseAddTown},</if>
            <if test="HouseAddVillage != null">HouseAddVillage = #{HouseAddVillage},</if>
            <if test="HouseAddHouseNo != null">HouseAddHouseNo = #{HouseAddHouseNo},</if>
            <if test="BirthAddress != null">BirthAddress = #{BirthAddress},</if>
            <if test="BirthAddProvince != null">BirthAddProvince = #{BirthAddProvince},</if>
            <if test="BirthAddCity != null">BirthAddCity = #{BirthAddCity},</if>
            <if test="BirthAddCounty != null">BirthAddCounty = #{BirthAddCounty},</if>
            <if test="BirthAddTown != null">BirthAddTown = #{BirthAddTown},</if>
            <if test="BirthAddVillage != null">BirthAddVillage = #{BirthAddVillage},</if>
            <if test="BirthAddHouseNo != null">BirthAddHouseNo = #{BirthAddHouseNo},</if>
            <if test="ContactsAddress != null">ContactsAddress = #{ContactsAddress},</if>
            <if test="ContactsAddProvince != null">ContactsAddProvince = #{ContactsAddProvince},</if>
            <if test="ContactsAddCity != null">ContactsAddCity = #{ContactsAddCity},</if>
            <if test="ContactsAddCounty != null">ContactsAddCounty = #{ContactsAddCounty},</if>
            <if test="ContactsAddTown != null">ContactsAddTown = #{ContactsAddTown},</if>
            <if test="ContactsAddVillage != null">ContactsAddVillage = #{ContactsAddVillage},</if>
            <if test="ContactsAddHouseNo != null">ContactsAddHouseNo = #{ContactsAddHouseNo},</if>
            <if test="NativeAddress != null">NativeAddress = #{NativeAddress},</if>
            <if test="NativeAddProvince != null">NativeAddProvince = #{NativeAddProvince},</if>
            <if test="NativeAddCity != null">NativeAddCity = #{NativeAddCity},</if>
            <if test="NativeAddCounty != null">NativeAddCounty = #{NativeAddCounty},</if>
            <if test="NativeAddTown != null">NativeAddTown = #{NativeAddTown},</if>
            <if test="NativeAddVillage != null">NativeAddVillage = #{NativeAddVillage},</if>
            <if test="NativeAddHouseNo != null">NativeAddHouseNo = #{NativeAddHouseNo},</if>
            <if test="PostalCode != null">PostalCode = #{PostalCode},</if>
            <if test="HouseCode != null">HouseCode = #{HouseCode},</if>
            <if test="WorkCode != null">WorkCode = #{WorkCode},</if>
            <if test="MaritalStatus != null">MaritalStatus = #{MaritalStatus},</if>
            <if test="Country != null">Country = #{Country},</if>
            <if test="Nation != null">Nation = #{Nation},</if>
            <if test="NationCode != null">NationCode = #{NationCode},</if>
            <if test="OccupType != null">OccupType = #{OccupType},</if>
            <if test="OccupTypeCode != null">OccupTypeCode = #{OccupTypeCode},</if>
            <if test="WorkUnit != null">WorkUnit = #{WorkUnit},</if>
            <if test="WorkPhone != null">WorkPhone = #{WorkPhone},</if>
            <if test="HCardNo != null">HCardNo = #{HCardNo},</if>
            <if test="HCIssuersCode != null">HCIssuersCode = #{HCIssuersCode},</if>
            <if test="HUrbanCode != null">HUrbanCode = #{HUrbanCode},</if>
            <if test="MedOrgCode != null">MedOrgCode = #{MedOrgCode},</if>
            <if test="paycode != null">paycode = #{paycode},</if>
            <if test="payname != null">payname = #{payname},</if>
            <if test="ConRelShip != null">ConRelShip = #{ConRelShip},</if>
            <if test="ConPerPhone != null">ConPerPhone = #{ConPerPhone},</if>
            <if test="ConPerName != null">ConPerName = #{ConPerName},</if>
            <if test="RegOrgCode != null">RegOrgCode = #{RegOrgCode},</if>
            <if test="RegOrgDesc != null">RegOrgDesc = #{RegOrgDesc},</if>
            <if test="InsureOrgName != null">InsureOrgName = #{InsureOrgName},</if>
            <if test="InsureOrgCode != null">InsureOrgCode = #{InsureOrgCode},</if>
            <if test="RegEmpCode != null">RegEmpCode = #{RegEmpCode},</if>
            <if test="RegEmpName != null">RegEmpName = #{RegEmpName},</if>
            <if test="INEnroomno != null">INEnroomno = #{INEnroomno},</if>
            <if test="OUTEnroomno != null">OUTEnroomno = #{OUTEnroomno},</if>
            <if test="EncAdmSource != null">EncAdmSource = #{EncAdmSource},</if>
            <if test="Directordoc != null">Directordoc = #{Directordoc},</if>
            <if test="Attenddoc != null">Attenddoc = #{Attenddoc},</if>
            <if test="Beddoc != null">Beddoc = #{Beddoc},</if>
            <if test="Bednur != null">Bednur = #{Bednur},</if>
            <if test="Regdoc != null">Regdoc = #{Regdoc},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
        </trim>
        where ID = #{ID}
    </update>
 
    <update id="updateHospitalUserinfoByPatientID" parameterType="com.smartor.domain.HospitalUserinfo">
        update hospital_userinfo
        <trim prefix="SET" suffixOverrides=",">
            <if test="SourceSystem != null">SourceSystem = #{SourceSystem},</if>
            <if test="MessageID != null">MessageID = #{MessageID},</if>
            <if test="CreateTime != null">CreateTime = #{CreateTime},</if>
            <if test="MethodName != null">MethodName = #{MethodName},</if>
            <if test="ReqIimRules != null">ReqIimRules = #{ReqIimRules},</if>
            <if test="PatientID != null">PatientID = #{PatientID},</if>
            <if test="VisitNum != null">VisitNum = #{VisitNum},</if>
            <if test="RegDate != null">RegDate = #{RegDate},</if>
            <if test="IdentityID != null">IdentityID = #{IdentityID},</if>
            <if test="PatName != null">PatName = #{PatName},</if>
            <if test="Phone != null">Phone = #{Phone},</if>
            <if test="PatSex != null">PatSex = #{PatSex},</if>
            <if test="BirthDate != null">BirthDate = #{BirthDate},</if>
            <if test="Address != null">Address = #{Address},</if>
            <if test="AddProvince != null">AddProvince = #{AddProvince},</if>
            <if test="AddCity != null">AddCity = #{AddCity},</if>
            <if test="AddCounty != null">AddCounty = #{AddCounty},</if>
            <if test="AddTown != null">AddTown = #{AddTown},</if>
            <if test="AddVillage != null">AddVillage = #{AddVillage},</if>
            <if test="AddHouseNo != null">AddHouseNo = #{AddHouseNo},</if>
            <if test="HouseAddress != null">HouseAddress = #{HouseAddress},</if>
            <if test="HouseAddProvince != null">HouseAddProvince = #{HouseAddProvince},</if>
            <if test="HouseAddCity != null">HouseAddCity = #{HouseAddCity},</if>
            <if test="HouseAddCounty != null">HouseAddCounty = #{HouseAddCounty},</if>
            <if test="HouseAddTown != null">HouseAddTown = #{HouseAddTown},</if>
            <if test="HouseAddVillage != null">HouseAddVillage = #{HouseAddVillage},</if>
            <if test="HouseAddHouseNo != null">HouseAddHouseNo = #{HouseAddHouseNo},</if>
            <if test="BirthAddress != null">BirthAddress = #{BirthAddress},</if>
            <if test="BirthAddProvince != null">BirthAddProvince = #{BirthAddProvince},</if>
            <if test="BirthAddCity != null">BirthAddCity = #{BirthAddCity},</if>
            <if test="BirthAddCounty != null">BirthAddCounty = #{BirthAddCounty},</if>
            <if test="BirthAddTown != null">BirthAddTown = #{BirthAddTown},</if>
            <if test="BirthAddVillage != null">BirthAddVillage = #{BirthAddVillage},</if>
            <if test="BirthAddHouseNo != null">BirthAddHouseNo = #{BirthAddHouseNo},</if>
            <if test="ContactsAddress != null">ContactsAddress = #{ContactsAddress},</if>
            <if test="ContactsAddProvince != null">ContactsAddProvince = #{ContactsAddProvince},</if>
            <if test="ContactsAddCity != null">ContactsAddCity = #{ContactsAddCity},</if>
            <if test="ContactsAddCounty != null">ContactsAddCounty = #{ContactsAddCounty},</if>
            <if test="ContactsAddTown != null">ContactsAddTown = #{ContactsAddTown},</if>
            <if test="ContactsAddVillage != null">ContactsAddVillage = #{ContactsAddVillage},</if>
            <if test="ContactsAddHouseNo != null">ContactsAddHouseNo = #{ContactsAddHouseNo},</if>
            <if test="NativeAddress != null">NativeAddress = #{NativeAddress},</if>
            <if test="NativeAddProvince != null">NativeAddProvince = #{NativeAddProvince},</if>
            <if test="NativeAddCity != null">NativeAddCity = #{NativeAddCity},</if>
            <if test="NativeAddCounty != null">NativeAddCounty = #{NativeAddCounty},</if>
            <if test="NativeAddTown != null">NativeAddTown = #{NativeAddTown},</if>
            <if test="NativeAddVillage != null">NativeAddVillage = #{NativeAddVillage},</if>
            <if test="NativeAddHouseNo != null">NativeAddHouseNo = #{NativeAddHouseNo},</if>
            <if test="PostalCode != null">PostalCode = #{PostalCode},</if>
            <if test="HouseCode != null">HouseCode = #{HouseCode},</if>
            <if test="WorkCode != null">WorkCode = #{WorkCode},</if>
            <if test="MaritalStatus != null">MaritalStatus = #{MaritalStatus},</if>
            <if test="Country != null">Country = #{Country},</if>
            <if test="Nation != null">Nation = #{Nation},</if>
            <if test="NationCode != null">NationCode = #{NationCode},</if>
            <if test="OccupType != null">OccupType = #{OccupType},</if>
            <if test="OccupTypeCode != null">OccupTypeCode = #{OccupTypeCode},</if>
            <if test="WorkUnit != null">WorkUnit = #{WorkUnit},</if>
            <if test="WorkPhone != null">WorkPhone = #{WorkPhone},</if>
            <if test="HCardNo != null">HCardNo = #{HCardNo},</if>
            <if test="HCIssuersCode != null">HCIssuersCode = #{HCIssuersCode},</if>
            <if test="HUrbanCode != null">HUrbanCode = #{HUrbanCode},</if>
            <if test="MedOrgCode != null">MedOrgCode = #{MedOrgCode},</if>
            <if test="paycode != null">paycode = #{paycode},</if>
            <if test="payname != null">payname = #{payname},</if>
            <if test="ConRelShip != null">ConRelShip = #{ConRelShip},</if>
            <if test="ConPerPhone != null">ConPerPhone = #{ConPerPhone},</if>
            <if test="ConPerName != null">ConPerName = #{ConPerName},</if>
            <if test="RegOrgCode != null">RegOrgCode = #{RegOrgCode},</if>
            <if test="RegOrgDesc != null">RegOrgDesc = #{RegOrgDesc},</if>
            <if test="InsureOrgName != null">InsureOrgName = #{InsureOrgName},</if>
            <if test="InsureOrgCode != null">InsureOrgCode = #{InsureOrgCode},</if>
            <if test="RegEmpCode != null">RegEmpCode = #{RegEmpCode},</if>
            <if test="RegEmpName != null">RegEmpName = #{RegEmpName},</if>
            <if test="INEnroomno != null">INEnroomno = #{INEnroomno},</if>
            <if test="OUTEnroomno != null">OUTEnroomno = #{OUTEnroomno},</if>
            <if test="EncAdmSource != null">EncAdmSource = #{EncAdmSource},</if>
            <if test="Directordoc != null">Directordoc = #{Directordoc},</if>
            <if test="Attenddoc != null">Attenddoc = #{Attenddoc},</if>
            <if test="Beddoc != null">Beddoc = #{Beddoc},</if>
            <if test="Bednur != null">Bednur = #{Bednur},</if>
            <if test="Regdoc != null">Regdoc = #{Regdoc},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
        </trim>
        where PatientID = #{PatientID}
    </update>
 
    <delete id="deleteHospitalUserinfoByID" parameterType="Long">
        delete
        from hospital_userinfo
        where ID = #{ID}
    </delete>
 
    <delete id="deleteHospitalUserinfoByIDs" parameterType="String">
        delete from hospital_userinfo where ID in
        <foreach item="ID" collection="array" open="(" separator="," close=")">
            #{ID}
        </foreach>
    </delete>
</mapper>