已修改11个文件
351 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/ShiyiSmsUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/entity/ServiceSubtaskEntity.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/XHGatherPatArchiveServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java
@@ -10,7 +10,10 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sms.smsUtils;
import com.smartor.common.MtSubmitSmUtil;
import com.smartor.common.ShiyiSmsUtil;
import com.smartor.domain.ServiceOutPath;
import com.smartor.domain.ShiyiSmsRequest;
import com.smartor.domain.ShiyiSmsResponse;
import com.smartor.domain.smsVO;
import com.smartor.mapper.UtilsMapper;
import com.smartor.service.IServiceOutPathService;
@@ -43,6 +46,9 @@
    @Autowired
    private MtSubmitSmUtil mtSubmitSmUtil;
    @Autowired
    private ShiyiSmsUtil shiyiSmsUtil;
    @Value("${xhsmsAccount}")
    private String xhsmsAccount;
@@ -73,6 +79,18 @@
    public AjaxResult send(@RequestBody smsVO vo) {
        String sendMsg = smsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), vo.getContent());
        return AjaxResult.success(sendMsg);
    }
    @ApiOperation("市一HIS短信XML测试")
    @PostMapping("/sendShiyiTest")
    public AjaxResult sendShiyiTest(@RequestBody ShiyiSmsRequest request) {
        try {
            ShiyiSmsResponse response = shiyiSmsUtil.sendSms(request);
            return AjaxResult.success(response);
        } catch (Exception e) {
            log.error("市一HIS短信XML测试失败", e);
            return AjaxResult.error("市一HIS短信XML测试失败: " + e.getMessage());
        }
    }
    /**
@@ -167,4 +185,6 @@
        }
        return AjaxResult.success(sendMsg);
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java
@@ -157,6 +157,66 @@
     * @param respBodyClass 响应体类型
     * @return 返回的响应结果
     */
    public static String postXmlRequest(String url, String request) throws HttpRequestException {
        return postXmlRequest(url, request, EMPTY_HEADERS);
    }
    public static String postXmlRequest(String url, String request, Map<String, String> headers) throws HttpRequestException {
        Assert.hasLength(url, "璇锋眰url涓嶈兘涓虹┖瀛楃涓层€?");
        Assert.notNull(request, "XML request must not be null");
        EntityEnclosingMethod httpMethod = new PostMethod(url);
        httpMethod.addRequestHeader(CONTENT_TYPE, TEXT_XML_UTF8);
        setHeaderRequestId(httpMethod);
        if (headers != null && headers != EMPTY_HEADERS) {
            setReqHeaders(headers, httpMethod);
        }
        try {
            RequestEntity entity = new StringRequestEntity(request, TEXT_XML, StandardCharsets.UTF_8.name());
            httpMethod.setRequestEntity(entity);
            int resultCode = httpClient.executeMethod(httpMethod);
            String contentType = httpMethod.getResponseHeader(CONTENT_TYPE) == null
                    ? null : httpMethod.getResponseHeader(CONTENT_TYPE).getValue();
            String charset = StandardCharsets.UTF_8.name();
            if (contentType != null && contentType.contains("charset=")) {
                String[] parts = contentType.split("charset=");
                if (parts.length > 1) {
                    charset = parts[1].split(";")[0].trim();
                }
            }
            InputStream inputStream = httpMethod.getResponseBodyAsStream();
            if (inputStream == null) {
                throw new HttpRequestException(RESPONSE_NULL_ERROR_CODE, "鍝嶅簲涓簄ull");
            }
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset));
            StringBuilder stringBuilder = new StringBuilder();
            String str;
            while ((str = reader.readLine()) != null) {
                stringBuilder.append(str);
            }
            reader.close();
            String respXml = stringBuilder.toString();
            if (resultCode == OK) {
                return respXml;
            } else {
                throw new HttpRequestException(resultCode, respXml);
            }
        } catch (UnsupportedEncodingException e) {
            throw new HttpRequestException(ENCODING_ERROR_CODE, e);
        } catch (HttpException e) {
            throw new HttpRequestException(HTTP_ERROR_CODE, e);
        } catch (IOException e) {
            throw new HttpRequestException(IO_ERROR_CODE, e);
        } finally {
            if (httpMethod != null) {
                httpMethod.releaseConnection();
            }
        }
    }
    @SuppressWarnings("unchecked")
    public static <RESPBODY> HttpEntity<RESPBODY> postJsonRequestV2(String url, HttpEntity<?> reqEntity, Class<RESPBODY> respBodyClass) {
        Assert.hasLength(url, "请求url不能为空字符串。");
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
@@ -74,7 +74,7 @@
        SysConfig retConfig = configMapper.selectConfig(config);
        if (StringUtils.isNotNull(retConfig))
        {
            redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
//            redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
            return retConfig.getConfigValue();
        }
        return StringUtils.EMPTY;
smartor/src/main/java/com/smartor/common/ShiyiSmsUtil.java
@@ -94,7 +94,7 @@
     */
    public String invokeRunService(String tradeType, String tradeMsg) {
        String soapEnvelope = buildSoapEnvelope(tradeType, tradeMsg);
        String hisServiceUrl = "http://192.200.54.57:7790/MediInfoHis.svc";
        String hisServiceUrl = "http://192.178.0.104:7790/MediInfoHis.svc";
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(new MediaType("text", "xml", StandardCharsets.UTF_8));
smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java
@@ -249,6 +249,13 @@
    private Long sendstate;
    /**
     * 发送状态
     */
//    @Excel(name = " 发送状态 1 被领取(在任务中是新建,在服务中是被领取)  2 待发送  3 已发送  4 不执行  5 发送失败 6 已完成\") ")
    @ApiModelProperty(value = "页面展示状态 :1:待随访(2 待发送);2:随访中(3 已发送、1 被领取)、3:未完成(5 发送失败、7、超时)、4:已完成( 6 已完成)、5:无需随访(4 不执行)")
    private Long sendstateView;
    /**
     * 暂停状 : 状态如果发生修改,值就加1
     */
//    @Excel(name = " 暂停状 : 状态如果发生修改,值就加1 ")
smartor/src/main/java/com/smartor/domain/entity/ServiceSubtaskEntity.java
@@ -787,4 +787,11 @@
    @ApiModelProperty(value = "分组code集合")
    private List<String> groupKeyList;
    /**
     * 发送状态
     */
//    @Excel(name = " 发送状态 1 被领取(在任务中是新建,在服务中是被领取)  2 待发送  3 已发送  4 不执行  5 发送失败 6 已完成\") ")
    @ApiModelProperty(value = "页面展示状态 :1:待随访(2 待发送);2:随访中(3 已发送、1 被领取)、3:未完成(5 发送失败、7、超时)、4:已完成( 6 已完成)、5:无需随访(4 不执行)")
    private Long sendstateView;
}
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -319,7 +319,6 @@
        //获取未处理在院的数据(如果刚刚出院的患者数据的出院时间,在下面查询出的入院时间之前,那之前的出院患者的数据,也得停掉,因为又入院了)
        PatMedInhosp patMedInhosp = new PatMedInhosp();
        //获取需要出院部门随访,未处理的数据
        patMedInhosp.setDeptcheckFlag("0");
        patMedInhosp.setInhospstate("0");
        List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
@@ -1655,6 +1654,8 @@
            if (CollectionUtils.isEmpty(serviceTaskdepts)) {
                PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(patMedInhosp1.getInhospid());
                patMedInhosp1.setDeptcheckFlag("2");
                patMedInhosp1.setWardcheckFlag(patMedInhosp.getWardcheckFlag());
                patMedInhosp1.setDiagcheckFlag(patMedInhosp.getDiagcheckFlag());
                patMedInhosp1.setLongTaskReason(patMedInhosp.getLongTaskReason() + "该患者所在科室未配置离院长期任务;");
                patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
            } else {
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -348,6 +348,14 @@
    @Override
    public List<ServiceSubtaskRes> patItem(ServiceSubtaskEntity serviceSubtaskEntity) {
        //            1:待随访(2 待发送);2:随访中(3 已发送、1 被领取)、3:未完成(5 发送失败、7、超时)、4:已完成( 6 已完成)、5:无需随访(4 不执行)
        if (serviceSubtaskEntity.getSendstateView() == 1) serviceSubtaskEntity.setSendstates(Arrays.asList(2L));
        if (serviceSubtaskEntity.getSendstateView() == 2) serviceSubtaskEntity.setSendstates(Arrays.asList(1L, 3L));
        if (serviceSubtaskEntity.getSendstateView() == 3) serviceSubtaskEntity.setSendstates(Arrays.asList(5L, 7L));
        if (serviceSubtaskEntity.getSendstateView() == 4) serviceSubtaskEntity.setSendstates(Arrays.asList(6L));
        if (serviceSubtaskEntity.getSendstateView() == 5) serviceSubtaskEntity.setSendstates(Arrays.asList(4L));
        List<ServiceSubtask> selectServiceSubtaskList = this.selectServiceSubtaskList(serviceSubtaskEntity);
        List<ServiceSubtaskRes> serviceSubtaskResList = new ArrayList<>();
@@ -356,6 +364,14 @@
            if (ObjectUtils.isNotEmpty(serviceSubtask.getContinueContent())) {
                serviceSubtaskRes.setContinueContent(serviceSubtask.getContinueContent());
            }
//            1:待随访(2 待发送);2:随访中(3 已发送、1 被领取)、3:未完成(5 发送失败、7、超时)、4:已完成( 6 已完成)、5:无需随访(4 不执行)
            if (serviceSubtaskRes.getSendstate() == 2) serviceSubtaskRes.setSendstateView(1L);
            if (serviceSubtaskRes.getSendstate() == 1 || serviceSubtaskRes.getSendstate() == 3L)
                serviceSubtaskRes.setSendstateView(2L);
            if (serviceSubtaskRes.getSendstate() == 5 || serviceSubtaskRes.getSendstate() == 7L)
                serviceSubtaskRes.setSendstateView(3L);
            if (serviceSubtaskRes.getSendstate() == 6) serviceSubtaskRes.setSendstateView(4L);
            if (serviceSubtaskRes.getSendstate() == 4) serviceSubtaskRes.setSendstateView(5L);
            serviceSubtaskResList.add(serviceSubtaskRes);
        }
        return serviceSubtaskResList;
smartor/src/main/java/com/smartor/service/impl/XHGatherPatArchiveServiceImpl.java
@@ -284,6 +284,7 @@
        PatMedInhosp queryInhosp = new PatMedInhosp();
        queryInhosp.setPatno(patArchive.getPatientno());
        queryInhosp.setSerialnum(patMedInhosp.getSerialnum());
        queryInhosp.setCry(Integer.valueOf(cry));
        List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhospList(queryInhosp);
        // 保存或更新住院信息
@@ -323,6 +324,7 @@
        // 医院和床位信息
        patMedInhosp.setHospitalcode(thiedInhospInfo.getAreaId());
        patMedInhosp.setBedNo(thiedInhospInfo.getAdmissBedNo());
        patMedInhosp.setCry(Integer.valueOf(cry));
        // 时间信息
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -36,7 +36,6 @@
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="orgid" column="orgid"/>
        <result property="campusid" column="campusid"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="taskGuid" column="task_guid"/>
@@ -302,6 +301,12 @@
        <if test="senderdetail != null  and senderdetail != ''">and senderdetail = #{senderdetail}</if>
        <if test="type != null  and type != ''">and type = #{type}</if>
        <if test="taskid != null ">and taskid = #{taskid}</if>
        <if test="sendstates != null and sendstates.size() > 0">
            AND sendstate IN
            <foreach collection="sendstates" item="state" open="(" separator="," close=")">
                #{state}
            </foreach>
        </if>
        <!-- taskIds筛选 -->
        <if test="taskIds != null and taskIds.size() > 0">
            AND taskid IN
@@ -813,7 +818,6 @@
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
            <if test="orgid != null">orgid,</if>
            <if test="campusid != null">campusid,</if>
            <if test="pid != null">pid,</if>
            <if test="guid != null">guid,</if>
            <if test="textParam != null">text_param,</if>
@@ -906,7 +910,6 @@
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="campusid != null">#{campusid},</if>
            <if test="pid != null">#{pid},</if>
            <if test="guid != null">#{guid},</if>
            <if test="textParam != null">#{textParam},</if>
@@ -1004,7 +1007,6 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="campusid != null">campusid = #{campusid},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="textParam != null">text_param = #{textParam},</if>
@@ -1103,7 +1105,6 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="campusid != null">campusid = #{campusid},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="textParam != null">text_param = #{textParam},</if>
@@ -1206,7 +1207,6 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="campusid != null">campusid = #{campusid},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="visitCount != null">visit_count = #{visitCount},</if>
@@ -1306,7 +1306,6 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="campusid != null">campusid = #{campusid},</if>
            <if test="pid != null">pid = #{pid},</if>
            <if test="guid != null">guid = #{guid},</if>
            <if test="textParam != null">text_param = #{textParam},</if>
@@ -2556,3 +2555,4 @@
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -30,7 +30,6 @@
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="orgid" column="orgid"/>
        <result property="campusid" column="campusid"/>
        <result property="pid" column="pid"/>
        <result property="guid" column="guid"/>
        <result property="preachform" column="preachform"/>
@@ -126,76 +125,75 @@
    <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult">
        <include refid="selectServiceTaskVo"/>
        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},
                '%')
            </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 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>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="campusid != null  and campusid != ''">and campusid = #{campusid}</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="diagType != null and diagType != ''">and diag_type = #{diagType}</if>
            <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname =
                #{leavehospitaldistrictname}
            </if>
            <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=","
                         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>
        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},
            '%')
        </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 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>
        <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="diagType != null and diagType != ''">and diag_type = #{diagType}</if>
        <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname =
            #{leavehospitaldistrictname}
        </if>
        <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=","
                     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>
        order by update_time desc,taskid desc
    </select>
