Explorar el Código

人工客服统计新增已接通和未接通字段

王苗苗 hace 2 meses
padre
commit
36036dc30e

+ 2 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TCallRecordMapper.java

@@ -92,4 +92,6 @@ public interface TCallRecordMapper
     Integer getStatusByUserId(String userId);
 
     int getCountByTypeAndDate(@Param("category") int category, @Param("date") String date, @Param("userId") String userId);
+
+    int getPersonCountByType(int type);
 }

+ 9 - 0
slibra-system/src/main/java/com/slibra/business/res/CallRecordCount.java

@@ -78,6 +78,15 @@ public class CallRecordCount {
     //累计通话
     private int personCount;
 
+    //2024年12月31日13:53:16 新增统计字段
+    //累计通话-接通
+    private int personCountOn;
+
+    //累计通话-未接通
+    private int personCountOff;
+
+    //2024年12月31日13:53:16 新增统计字段-结束
+
     //累计通话时长
     private long personTotal;
     //------人工客服状态结束------

+ 2 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TCallRecordServiceImpl.java

@@ -314,6 +314,8 @@ public class TCallRecordServiceImpl implements ITCallRecordService
 
         //通话次数和通话时长
         callRecordCount.setPersonCount(this.tCallRecordMapper.getPersonCountRecordIsRobot(0));
+        callRecordCount.setPersonCountOn(this.tCallRecordMapper.getPersonCountByType(1));//接通
+        callRecordCount.setPersonCountOff(this.tCallRecordMapper.getPersonCountByType(0));//未接通
         callRecordCount.setPersonTotal(this.tCallRecordMapper.getPersonTotalRecordIsRobot(0, null));
 
         callRecordCount.setRobotCount(this.tCallRecordMapper.getPersonCountRecordIsRobot(1));

+ 13 - 0
slibra-system/src/main/resources/mapper/business/TCallRecordMapper.xml

@@ -270,6 +270,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="type == 1 "> and service_category != 0 </if>
     </select>
 
+    <select id="getPersonCountByType" resultType="int">
+        SELECT
+        COUNT(*)
+        FROM
+        t_call_record
+        WHERE
+        1 = 1
+        AND del_flag = 0
+        and service_category = 0
+        <if test="type == 0 "> and (user_id is null or user_id = '') </if>
+        <if test="type == 1 "> and user_id is not null and user_id != ''</if>
+    </select>
+
     <select id="getPersonTotalRecordIsRobot" resultType="long">
         SELECT
         IFNULL(SUM(times),0)