From 28446c1489c8977d634e7a39dbbc96967e22c6f1 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 11 五月 2026 11:32:31 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml |  196 ++++++++++++++++++++++++++----------------------
 1 files changed, 106 insertions(+), 90 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
index 8431015..e961099 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -33,6 +33,7 @@
         <result property="pid" column="pid"/>
         <result property="guid" column="guid"/>
         <result property="preachform" column="preachform"/>
+        <result property="preachformDesc" column="preachform_desc"/>
         <result property="sendType" column="send_type"/>
         <result property="sendState" column="send_state"/>
         <result property="hospType" column="hosp_type"/>
@@ -58,11 +59,14 @@
         <result property="nexttaskid" column="nexttaskid"/>
         <result property="nexttaskname" column="nexttaskname"/>
         <result property="appltype" column="appltype"/>
+        <result property="patCycle" column="pat_cycle"/>
+        <result property="diagType" column="diag_type"/>
     </resultMap>
 
     <sql id="selectServiceTaskVo">
         select taskid,
                task_name,
+               pat_cycle,
                appltype,
                send_day,
                long_task,
@@ -77,6 +81,7 @@
                text_param,
                templateid,
                templatename,
+               preachform_desc,
                labelinfo,
                count,
                executed,
@@ -112,14 +117,15 @@
                orgid,
                nexttaskflag,
                nexttaskid,
-               nexttaskname
+               nexttaskname,
+               diag_type
         from service_task
     </sql>
 
     <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult">
         <include refid="selectServiceTaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and 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},
@@ -148,8 +154,9 @@
             </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="deptcode != null  and deptcode != ''">
+                and deptcode REGEXP CONCAT('(^|,)', #{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>
@@ -166,13 +173,13 @@
             <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="diagType != null and diagType != ''">and diag_type = #{diagType}</if>
             <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname =
                 #{leavehospitaldistrictname}
             </if>
-            <if test="leavehospitaldistrictcode != null  ">and leavehospitaldistrictcode =
-                #{leavehospitaldistrictcode}
+            <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">
+                and leavehospitaldistrictcode REGEXP CONCAT('(^|,)', #{leavehospitaldistrictcode}, '(,|$)')
             </if>
-
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                 AND leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -187,7 +194,6 @@
                     #{leaveldeptcode}
                 </foreach>
             </if>
-        </where>
         order by update_time desc,taskid desc
     </select>
 
@@ -233,6 +239,7 @@
         service_task.pid,
         service_task.guid,
         service_task.preachform,
+        service_task.preachform_desc,
         service_task.send_type,
         service_task.send_state,
         service_task.send_time_slot,
@@ -246,91 +253,91 @@
         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>
+        where 1=1
+        and service_task.del_flag = 0
+        <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 =
+        <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="leavehospitaldistrictcodes!=null and leavehospitaldistrictcodes.size()>0">
+            AND service_task.leavehospitaldistrictcode IN
+            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
+                     close=")">
                 #{leavehospitaldistrictcode}
-            </if>
-
-        </where>
+            </foreach>
+        </if>
+        <if test="leaveldeptcodes!=null and leaveldeptcodes.size()>0">
+            AND service_task.deptcode IN
+            <foreach collection="leaveldeptcodes" item="deptcode" open="(" separator=","
+                     close=")">
+                #{deptcode}
+            </foreach>
+        </if>
+        <if test="leavehospitaldistrictcode != null  ">and service_task.leavehospitaldistrictcode =
+            #{leavehospitaldistrictcode}
+        </if>
         order by update_time desc,taskid desc
     </select>
 
     <select id="selectServiceTaskByTaskid" parameterType="Long" resultMap="ServiceTaskResult">
         <include refid="selectServiceTaskVo"/>
-        where taskid = #{taskid}
+        where taskid = #{taskid} and del_flag=0
     </select>
 
     <insert id="insertServiceTask" parameterType="com.smartor.domain.ServiceTask" useGeneratedKeys="true"
@@ -363,6 +370,7 @@
             <if test="pid != null">pid,</if>
             <if test="guid != null">guid,</if>
             <if test="preachform != null">preachform,</if>
+            <if test="preachformDesc != null">preachform_desc,</if>
             <if test="sendType != null">send_type,</if>
             <if test="sendState != null">send_state,</if>
             <if test="hospType != null  and hospType != ''">hosp_type,</if>
@@ -385,6 +393,8 @@
             <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>
+            <if test="diagType != null and diagType != ''">diag_type,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="taskName != null">#{taskName},</if>
@@ -416,6 +426,7 @@
             <if test="pid != null">#{pid},</if>
             <if test="guid != null">#{guid},</if>
             <if test="preachform != null">#{preachform},</if>
+            <if test="preachformDesc != null">#{preachformDesc},</if>
             <if test="sendType != null">#{sendType},</if>
             <if test="sendState != null">#{sendState},</if>
             <if test="hospType != null  and hospType != ''">#{hospType},</if>
@@ -438,6 +449,8 @@
             <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>
+            <if test="diagType != null and diagType != ''">#{diagType},</if>
         </trim>
     </insert>
 
@@ -473,6 +486,7 @@
             <if test="pid != null">pid = #{pid},</if>
             <if test="guid != null">guid = #{guid},</if>
             <if test="preachform != null">preachform = #{preachform},</if>
+            <if test="preachformDesc != null">preachform_desc = #{preachformDesc},</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>
@@ -494,9 +508,11 @@
             </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="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>
+            <if test="diagType != null and diagType != ''">diag_type = #{diagType},</if>
         </trim>
         where taskid = #{taskid}
     </update>

--
Gitblit v1.9.3