陈昶聿
4 小时以前 ecbb6791ae00a8a4076715b87a941c0a8557fa03
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -1203,8 +1203,12 @@
                AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
            </if>
            <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
            <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
            <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
            <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>
            <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
            <!-- 目前只统计语音和问卷 -->
            <if test="type != null">
                and type = #{type}
            </if>
    </select>
    <select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
@@ -1330,12 +1334,18 @@
    <select id="getSfStatisticsCategory" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
            resultMap="ServiceSubtaskResult2">
        SELECT a.sub_id as subTaskId,
        SELECT
        <if test="configValue != null and configValue != ''">
            SUM(CASE WHEN a.categoryid IN(${configValue})
            THEN 1 ELSE 0 END) AS joyAllCount,
        </if>
        COUNT(sub_id) joyCount
        <if test="configValue != null and configValue != ''">
            SUM(CASE WHEN a.categoryid IN(${configValue})
                AND a.matchedtext is not null
                AND a.matchedtext != ''
            THEN 1 ELSE 0 END) AS joyCount,
        </if>
        a.sub_id as subTaskId
        FROM service_subtask_detail a
        INNER JOIN service_subtask t ON a.sub_id = t.id
        where 1=1