瀏覽代碼

统计接口查询逻辑调整

王苗苗 2 月之前
父節點
當前提交
6f5dff19dc

+ 6 - 1
slibra-system/src/main/java/com/slibra/business/res/CallRecordCount.java

@@ -31,12 +31,17 @@ public class CallRecordCount {
     //电话量
     private int whiteListTotal;
 
+    //2025年01月20日14:38:45  新增的字段 人工坐席
+    private int whiteListTotalHuman;
+    //2025年01月20日14:38:45  机器人
+    private int whiteListTotalRobot;
+
     //总量占比
     private BigDecimal whiteListPercent = BigDecimal.ZERO;
 
 
     //------AI机器人------
-    //电话量 2024年12月19日15:01:22 这里展示的只是呼入[]
+    //电话量 2024年12月19日15:01:22 这里展示的是【电话量】
     private int aiTotal;
 
     //总量占比

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

@@ -337,8 +337,12 @@ public class TCallRecordServiceImpl implements ITCallRecordService
         callRecordCount.setTotal(total);
         int humanTotal = this.tCallRecordMapper.getTotalByType(2);
         callRecordCount.setHumanTotal(humanTotal);
-        int whiteListTotal = this.tCallRecordMapper.getTotalByType(0);
-        callRecordCount.setWhiteListTotal(whiteListTotal);
+        /*int whiteListTotal = this.tCallRecordMapper.getTotalByType(0);
+        callRecordCount.setWhiteListTotal(whiteListTotal);*/
+        int whiteListTotalHuman = this.tCallRecordMapper.getTotalByType(0);
+        callRecordCount.setWhiteListTotalHuman(whiteListTotalHuman);
+        int whiteListTotalRobot = this.tCallRecordMapper.getTotalByType(1);
+        callRecordCount.setWhiteListTotalRobot(whiteListTotalRobot);
         int aiTotal = this.tCallRecordMapper.getTotalByIsAi(1);
         callRecordCount.setAiTotal(aiTotal);
         int traditionTotal = this.tCallRecordMapper.getTotalByIsAi(0);

+ 22 - 8
slibra-system/src/main/resources/mapper/business/TCallRecordMapper.xml

@@ -235,7 +235,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t_call_record
         WHERE
             1 = 1 AND del_flag = 0
-        <if test="type != null "> and type = #{type}</if>
+        <if test="type != null ">
+            <choose>
+                <when test="2 == type">
+                    and category = 0 and type = 2
+                </when>
+                <when test="0 == type">
+                    and category = 0 and type = 0 and service_category = 0
+                </when>
+                <when test="1 == type">
+                    and category = 0 and type = 0 and (service_category = 1 or service_category = 2)
+                </when>
+            </choose>
+        </if>
     </select>
 
 
@@ -245,10 +257,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
         t_call_record
         WHERE
-        1 = 1 and  type = 1 AND del_flag = 0
-        <if test="businessType == 1 "> and (bussiness_type != '不体验AI服务' or bussiness_type is NULL or bussiness_type = '') and category = 0</if>
-        <if test="businessType == 0 "> and bussiness_type = '不体验AI服务' and category = 0</if>
-        <if test="businessType == 2 "> and category = 1</if>
+        1 = 1 AND del_flag = 0
+        <if test="businessType == 1 "> and category = 0 and type = 1 and bussiness_type != '不体验AI服务' </if>
+        <if test="businessType == 0 "> and category = 0 and type = 1 and bussiness_type = '不体验AI服务'</if>
+        <if test="businessType == 2 "> and category = 1 and type = 2</if>
     </select>
 
     <select id="getSpecialCount" resultType="int">
@@ -291,7 +303,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             1 = 1
           AND del_flag = 0
         <if test="type == 0 "> and service_category = 0</if>
-        <if test="type == 1 "> and service_category != 0 </if>
+        <if test="type == 1 "> and (service_category = 1 or service_category = 2) </if>
     </select>
 
     <select id="getPersonCountByType" resultType="int">
@@ -303,8 +315,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         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>
+        <!--<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>-->
+        <if test="type == 0 "> and status = 0 </if>
+        <if test="type == 1 "> and status = 1 </if>
     </select>
 
     <select id="getPersonTotalRecordIsRobot" resultType="long">