Commit cca75084 by Water Wang

optimize leads statistcs

parent 5b8517ef
...@@ -91,7 +91,9 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService { ...@@ -91,7 +91,9 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService {
public LeadsStatisticsResponseVO leadsStatistics(LeadsStatisticsRequestVO requestVO, HttpServletResponse response) { public LeadsStatisticsResponseVO leadsStatistics(LeadsStatisticsRequestVO requestVO, HttpServletResponse response) {
LeadsStatisticsResponseVO responseVO = new LeadsStatisticsResponseVO(); LeadsStatisticsResponseVO responseVO = new LeadsStatisticsResponseVO();
Integer expertApplyStatus = requestVO.getExpertApplyStatus(),leadsStatus = requestVO.getLeadsStatus(); Integer expertApplyStatus = requestVO.getExpertApplyStatus(),leadsStatus = requestVO.getLeadsStatus();
leadsStatus = (expertApplyStatus != null) ? 2 : leadsStatus; if(leadsStatus != null){
leadsStatus = (expertApplyStatus != null) ? 2 : leadsStatus;
}
String leadsDateSpan = requestVO.getLeadsDateSpan(); String leadsDateSpan = requestVO.getLeadsDateSpan();
Integer isStatement = requestVO.getIsStatement();//0=非报表,1=报表 Integer isStatement = requestVO.getIsStatement();//0=非报表,1=报表
PageInfo<LeadsStatisticsInfo> requestPage = requestVO.getPageInfo(); PageInfo<LeadsStatisticsInfo> requestPage = requestVO.getPageInfo();
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
left join (select expertAssign.leads_expert_request_id as expertRequestId,p.id as expertId,p.name as expertName,c.login as expertMobileNo,expertAssign.created_at as expertAssignTime left join (select expertAssign.leads_expert_request_id as expertRequestId,p.id as expertId,p.name as expertName,c.login as expertMobileNo,expertAssign.created_at as expertAssignTime
from ag_mkt_leads_expert_assign expertAssign inner join ag_acl_practitioner p on expertAssign.expert_practitioner_id = p.id from ag_mkt_leads_expert_assign expertAssign inner join ag_acl_practitioner p on expertAssign.expert_practitioner_id = p.id
inner join ag_acl_customer c on p.customer_id = c.id) expertAssign on request.id = expertAssign.expertRequestId inner join ag_acl_customer c on p.customer_id = c.id) expertAssign on request.id = expertAssign.expertRequestId
inner join (SELECT maxt.customer_id as leadsCustomerId, left join (SELECT maxt.customer_id as leadsCustomerId,
tr.md_drop_option_id as leadsStatusId, -- 商机状态id tr.md_drop_option_id as leadsStatusId, -- 商机状态id
options.drop_option_name as leadsStatusName -- 商机状态名 options.drop_option_name as leadsStatusName -- 商机状态名
FROM(SELECT customer_id,max(updated_at) as track_time FROM ag_mkt_leads_assigned_track tr GROUP BY tr.customer_id) maxt FROM(SELECT customer_id,max(updated_at) as track_time FROM ag_mkt_leads_assigned_track tr GROUP BY tr.customer_id) maxt
......
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