瀏覽代碼

记录查询关联任务 任务如果被删了就不查询出

zyy 1 月之前
父節點
當前提交
19de3f09e6

+ 2 - 0
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallLogAddwxMapper.xml

@@ -155,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  left join company t4 on t4.company_id = t1.company_id
                  left join company_user t5 on t5.user_id = t2.company_user_id
                  left join company_voice_robotic_wx t6 on t6.robotic_id = t1.robotic_id
+        inner join company_voice_robotic t7 on t7.id = t1.robotic_id
         <where>
             t1.is_we_com = 2
             <if test="logId != null"> and t1.log_id = #{logId}</if>
@@ -194,6 +195,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join company_user t5 on t5.user_id = t2.company_user_id
         left join company_voice_robotic_wx t6 on t6.robotic_id = t1.robotic_id
         left join company_wx_dialog t7 on t7.id = t6.wx_dialog_id
+        inner join company_voice_robotic cvr on cvr.id = t1.robotic_id
         <where>
             t1.is_we_com = 2
             <if test="roboticId != null"> and t1.robotic_id = #{roboticId}</if>

+ 6 - 3
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallLogCallphoneMapper.xml

@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sum(case when status = 2 then 1 else 0 end) as successCount,
         sum(case when status = 3 then 1 else 0 end) as failCount
         from company_voice_robotic_call_log_callphone t1
-        left join company_voice_robotic cvr on cvr.id = t1.robotic_id
+        inner join company_voice_robotic cvr on cvr.id = t1.robotic_id
         <where>
             <if test="roboticId != null">and robotic_id = #{roboticId}</if>
         </where>
@@ -217,7 +217,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             sum(case when status = 2 then 1 else 0 end) as successRecordCount,
             sum(case when run_time &gt;= CURDATE() and run_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todayCount,
             sum(case when status = 2 and run_time &gt;= CURDATE() and run_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todaySuccessCount
-        from company_voice_robotic_call_log_callphone
+        from company_voice_robotic_call_log_callphone cp
+            inner join company_voice_robotic cvr on cvr.id = cp.robotic_id
     </select>
 
 
@@ -225,10 +226,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
         t1.*,
         t2.company_name,
-        t3.nick_name as companyUserName
+        t3.nick_name as companyUserName,
+        cvr.name as robotic_name
         FROM company_voice_robotic_call_log_callphone t1
         left join company t2 on t1.company_id = t2.company_id
         left join company_user t3 on t3.user_id = t1.company_user_id
+        left join company_voice_robotic cvr on cvr.id = t1.robotic_id
         where 1=1
         <if test="roboticId != null">and t1.robotic_id = #{roboticId}</if>
         <if test="callerId != null">and t1.caller_id = #{callerId}</if>

+ 5 - 2
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallLogSendmsgMapper.xml

@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sum(case when status = 2 then 1 else 0 end) as successCount,
         sum(case when status = 3 then 1 else 0 end) as failCount
         from company_voice_robotic_call_log_sendmsg msg
-        left join company_voice_robotic cvr on cvr.id = msg.robotic_id
+        inner join company_voice_robotic cvr on cvr.id = msg.robotic_id
         <where>
             <if test="roboticId != null">and robotic_id = #{roboticId}</if>
             <if test="callerId != null">and caller_id = #{callerId}</if>
@@ -140,12 +140,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t2.company_name,
             t3.nick_name as companyUserName,
             t4.title as smsTempName,
-            cc.phone
+            cc.phone,
+            cvr.name as robotic_name
         FROM company_voice_robotic_call_log_sendmsg t1
                  left join company_voice_robotic_callees cc on cc.id = t1.caller_id
                  left join company t2 on t1.company_id = t2.company_id
                  left join company_user t3 on t3.user_id = t1.company_user_id
                  left join company_sms_temp t4 on t4.temp_id = t1.temp_id
+                 left join company_voice_robotic cvr on cvr.id = t1.robotic_id
         where 1=1
         <if test="roboticId != null">and t1.robotic_id = #{roboticId}</if>
         <if test="callerId != null">and t1.caller_id = #{callerId}</if>
@@ -169,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             sum(case when run_time &gt;= CURDATE() and run_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todayCount,
             sum(case when status = 2 and run_time &gt;= CURDATE() and run_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todaySuccessCount
         from company_voice_robotic_call_log_sendmsg msg
+            inner join company_voice_robotic cvr on cvr.id = msg.robotic_id
     </select>
 
 </mapper>