Commit 64c796d4 by yao.xiao

修改-查询分值bug

parent 0e59d6cf
......@@ -740,6 +740,7 @@
<if test="practitionerId != null">
and a.assigned_practitioner_id = #{practitionerId}
</if>
order by a.id desc
</select>
<select id="findByIds" resultType="com.yd.dal.entity.customer.AclPractitioner">
select
......@@ -771,9 +772,9 @@
select
p.id practitionerId,
p.name name ,
sum(case when to_days(t.track_time)=to_days(now()) then t.track_score end) scoreDay,
sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score end) scoreWeek,
sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score end) scoreMonth,
sum(case when to_days(t.track_time)=to_days(now()) then t.track_score else 0 end) scoreDay,
sum(case when YEARWEEK(date_format(t.track_time,'%Y-%m-%d')) = YEARWEEK(now()) then t.track_score else 0 end) scoreWeek,
sum(case when date_format(t.track_time,'%Y-%m')=date_format(now(),'%Y-%m') then t.track_score else 0 end) scoreMonth,
count(DISTINCT case when YEARWEEK(date_format(a.created_at,'%Y-%m-%d')) = YEARWEEK(now()) then a.id end) addOpportunityNum
from ag_acl_practitioner p
left join ag_mkt_leads_assigned_track t on p.id = t.practitioner_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