Commit 9e930b39 by yao.xiao

增加-商机列表显示什么指派

parent 5f8e2c3f
......@@ -14,4 +14,5 @@ public class OwnOpportunityInfo {
private Long leadsAssignedId;
private Double scoreDay;
private Double scoreTotal;
private Long expertType;//0.经纪人指派 1.专家指派
}
\ No newline at end of file
......@@ -720,6 +720,7 @@
<result column="mdDropOptionName" property="mdDropOptionName"/>
<result column="scoreDay" property="scoreDay"/>
<result column="scoreTotal" property="scoreTotal"/>
<result column="expertType" property="expertType"/>
</resultMap>
<select id="ownOpportunityQuery" resultMap="opportunityQuery">
SELECT
......@@ -731,7 +732,8 @@
a.id leadsAssignedId ,
(SELECT md.drop_option_name from ag_md_drop_options md LEFT JOIN ag_mkt_leads_assigned_track amlat ON md.id = amlat.md_drop_option_id where amlat.practitioner_id = a.assigned_practitioner_id and amlat.customer_id = a.customer_id ORDER BY amlat.created_at DESC LIMIT 1) mdDropOptionName,
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id) scoreTotal ,
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id and to_days(track_time) = to_days(now())) scoreDay
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id and to_days(track_time) = to_days(now())) scoreDay,
if((select count(*) from ag_mkt_leads_expert_assign ass left join ag_mkt_leads_expert_request r on r.id = ass.leads_expert_request_id where r.customer_id = a.customer_id and a.assigned_practitioner_id = ass.expert_practitioner_id ) = 0,0,1) expertType
FROM
ag_mkt_leads_assigneds a
LEFT JOIN ag_mkt_leads_pool p ON p.customer_id = a.customer_id
......
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