liusheng
2 天以前 a77bf9fb4718d1b657f8ef8c6edfaffa1a53683f
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -567,6 +567,8 @@
        SUM(CASE WHEN DATE(visit_time) < DATE(IFNULL(finishtime, NOW())) THEN 1 ELSE 0 END) / COUNT(*) as rate
        FROM service_subtask
        WHERE del_flag = 0
        AND visit_time IS NOT NULL
        AND finishtime IS NOT NULL
        <if test="orgid != null">AND orgid = #{orgid}</if>
        <if test="starttime == null and endtime==null">
            AND visit_time &lt; NOW()
@@ -1216,7 +1218,39 @@
    <select id="getSfStatistics" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
        select id,
        visit_count,
        is_visit_again,
        type,
        orgid,
        drcode,
        drname,
        leavehospitaldistrictcode,
        leavehospitaldistrictname,
        deptcode,
        deptname,
        sendstate,
        preachform,
        excep,
        nurse_id,
        nurse_name,
        taskid,
        task_name,
        visit_time,
        finishtime,
        endtime,
        senddate,
        suggest,
        result,
        templateid,
        templatename,
        patid,
        sendname,
        send_type,
        recordid,
        exrecallcount,
        task_situation
        from service_subtask
        where 1=1
        and del_flag = 0
        <if test="orgid != null and orgid != ''">
@@ -1983,7 +2017,8 @@
        SUM(CASE WHEN sendstate >= 3 OR sendstate = 1 THEN 1 ELSE 0 END) AS yfs,
        SUM(CASE WHEN sendstate = 2 THEN 1 ELSE 0 END) AS dsf,
        SUM(CASE WHEN sendstate = 1 THEN 1 ELSE 0 END) AS blq,
        SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc
        SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc,
        SUM(CASE WHEN isabnormal IS NOT NULL AND isabnormal = 2 THEN 1 ELSE 0 END) AS jg
        FROM service_subtask
        where 1=1
        and del_flag = 0