|
@@ -141,6 +141,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isWeCom != null "> and t1.is_we_com = #{isWeCom}</if>
|
|
<if test="isWeCom != null "> and t1.is_we_com = #{isWeCom}</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <select id="selectCompanyVoiceRoboticCallLogAddwxGroupList" resultType="com.fs.company.domain.CompanyVoiceRoboticCallLogAddwx" parameterType="com.fs.company.domain.CompanyVoiceRoboticCallLogAddwx">
|
|
|
|
|
+ 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,
|
|
|
|
|
+ concat(round(sum(case when t3.is_add = 1 then 1 else 0 end) * 100.0 / count(1), 2), '%') as successRate
|
|
|
|
|
+ from company_voice_robotic_call_log_addwx t1
|
|
|
|
|
+ inner join company_voice_robotic cvr on cvr.id = t1.robotic_id
|
|
|
|
|
+ left join company_wx_client t3 on t3.id = t1.wx_client_id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="roboticId != null">and robotic_id = #{roboticId}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ group by robotic_id
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="listAll" parameterType="CompanyVoiceRoboticCallLogAddwx" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO">
|
|
<select id="listAll" parameterType="CompanyVoiceRoboticCallLogAddwx" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO">
|
|
|
select
|
|
select
|
|
|
t1.*,
|
|
t1.*,
|
|
@@ -204,4 +222,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="roboticId != null"> and t1.robotic_id = #{roboticId}</if>
|
|
<if test="roboticId != null"> and t1.robotic_id = #{roboticId}</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="listByRoboticId" resultType="com.fs.company.vo.CompanyVoiceRoboticCallLogAddwxVO" parameterType="com.fs.company.domain.CompanyVoiceRoboticCallLogAddwx">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ t1.*,
|
|
|
|
|
+ t2.company_name,
|
|
|
|
|
+ t3.nick_name as companyUserName,
|
|
|
|
|
+ cvr.name as robotic_name
|
|
|
|
|
+ FROM company_voice_robotic_call_log_addwx 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="wxClientId != null">and t1.wx_client_id = #{wxClientId}</if>
|
|
|
|
|
+ <if test="wxClientIds != null and wxClientIds.size() > 0">
|
|
|
|
|
+ AND t1.wx_client_id IN
|
|
|
|
|
+ <foreach collection='wxClientIds' item='item' open='(' separator=',' close=')'>
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="wxAccountId != null and wxAccountId != ''">
|
|
|
|
|
+ and t1.wx_account_id like concat('%', #{wxAccountId}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectCompanyVoiceRoboticAddwxLogCount" 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_addwx cw
|
|
|
|
|
+ inner join company_voice_robotic cvr on cvr.id = cw.robotic_id
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|