| | |
| | | <if test="callTaskResult.waterName!=null and callTaskResult.waterName!=''"> |
| | | and arb."name" like concat('%',#{callTaskResult.waterName},'%') |
| | | </if> |
| | | <if test="callTaskResult.isSmsFill!=null and callTaskResult.isSmsFill=='已反馈'"> |
| | | and scnfr.call_id is not null |
| | | </if> |
| | | <if test="callTaskResult.isSmsFill!=null and callTaskResult.isSmsFill=='未反馈'"> |
| | | and scnfr.call_id is null and ctr."call_result"!='200000' |
| | | </if> |
| | | <if test="callTaskResult.userName!=null and callTaskResult.userName!=''"> |
| | | and ctc.userName like concat('%',#{callTaskResult.userName},'%') |
| | | </if> |
| | |
| | | where date_format(gmt_create,'%Y-%m-%d') >= #{params.startTime} |
| | | and date_format(gmt_create,'%Y-%m-%d') < #{params.endTime} |
| | | ) ctr on ctc.call_id = ctr.call_id |
| | | |
| | | and ctc.call_status = 4 and ctr.call_result!='200000' GROUP BY ctc.callee_number,ctr.gmt_create |
| | | )a GROUP BY callee_number |
| | | )b where num=3 |
| | | </select> |
| | | |
| | | <!--查询n天都未接通的人员--> |
| | | <select id="getNotCallConnectStatisticList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select aab."guid", |
| | | sum(case when ifnull(aa.num,9)='9' then 0 else 1 end) count, |
| | | aab."ad_name" as adName |
| | | from SJZT_MD."att_ad_base" aab |
| | | left join ( |
| | | select b.*,aab."guid",aab."ad_grad",aab."p_ad_code",aab."ad_name" as adName from ( |
| | | select "callee_number",waterCodes,LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',','')) num from ( |
| | | select ctr."callee_number",WM_Concat(ctc.waterCode) waterCodes from ( |
| | | select "call_id","task_id",JSON_VALUE("call_task_callee_content",'$."$水库编码$"') as waterCode from "SJZT_ODS"."call_task_callee" |
| | | ) ctc join ( |
| | | select ctr."call_id",ctr."callee_number",ctr."call_result",date_format(ctr."gmt_create",'%Y-%m-%d') "gmt_create" from SJZT_ODS."call_task_result" ctr |
| | | left join "YWXT".sm_call_not_fill_record scnfr on scnfr.call_id = ctr."call_id" |
| | | where date_format(ctr."gmt_create",'%Y-%m-%d') >= #{day.startTime} and date_format(ctr."gmt_create",'%Y-%m-%d') <= #{day.endTime} |
| | | and ctr."call_result"= #{resultStatus} and scnfr.id is null |
| | | )ctr on ctc."call_id" = ctr."call_id" group by ctr."callee_number" |
| | | ) a where LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',','')) = #{number} |
| | | )b |
| | | left join "SJZT_MD"."att_res_base" arb on locate(arb."code",b.waterCodes)>0 |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = concat(arb."ad_guid",'000000') or aab."guid" = arb."interior_ad_guid" |
| | | where aab."ad_name" is not null |
| | | ) aa |
| | | <if test="callTaskStatistic.grad==1"> |
| | | on aab."guid" = aa."p_ad_code" where aab."p_ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | <if test="callTaskStatistic.grad==2"> |
| | | on aab."guid" = aa."guid" where aab."p_ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | on aab."guid" = aa."guid" where aab."ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | group by aab."ad_name",aab."guid" |
| | | order by aab."guid" |
| | | </select> |
| | | |
| | | |
| | | <!--查询未接通,拒接的呼叫结果详情列表信息--> |
| | | <select id="getCallNotConnectResultList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select |
| | | b.*, |
| | | aab."guid",aab."ad_grad",aab."p_ad_code",aab."ad_name" as adName, |
| | | bu.real_name as realName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,2) as cityName, |
| | | REGEXP_SUBSTR (arb."res_loc",'[^-]+',1,3) as countyName, |
| | | arb."name" as waterName |
| | | from ( |
| | | select "callee_number",waterCodes,LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',','')) num from ( |
| | | select ctr."callee_number",WM_Concat(ctc.waterCode) waterCodes from ( |
| | | select "call_id","task_id",JSON_VALUE("call_task_callee_content",'$."$水库编码$"') as waterCode from "SJZT_ODS"."call_task_callee" |
| | | ) ctc join ( |
| | | select ctr."call_id",ctr."callee_number",ctr."call_result",date_format(ctr."gmt_create",'%Y-%m-%d') "gmt_create" from SJZT_ODS."call_task_result" ctr |
| | | left join "YWXT".sm_call_not_fill_record scnfr on scnfr.call_id = ctr."call_id" |
| | | where date_format(ctr."gmt_create",'%Y-%m-%d') >= #{day.startTime} and date_format(ctr."gmt_create",'%Y-%m-%d') <= #{day.endTime} |
| | | and ctr."call_result"= #{callTaskStatistic.resultStatus} and scnfr.id is null |
| | | )ctr on ctc."call_id" = ctr."call_id" group by ctr."callee_number" |
| | | ) a where LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',','')) = #{callTaskStatistic.count} |
| | | )b |
| | | left join "SJZT_MD"."att_res_base" arb on locate(arb."code",b.waterCodes)>0 |
| | | left join "SJZT_MD"."att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join "YWXT".blade_user bu on bu.phone = b."callee_number" and bu.is_deleted = 0 |
| | | where aab."ad_name" is not null |
| | | <if test="list != null and list.size()>0"> |
| | | and aab."ad_code" in |
| | | <foreach collection="list" item="adCode" separator ="," open="(" close=")"> |
| | | #{adCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="callTaskStatistic.realName!=null and callTaskStatistic.realName!=''"> |
| | | and bu.real_name like concat('%',#{callTaskStatistic.realName},'%') |
| | | </if> |
| | | <if test="callTaskStatistic.waterName!=null and callTaskStatistic.waterName!=''"> |
| | | and arb."name" like concat('%',#{callTaskStatistic.waterName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--通过 taskId 查询未呼叫人员(mysql)--> |
| | | <select id="getCallNotConnectListByTaskId" resultType="cn.gistack.sm.intelligentCall.entity.Scene"> |
| | | select ctc.callee_number as phone,ctc.callee_number as userId, |
| | | TRIM(BOTH '"' FROM JSON_EXTRACT(ctc.call_task_callee_content,'$."$水库编码$"')) as waterCode, |
| | | TRIM(BOTH '"' FROM JSON_EXTRACT(ctc.call_task_callee_content,'$."$水库名称$"')) as waterName, |
| | | TRIM(BOTH '"' FROM JSON_EXTRACT(ctc.call_task_callee_content,'$."$用户名$"')) as username |
| | | from call_task_callee ctc |
| | | join call_task_result ctr on ctc.call_id = ctr.call_id |
| | | and ctc.call_status = 4 and ctr.call_result!='200000' and ctc.task_id = #{taskId} |
| | | </select> |
| | | |
| | | </mapper> |