cc il y a 3 mois
Parent
commit
404178db27

+ 1 - 0
src/main/java/com/qingjian/common/model/call/query/CallRecordQuery.java

@@ -78,6 +78,7 @@ public class CallRecordQuery extends Query {
      * 对方号码
      */
     private List<String> otherPhones;
+    private String otherPhone;
 
     private String startTime;
 

+ 5 - 0
src/main/java/com/qingjian/module/call/service/CallRecordService.java

@@ -1,5 +1,6 @@
 package com.qingjian.module.call.service;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -27,6 +28,10 @@ public class CallRecordService extends ServiceImpl<CallRecordMapper, CallRecord>
         query.setTableName(governConfService.getCallTableName());
         query.setSymbol(StrUtil.emptyToDefault(query.getSymbol(), "ge"));
 
+        if(CollUtil.isNotEmpty(query.getOtherPhones()) && query.getOtherPhones().contains("未知号码")){
+            query.getOtherPhones().clear();
+            query.setOtherPhone("未知号码");
+        }
         return this.baseMapper.selectCallRecordPage(Page.of(query.getPage(), query.getLimit()), query);
     }
 

+ 2 - 2
src/main/resources/mappers/call/CallContinuousMapper.xml

@@ -20,7 +20,7 @@
         personName,
         personPhone,
         COALESCE(otherName, '未知对手') AS otherName,
-        COALESCE(otherPhone, '未知对手号码') AS otherPhone,
+        COALESCE(otherPhone, '未知号码') AS otherPhone,
         DATE_TRUNC('month', callDate) AS call_month
         FROM ${query.tableName}
         <where>
@@ -42,7 +42,7 @@
             </if>
             <if test="query.otherPhone != null and query.otherPhone != ''">
                 <choose>
-                    <when test="query.otherPhone == '未知对手号码'">
+                    <when test="query.otherPhone == '未知号码'">
                         AND otherPhone IS NULL
                     </when>
                     <otherwise>

+ 3 - 3
src/main/resources/mappers/call/CallNightMapper.xml

@@ -7,7 +7,7 @@
         SELECT
         personName,
         COALESCE(otherName, '未知对手') AS otherName,
-        COALESCE(otherPhone, '未知对手号码') AS otherPhone,
+        COALESCE(otherPhone, '未知号码') AS otherPhone,
         DATE_TRUNC('month', callDate) AS call_month
         FROM ${query.tableName}
         <where>
@@ -34,7 +34,7 @@
             </if>
             <if test="query.otherPhone != null and query.otherPhone != ''">
                 <choose>
-                    <when test="query.otherPhone == '未知对手号码'">
+                    <when test="query.otherPhone == '未知号码'">
                         AND otherPhone IS NULL
                     </when>
                     <otherwise>
@@ -92,7 +92,7 @@
             </if>
             <if test="query.otherPhone != null and query.otherPhone != ''">
                 <choose>
-                    <when test="query.otherPhone == '未知对手号码'">
+                    <when test="query.otherPhone == '未知号码'">
                         AND otherPhone IS NULL
                     </when>
                     <otherwise>

+ 12 - 0
src/main/resources/mappers/call/CallRecordMapper.xml

@@ -137,6 +137,18 @@
                     </otherwise>
                 </choose>
             </if>
+
+            <if test="query.otherPhone != null and query.otherPhone != ''">
+                <choose>
+                    <when test="query.otherPhone == '未知号码'">
+                        and otherPhone IS NULL
+                    </when>
+                    <otherwise>
+                        and otherPhone = #{query.otherPhone}
+                    </otherwise>
+                </choose>
+            </if>
+
             <if test="query.otherPhones != null and query.otherPhones.size>0">
                 AND otherPhone in
                 <foreach item="phone" collection="query.otherPhones" separator="," open="(" close=")">