Commit 72078160 authored by huagnxiner's avatar huagnxiner

回访统计报表bug修复

parent a851be2f
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
<li> <li>
<a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a> <a tabindex="-1" href="${ctx}/statistic/cloudCusReport/">云迹数据统计表</a>
</li> </li>
<%-- <li>--%> <li>
<%-- <a tabindex="-1" href="${ctx}/statistic/callBackTraceStatistic/">回访跟进统计</a>--%> <a tabindex="-1" href="${ctx}/statistic/callBackTraceStatistic/">回访跟进统计</a>
<%-- </li>--%> </li>
</ul> </ul>
</li> </li>
</shiro:hasPermission> </shiro:hasPermission>
......
...@@ -201,10 +201,10 @@ ...@@ -201,10 +201,10 @@
var startTime = $("#startTime"); var startTime = $("#startTime");
var endTime = $("#endTime"); var endTime = $("#endTime");
if (startTime.val() == '') { if (startTime.val() == '') {
startTime.val(getYesterday()); startTime.val(getToday());
} }
if (endTime.val() == '') { if (endTime.val() == '') {
endTime.val(getYesterday()); endTime.val(getToday());
} }
} }
......
...@@ -19,21 +19,21 @@ ...@@ -19,21 +19,21 @@
<![CDATA[ <![CDATA[
SELECT( SELECT(
SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 AND c.STATUS in(11,0,99) and manager_id = #{managerId} SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 AND c.STATUS in(11,0,99) and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall=0 OR c.isWaitCall IS NULL)) as allCount, and c.bind_time>=#{startTime} and c.bind_time<=#{endTime} and (c.isWaitCall=0 OR c.isWaitCall IS NULL)) as allCount,
(SELECT FORMAT(count(id),0) from customer as c where c.STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and manager_id = #{managerId} (SELECT FORMAT(count(id),0) from customer as c where c.STATUS in(11,0,99) and isWaitCall = 1 and c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime}) as waitCount, and c.bind_time>=#{startTime} and c.bind_time<=#{endTime}) as waitCount,
(SELECT FORMAT(count(id),0) FROM customer_merge c inner join (select customer_id,count((substr(ccl.manager_name,1,5)!='CRM用户' and ccl.manager_id!=0) or null) as count (SELECT FORMAT(count(id),0) FROM customer_merge c inner join (select customer_id,count((substr(ccl.manager_name,1,5)!='CRM用户' and ccl.manager_id!=0) or null) as count
from customer_callback_log ccl group by customer_id having count>0) n on c.id=n.customer_id where 1=1 from customer_callback_log ccl group by customer_id having count>0) n on c.id=n.customer_id where 1=1
and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime} and manager_id = #{managerId} and c.bind_time>=#{startTime} and c.bind_time<=#{endTime}
AND c.last_call_time is not null AND c.is_delete = 0 AND c.STATUS IN ( 11, 0, 99) AND c.last_call_time is not null AND c.is_delete = 0 AND c.STATUS IN ( 11, 0, 99)
AND ( c.isWaitCall = 0 OR c.isWaitCall IS NULL)) as callCount, AND ( c.isWaitCall = 0 OR c.isWaitCall IS NULL)) as callCount,
(SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 and manager_id = #{managerId} (SELECT FORMAT(count(id),0) from customer_merge as c where c.is_delete = 0 and manager_id = #{managerId}
and c.create_time>=#{startTime} and c.create_time<=#{endTime} and (c.isWaitCall = 0 OR c.isWaitCall IS NULL) and c.bind_time>=#{startTime} and c.bind_time<=#{endTime} and (c.isWaitCall = 0 OR c.isWaitCall IS NULL)
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudSent, AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudSent,
(select FORMAT(count(id),0) FROM customer_merge c inner join (select m.customer_id from customer_callback_log m inner join (select FORMAT(count(id),0) FROM customer_merge c inner join (select m.customer_id from customer_callback_log m inner join
(select customer_id,count(*) as count from customer_callback_log group by customer_id) n (select customer_id,count(*) as count from customer_callback_log group by customer_id) n
on n.count=1 and m.customer_id=n.customer_id and m.manager_id=0) c2 on c.id=c2.customer_id on n.count=1 and m.customer_id=n.customer_id and m.manager_id=0) c2 on c.id=c2.customer_id
where 1=1 AND c.is_delete = 0 and manager_id = #{managerId} and c.create_time>=#{startTime} and c.create_time<=#{endTime} where 1=1 AND c.is_delete = 0 and manager_id = #{managerId} and c.bind_time>=#{startTime} and c.bind_time<=#{endTime}
AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudWait AND c.STATUS IN ( 11, 0, 99 ) and c.customer_source_type=7) as cloudWait
]]> ]]>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment