|
|
@@ -195,4 +195,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND callphone.create_time >= CURDATE()
|
|
|
AND callphone.create_time < CURDATE() + INTERVAL 1 DAY
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectCompanyVoiceRoboticCallPhoneLogGroupList" resultType="com.fs.company.domain.CompanyVoiceRoboticCallLogCallphone" parameterType="com.fs.company.domain.CompanyVoiceRoboticCallLogCallphone">
|
|
|
+ select
|
|
|
+ robotic_id,
|
|
|
+ cvr.name as robotic_name,
|
|
|
+ count(1) as totalRecordCount,
|
|
|
+ sum(case when status = 1 then 1 else 0 end) as runningCount,
|
|
|
+ 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
|
|
|
+ <where>
|
|
|
+ <if test="roboticId != null">and robotic_id = #{roboticId}</if>
|
|
|
+ </where>
|
|
|
+ group by robotic_id
|
|
|
+ </select>
|
|
|
+ <select id="selectCompanyVoiceRoboticCallPhoneLogCount" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogCount">
|
|
|
+ select
|
|
|
+ count(1) as recordCount,
|
|
|
+ sum(case when status = 2 then 1 else 0 end) as successRecordCount,
|
|
|
+ sum(case when run_time >= CURDATE() and run_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todayCount,
|
|
|
+ sum(case when status = 2 and run_time >= CURDATE() and run_time < DATE_ADD(CURDATE(), INTERVAL 1 DAY) then 1 else 0 end) as todaySuccessCount
|
|
|
+ from company_voice_robotic_call_log_callphone
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="listByRoboticId" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogCallPhoneVO" parameterType="CompanyVoiceRoboticCallLogCallphone">
|
|
|
+ SELECT
|
|
|
+ t1.*,
|
|
|
+ t2.company_name,
|
|
|
+ t3.nick_name as companyUserName
|
|
|
+ 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
|
|
|
+ where 1=1
|
|
|
+ <if test="roboticId != null">and t1.robotic_id = #{roboticId}</if>
|
|
|
+ <if test="callerId != null">and t1.caller_id = #{callerId}</if>
|
|
|
+ <if test="callerIds != null and callerIds.size() > 0">
|
|
|
+ AND t1.caller_id IN
|
|
|
+ <foreach collection='callerIds' item='item' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="callerNum != null and callerNum != ''">
|
|
|
+ and t1.caller_num like concat('%', #{callerNum}, '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|