liusheng
昨天 e4e220916dd2a4aa649a9b0162e5b5ed0dc9d7e5
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
<?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.ServiceTaskMapper">
 
    <resultMap type="com.smartor.domain.ServiceTask" id="ServiceTaskResult">
        <result property="taskid" column="taskid"/>
        <result property="taskName" column="task_name"/>
        <result property="templateid" column="templateid"/>
        <result property="templatename" column="templatename"/>
        <result property="labelinfo" column="labelinfo"/>
        <result property="count" column="count"/>
        <result property="executed" column="executed"/>
        <result property="unexecuted" column="unexecuted"/>
        <result property="fail" column="fail"/>
        <result property="sendDay" column="send_day"/>
        <result property="checkuserid" column="checkuserid"/>
        <result property="checkusername" column="checkusername"/>
        <result property="checktime" column="checktime"/>
        <result property="type" column="type"/>
        <result property="typename" column="typename"/>
        <result property="deptcode" column="deptcode"/>
        <result property="deptname" column="deptname"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="orgid" column="orgid"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="preachform" column="preachform"/>
        <result property="sendType" column="send_type"/>
        <result property="sendState" column="send_state"/>
        <result property="hospType" column="hosp_type"/>
        <result property="taskDesc" column="task_desc"/>
        <result property="libtemplateid" column="libtemplateid"/>
        <result property="libtemplatename" column="libtemplatename"/>
        <result property="sendTimeSlot" column="send_time_slot"/>
        <result property="stopState" column="stop_state"/>
        <result property="showDate" column="show_date"/>
        <result property="showTimeMorn" column="show_time_morn"/>
        <result property="showTimeNoon" column="show_time_noon"/>
        <result property="showTimeNight" column="show_time_night"/>
        <result property="textParam" column="text_param"/>
        <result property="serviceType" column="service_type"/>
        <result property="longTask" column="long_task"/>
        <result property="kcb" column="kcb"/>
        <result property="jsy" column="jsy"/>
        <result property="compensateDate" column="compensate_date"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="compensateDate" column="compensate_date"/>
        <result property="nexttaskflag" column="nexttaskflag"/>
        <result property="nexttaskid" column="nexttaskid"/>
        <result property="nexttaskname" column="nexttaskname"/>
        <result property="appltype" column="appltype"/>
        <result property="patCycle" column="pat_cycle"/>
    </resultMap>
 
    <sql id="selectServiceTaskVo">
        select taskid,
               task_name,
               pat_cycle,
               appltype,
               send_day,
               long_task,
               show_date,
               compensate_date,
               show_time_morn,
               show_time_noon,
               show_time_night,
               libtemplateid,
               libtemplatename,
               stop_state,
               text_param,
               templateid,
               templatename,
               labelinfo,
               count,
               executed,
               unexecuted,
               fail,
               checkuserid,
               checkusername,
               checktime,
               type,
               task_desc,
               hosp_type,
               typename,
               deptcode,
               deptname,
               del_flag,
               update_by,
               update_time,
               create_by,
               create_time,
               isupload,
               upload_time,
               pid,
               guid,
               preachform,
               send_type,
               send_state,
               send_time_slot,
               service_type,
               kcb,
               jsy,
               leavehospitaldistrictcode,
               leavehospitaldistrictname,
               orgid,
               nexttaskflag,
               nexttaskid,
               nexttaskname
        from service_task
    </sql>
 
    <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult">
        <include refid="selectServiceTaskVo"/>
        <where>
            del_flag=0
            <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
            <if test="taskid != null">and taskid = #{taskid}</if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot},
                '%')
            </if>
            <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
            <if test="longTask != null  and longTask != ''">and long_task = #{longTask}</if>
            <if test="serviceType != null  and serviceType != ''">and service_type = #{serviceType}</if>
            <if test="templatename != null  and templatename != ''">and templatename like concat('%', #{templatename},
                '%')
            </if>
            <if test="labelinfo != null  and labelinfo != ''">and labelinfo = #{labelinfo}</if>
            <if test="count != null ">and count = #{count}</if>
            <if test="executed != null ">and executed = #{executed}</if>
            <if test="unexecuted != null ">and unexecuted = #{unexecuted}</if>
            <if test="fail != null ">and fail = #{fail}</if>
            <if test="checkuserid != null  and checkuserid != ''">and checkuserid = #{checkuserid}</if>
            <if test="checkusername != null  and checkusername != ''">and checkusername like concat('%',
                #{checkusername}, '%')
            </if>
            <if test="checktime != null ">and checktime = #{checktime}</if>
            <if test="sendDay != null ">and send_day = #{sendDay}</if>
            <if test="type != null  and type != ''">and type = #{type}</if>
            <if test="typename != null  and typename != ''">and typename like concat('%', #{typename}, '%')</if>
            <if test="beginTime != null ">and date_format(update_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
            </if>
            <if test="endTime != null ">and date_format(update_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
            </if>
 
            <if test="deptcode != null  and deptcode != ''">and deptcode = #{deptcode}</if>
            <if test="deptname != null  and deptname != ''">and deptname = #{deptname}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="compensateDate != null  and compensateDate != ''">and compensate_date = #{compensateDate}</if>
            <if test="hospType != null  and hospType != ''">and hosp_type = #{hospType}</if>
            <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if>
            <if test="libtemplatename != null  and libtemplatename != ''">and libtemplatename = #{libtemplatename}</if>
            <if test="createBy != null  and createBy != ''">and create_by = #{createBy}</if>
            <if test="sendState != null  ">and send_state = #{sendState}</if>
            <if test="compensateDate != null  ">and compensate_date = #{compensateDate}</if>
            <if test="patCycle != null  ">and pat_cycle = #{patCycle}</if>
            <if test="nexttaskflag != null  ">and nexttaskflag = #{nexttaskflag}</if>
            <if test="nexttaskid != null  ">and nexttaskid = #{nexttaskid}</if>
            <if test="nexttaskname != null  ">and nexttaskname = #{nexttaskname}</if>
            <if test="appltype != null  ">and appltype = #{appltype}</if>
            <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname =
                #{leavehospitaldistrictname}
            </if>
            <if test="leavehospitaldistrictcode != null  ">and leavehospitaldistrictcode =
                #{leavehospitaldistrictcode}
            </if>
 
            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                AND leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">
                AND deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
                    #{leaveldeptcode}
                </foreach>
            </if>
        </where>
        order by update_time desc,taskid desc
    </select>
 
    <select id="selectServiceTaskAndtaskDeptList" parameterType="com.smartor.domain.ServiceTask"
            resultMap="ServiceTaskResult">
        select service_task.taskid,
        service_task.task_name,
        service_task.appltype,
        service_task.send_day,
        service_task.long_task,
        service_task.show_date,
        service_task.compensate_date,
        service_task.show_time_morn,
        service_task.show_time_noon,
        service_task.show_time_night,
        service_task.libtemplateid,
        service_task.libtemplatename,
        service_task.stop_state,
        service_task.text_param,
        service_task.templateid,
        service_task.templatename,
        service_task.labelinfo,
        service_task.count,
        service_task.executed,
        service_task.unexecuted,
        service_task.fail,
        service_task.checkuserid,
        service_task.checkusername,
        service_task.checktime,
        service_task.type,
        service_task.task_desc,
        service_task.hosp_type,
        service_task.typename,
        service_task.deptcode,
        service_task.deptname,
        service_task.del_flag,
        service_task.update_by,
        service_task.update_time,
        service_task.create_by,
        service_task.create_time,
        service_task.isupload,
        service_task.upload_time,
        service_task.pid,
        service_task.guid,
        service_task.preachform,
        service_task.send_type,
        service_task.send_state,
        service_task.send_time_slot,
        service_task.service_type,
        service_task.kcb,
        service_task.jsy,
        service_task.leavehospitaldistrictcode,
        service_task.leavehospitaldistrictname,
        service_task.pat_cycle,
        service_task.nexttaskflag,
        service_task.nexttaskid,
        service_task.nexttaskname,
        service_task.orgid from service_task
        <where>
            service_task.del_flag=0
            <!--            and taskid in (-->
            <!--            select task_id from service_taskdept-->
            <!--            <where>-->
            <!--                <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">-->
            <!--                    dept_code in-->
            <!--                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","-->
            <!--                             close=")">-->
            <!--                        #{leaveldeptcode}-->
            <!--                    </foreach>-->
            <!--                </if>-->
            <!--            </where>-->
            <!--            )-->
            <if test="taskName != null  and taskName != ''">and service_task.task_name like concat('%', #{taskName},
                '%')
            </if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">and service_task.send_time_slot like concat('%',
                #{sendTimeSlot},
                '%')
            </if>
            <if test="templateid != null  and templateid != ''">and service_task.templateid = #{templateid}</if>
            <if test="longTask != null  and longTask != ''">and service_task.long_task = #{longTask}</if>
            <if test="serviceType != null  and serviceType != ''">and service_task.service_type = #{serviceType}</if>
            <if test="templatename != null  and templatename != ''">and service_task.templatename like concat('%',
                #{templatename},
                '%')
            </if>
            <if test="labelinfo != null  and labelinfo != ''">and service_task.labelinfo = #{labelinfo}</if>
            <if test="count != null ">and service_task.count = #{count}</if>
            <if test="executed != null ">and service_task.executed = #{executed}</if>
            <if test="unexecuted != null ">and service_task.unexecuted = #{unexecuted}</if>
            <if test="fail != null ">and service_task.fail = #{fail}</if>
            <if test="checkuserid != null  and checkuserid != ''">and service_task.checkuserid = #{checkuserid}</if>
            <if test="checkusername != null  and checkusername != ''">and service_task.checkusername like concat('%',
                #{checkusername}, '%')
            </if>
            <if test="checktime != null ">and service_task.checktime = #{checktime}</if>
            <if test="sendDay != null ">and service_task.send_day = #{sendDay}</if>
            <if test="type != null  and type != ''">and service_task.type = #{type}</if>
            <if test="typename != null  and typename != ''">and service_task.typename like concat('%', #{typename},
                '%')
            </if>
            <if test="beginTime != null ">and date_format( service_task.update_time,'%y%m%d') &gt;=
                date_format(#{beginTime},'%y%m%d')
            </if>
            <if test="endTime != null ">and date_format( service_task.update_time,'%y%m%d') &lt;=
                date_format(#{endTime},'%y%m%d')
            </if>
 
            <if test="deptcode != null  and deptcode != ''">and service_task.deptcode = #{deptcode}</if>
            <if test="deptname != null  and deptname != ''">and service_task.deptname = #{deptname}</if>
            <if test="isupload != null ">and service_task.isupload = #{isupload}</if>
            <if test="uploadTime != null ">and service_task.upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and service_task.orgid = #{orgid}</if>
            <if test="compensateDate != null  and compensateDate != ''">and service_task.compensate_date =
                #{compensateDate}
            </if>
            <if test="hospType != null  and hospType != ''">and service_task.hosp_type = #{hospType}</if>
            <if test="libtemplateid != null ">and service_task.libtemplateid = #{libtemplateid}</if>
            <if test="libtemplatename != null  and libtemplatename != ''">and service_task.libtemplatename =
                #{libtemplatename}
            </if>
            <if test="createBy != null  and createBy != ''">and service_task.create_by = #{createBy}</if>
            <if test="sendState != null  ">and service_task.send_state = #{sendState}</if>
            <if test="compensateDate != null  ">and service_task.compensate_date = #{compensateDate}</if>
            <if test="patCycle != null  ">and service_task.pat_cycle = #{patCycle}</if>
            <if test="nexttaskflag != null  ">and nexttaskflag = #{nexttaskflag}</if>
            <if test="nexttaskid != null  ">and nexttaskid = #{nexttaskid}</if>
            <if test="nexttaskname != null  ">and nexttaskname = #{nexttaskname}</if>
            <if test="appltype != null  ">and appltype = #{appltype}</if>
            <if test="leavehospitaldistrictname != null  ">and service_task.leavehospitaldistrictname =
                #{leavehospitaldistrictname}
            </if>
            <if test="leavehospitaldistrictcode != null  ">and service_task.leavehospitaldistrictcode =
                #{leavehospitaldistrictcode}
            </if>
 
        </where>
        order by update_time desc,taskid desc
    </select>
 
    <select id="selectServiceTaskByTaskid" parameterType="Long" resultMap="ServiceTaskResult">
        <include refid="selectServiceTaskVo"/>
        where taskid = #{taskid} and del_flag=0
    </select>
 
    <insert id="insertServiceTask" parameterType="com.smartor.domain.ServiceTask" useGeneratedKeys="true"
            keyProperty="taskid">
        insert into service_task
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskName != null">task_name,</if>
            <if test="templateid != null">templateid,</if>
            <if test="templatename != null">templatename,</if>
            <if test="labelinfo != null">labelinfo,</if>
            <if test="count != null">count,</if>
            <if test="executed != null">executed,</if>
            <if test="unexecuted != null">unexecuted,</if>
            <if test="fail != null">fail,</if>
            <if test="checkuserid != null">checkuserid,</if>
            <if test="checkusername != null">checkusername,</if>
            <if test="checktime != null">checktime,</if>
            <if test="type != null">type,</if>
            <if test="typename != null">typename,</if>
            <if test="deptcode != null">deptcode,</if>
            <if test="deptname != null">deptname,</if>
            <if test="delFlag != null and delFlag != ''">del_flag,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
            <if test="orgid != null">orgid,</if>
            <if test="pid != null">pid,</if>
            <if test="guid != null">guid,</if>
            <if test="preachform != null">preachform,</if>
            <if test="sendType != null">send_type,</if>
            <if test="sendState != null">send_state,</if>
            <if test="hospType != null  and hospType != ''">hosp_type,</if>
            <if test="taskDesc != null  and taskDesc != ''">task_desc,</if>
            <if test="libtemplateid != null ">libtemplateid,</if>
            <if test="libtemplatename != null  and libtemplatename != ''">libtemplatename,</if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">send_time_slot,</if>
            <if test="stopState != null">stop_state,</if>
            <if test="showDate != null and showDate != ''">show_date,</if>
            <if test="showTimeNight != null and showTimeNight != ''">show_time_night,</if>
            <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon,</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn,</if>
            <if test="textParam != null and textParam != ''">text_param,</if>
            <if test="serviceType != null  and serviceType != ''">service_type,</if>
            <if test="longTask != null  and longTask != ''">long_task,</if>
            <if test="kcb != null  and kcb != ''">kcb,</if>
            <if test="jsy != null  and jsy != ''">jsy,</if>
            <if test="leavehospitaldistrictname != null  ">leavehospitaldistrictname,</if>
            <if test="leavehospitaldistrictcode != null  ">leavehospitaldistrictcode,</if>
            <if test="compensateDate != null  and compensateDate != ''">compensate_date,</if>
            <if test="sendDay != null  ">send_day,</if>
            <if test="appltype != null  ">appltype,</if>
            <if test="patCycle != null  ">pat_cycle,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskName != null">#{taskName},</if>
            <if test="templateid != null">#{templateid},</if>
            <if test="templatename != null">#{templatename},</if>
            <if test="labelinfo != null">#{labelinfo},</if>
            <if test="count != null">#{count},</if>
            <if test="executed != null">#{executed},</if>
            <if test="unexecuted != null">#{unexecuted},</if>
            <if test="fail != null">#{fail},</if>
            <if test="checkuserid != null">#{checkuserid},</if>
            <if test="checkusername != null">#{checkusername},</if>
            <if test="checktime != null">#{checktime},</if>
            <if test="type != null">#{type},</if>
            <if test="typename != null">#{typename},</if>
            <if test="deptcode != null">#{deptcode},</if>
            <if test="deptname != null">#{deptname},</if>
            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="nexttaskflag != null">#{nexttaskflag},</if>
            <if test="nexttaskid != null">#{nexttaskid},</if>
            <if test="nexttaskname != null">#{nexttaskname},</if>
            <if test="pid != null">#{pid},</if>
            <if test="guid != null">#{guid},</if>
            <if test="preachform != null">#{preachform},</if>
            <if test="sendType != null">#{sendType},</if>
            <if test="sendState != null">#{sendState},</if>
            <if test="hospType != null  and hospType != ''">#{hospType},</if>
            <if test="taskDesc != null  and taskDesc != ''">#{taskDesc},</if>
            <if test="libtemplateid != null ">#{libtemplateid},</if>
            <if test="libtemplatename != null  and libtemplatename != ''">#{libtemplatename},</if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">#{sendTimeSlot},</if>
            <if test="stopState != null">#{stopState},</if>
            <if test="showDate != null and showDate != ''">#{showDate},</if>
            <if test="showTimeNight != null and showTimeNight != ''">#{showTimeNight},</if>
            <if test="showTimeNoon != null and showTimeNoon != ''">#{showTimeNoon},</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">#{showTimeMorn},</if>
            <if test="textParam != null and textParam != ''">#{textParam},</if>
            <if test="serviceType != null  and serviceType != ''">#{serviceType},</if>
            <if test="longTask != null  and longTask != ''">#{longTask},</if>
            <if test="kcb != null  and kcb != ''">#{kcb},</if>
            <if test="jsy != null  and jsy != ''">#{jsy},</if>
            <if test="leavehospitaldistrictname != null  ">#{leavehospitaldistrictname},</if>
            <if test="leavehospitaldistrictcode != null  ">#{leavehospitaldistrictcode},</if>
            <if test="compensateDate != null  and compensateDate != ''">#{compensateDate}</if>
            <if test="sendDay != null  ">#{sendDay},</if>
            <if test="appltype != null  ">#{appltype},</if>
            <if test="patCycle != null  ">#{patCycle},</if>
        </trim>
    </insert>
 
    <update id="updateServiceTask" parameterType="com.smartor.domain.ServiceTask">
        update service_task
        <trim prefix="SET" suffixOverrides=",">
            <if test="taskName != null">task_name = #{taskName},</if>
            <if test="templateid != null">templateid = #{templateid},</if>
            <if test="templatename != null">templatename = #{templatename},</if>
            <if test="labelinfo != null">labelinfo = #{labelinfo},</if>
            <if test="count != null">count = #{count},</if>
            <if test="executed != null">executed = #{executed},</if>
            <if test="unexecuted != null">unexecuted = #{unexecuted},</if>
            <if test="fail != null">fail = #{fail},</if>
            <if test="checkuserid != null">checkuserid = #{checkuserid},</if>
            <if test="checkusername != null">checkusername = #{checkusername},</if>
            <if test="checktime != null">checktime = #{checktime},</if>
            <if test="type != null">type = #{type},</if>
            <if test="typename != null">typename = #{typename},</if>
            <if test="deptcode != null">deptcode = #{deptcode},</if>
            <if test="deptname != null">deptname = #{deptname},</if>
            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="nexttaskflag != null">nexttaskflag = #{nexttaskflag},</if>
            <if test="nexttaskid != null">nexttaskid = #{nexttaskid},</if>
            <if test="nexttaskname != null">nexttaskname = #{nexttaskname},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="preachform != null">preachform = #{preachform},</if>
            <if test="sendType != null">send_type = #{sendType},</if>
            <if test="sendState != null">send_state = #{sendState},</if>
            <if test="hospType != null  and hospType != ''">hosp_type = #{hospType},</if>
            <if test="taskDesc != null  and taskDesc != ''">task_desc= #{taskDesc},</if>
            <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
            <if test="libtemplatename != null  and libtemplatename != ''">libtemplatename = #{libtemplatename},</if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">send_time_slot=#{sendTimeSlot},</if>
            <if test="stopState != null ">stop_state=#{stopState},</if>
            <if test="showDate != null and showDate != ''">show_date=#{showDate},</if>
            <if test="showTimeNight != null and showTimeNight != ''">show_time_night=#{showTimeNight},</if>
            <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon=#{showTimeNoon},</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn=#{showTimeMorn},</if>
            <if test="textParam != null and textParam != ''">text_param=#{textParam},</if>
            <if test="serviceType != null  and serviceType != ''">service_type = #{serviceType},</if>
            <if test="longTask != null  and longTask != ''">long_task = #{longTask},</if>
            <if test="kcb != null  and kcb != ''">kcb = #{kcb},</if>
            <if test="jsy != null  and jsy != ''">jsy = #{jsy},</if>
            <if test="leavehospitaldistrictname != null  ">leavehospitaldistrictname = #{leavehospitaldistrictname},
            </if>
            <if test="leavehospitaldistrictcode != null  ">leavehospitaldistrictcode = #{leavehospitaldistrictcode},
            </if>
            <if test="compensateDate != null  and compensateDate != ''">compensate_date = #{compensateDate},</if>
            <if test="sendDay != null  ">send_day = #{sendDay},</if>
            <if test="appltype != null  ">appltype = #{appltype},</if>
            <if test="patCycle != null  ">pat_cycle = #{patCycle},</if>
        </trim>
        where taskid = #{taskid}
    </update>
 
    <update id="deleteServiceTaskByTaskid" parameterType="Long">
        update service_task
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where taskid = #{taskid}
    </update>
 
    <update id="deleteServiceTaskByTaskids" parameterType="String">
        update service_task
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where taskid in
        <foreach item="taskid" collection="array" open="(" separator="," close=")">
            #{taskid}
        </foreach>
    </update>
</mapper>