@@ -257,6 +255,53 @@
        service_task.orgid from service_task
        where 1=1
        and service_task.del_flag = 0
        <!--            and taskid in (-->
        <!--            select task_id from service_taskdept-->
        <!--            where 1=1-->
        <!--                <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">-->
        <!--                    and dept_code in-->
        <!--                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","-->
        <!--                             close=")">-->
        <!--                        #{leaveldeptcode}-->
        <!--                    </foreach>-->
        <!--                </if>-->
        <!--            )-->
        <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>
        and service_task.del_flag = 0
        <if test="taskName != null  and taskName != ''">and service_task.task_name like concat('%', #{taskName},
            '%')
        </if>
@@ -293,6 +338,33 @@
            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>
        <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>
@@ -369,7 +441,6 @@
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
            <if test="orgid != null">orgid,</if>
            <if test="campusid != null">campusid,</if>
            <if test="pid != null">pid,</if>
            <if test="guid != null">guid,</if>
            <if test="preachform != null">preachform,</if>
@@ -423,7 +494,6 @@
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="campusid != null">#{campusid},</if>
            <if test="nexttaskflag != null">#{nexttaskflag},</if>
            <if test="nexttaskid != null">#{nexttaskid},</if>
            <if test="nexttaskname != null">#{nexttaskname},</if>
@@ -484,7 +554,6 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="campusid != null">campusid = #{campusid},</if>
            <if test="nexttaskflag != null">nexttaskflag = #{nexttaskflag},</if>
            <if test="nexttaskid != null">nexttaskid = #{nexttaskid},</if>
            <if test="nexttaskname != null">nexttaskname = #{nexttaskname},</if>
@@ -541,3 +610,4 @@
        </foreach>
    </update>
</mapper>