| | |
| | | <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> |
| | |
| | | )b where num=3 |
| | | </select> |
| | | |
| | | <!--查询三天都未接通的人员-mysql--> |
| | | <select id="getNotCallConnectStatisticList" resultType="cn.gistack.sm.intelligentCall.vo.CallTaskStatistic"> |
| | | select aab."guid", |
| | | sum(case when ifnull(cc.num,0)='0' then 0 else 1 end) refuseConnectCount, |
| | | sum(case when ifnull(bb.num,0)='0' then 0 else 1 end) twoNoConnectCount, |
| | | sum(case when ifnull(aa.num,0)='0' then 0 else 1 end) threeNoConnectCount, |
| | | 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 "call_id","callee_number","call_result",date_format("gmt_create",'%Y-%m-%d') "gmt_create" from SJZT_ODS."call_task_result" |
| | | where date_format("gmt_create",'%Y-%m-%d') >= #{threeDay.startTime} and date_format("gmt_create",'%Y-%m-%d') <= #{threeDay.endTime} |
| | | and "call_result"='200003' |
| | | )ctr on ctc."call_id" = ctr."call_id" group by ctr."callee_number" |
| | | ) a where LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',',''))>1 |
| | | )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') |
| | | where aab."ad_name" is not null |
| | | ) aa |
| | | <if test="callTaskStatistic.grad==1"> |
| | | on aab."guid" = aa."p_ad_code" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==2"> |
| | | on aab."guid" = aa."guid" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | on aab."guid" = aa."guid" |
| | | </if> |
| | | 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 "call_id","callee_number","call_result",date_format("gmt_create",'%Y-%m-%d') "gmt_create" from SJZT_ODS."call_task_result" |
| | | where date_format("gmt_create",'%Y-%m-%d') >= #{twoDay.startTime} and date_format("gmt_create",'%Y-%m-%d') <= #{twoDay.endTime} |
| | | and "call_result"='200003' |
| | | )ctr on ctc."call_id" = ctr."call_id" group by ctr."callee_number" |
| | | ) a where LENGTH(waterCodes)- LENGTH(REPLACE(waterCodes,',',''))=1 |
| | | )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') |
| | | where aab."ad_name" is not null |
| | | ) bb |
| | | <if test="callTaskStatistic.grad==1"> |
| | | on aab."guid" = bb."p_ad_code" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==2"> |
| | | on aab."guid" = bb."guid" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | on aab."guid" = bb."guid" |
| | | </if> |
| | | 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 "call_id","callee_number","call_result",date_format("gmt_create",'%Y-%m-%d') "gmt_create" from SJZT_ODS."call_task_result" |
| | | where date_format("gmt_create",'%Y-%m-%d') >= #{oneDay.startTime} and date_format("gmt_create",'%Y-%m-%d') <= #{oneDay.endTime} |
| | | and "call_result"='200005' |
| | | )ctr on ctc."call_id" = ctr."call_id" group by ctr."callee_number" |
| | | ) a where 1=1 |
| | | )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') |
| | | where aab."ad_name" is not null |
| | | ) cc |
| | | <if test="callTaskStatistic.grad==1"> |
| | | on aab."guid" = cc."p_ad_code" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==2"> |
| | | on aab."guid" = cc."guid" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | on aab."guid" = cc."guid" |
| | | </if> |
| | | <if test="callTaskStatistic.grad==1"> |
| | | where aab."p_ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | <if test="callTaskStatistic.grad==2"> |
| | | where aab."p_ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | <if test="callTaskStatistic.grad==3"> |
| | | where aab."ad_code" = #{callTaskStatistic.adCode} |
| | | </if> |
| | | group by aab."ad_name",aab."guid" |
| | | order by aab."guid" |
| | | </select> |
| | | |
| | | </mapper> |