sum(case when rtg.id = 1 then rtv.tag_value_score else 0 end) sfjs,
sum(case when rtg.id = 2 then rtv.tag_value_score else 0 end) fwys,
sum(case when rtg.id = 3 then rtv.tag_value_score else 0 end) htjr,
sum(case when rtg.id = 4 then rtv.tag_value_score else 0 end) xqfx,
sum(case when rtg.id = 5 then rtv.tag_value_score else 0 end) zyzs,
sum(case when rtg.id = 6 then rtv.tag_value_score else 0 end) cjsz,
sum(case when rtg.id = 7 then rtv.tag_value_score else 0 end) alzs,
sum(case when rtg.id = 8 then rtv.tag_value_score else 0 end) gfnl,
sum(case when rtg.id = 9 then rtv.tag_value_score else 0 end) bdnl
from inspection_badge_recordings ibr
left join reception_customer_info rci on rci.id =ibr.reception_id
left join inspection_employee_badge t3 on ibr.badge_id =t3.badge_id
...
...
@@ -263,19 +274,23 @@ left join ( select
on dclgoc.order_code = dclgo.order_code and dclgoc.deleted_flag = 'N'
left join dj_car_life_pay_order dclpo on dclpo.order_code = dclgo.order_code and dclpo.deleted_flag = 'N'
where dclgo.deleted_flag = 'N'
and dclgo.scene_type = 1 # 0:权益 1:轻改
and dclgo.scene_type = 0 # 0:权益 1:轻改
and dclgo.status in (4, 6) and upgrade_flag = 'Y'
group by dclgoc.customer_phone
order by order_time desc) t4 on rci.phone_number =t4.customer_phone
left join recording_tag_relation rtr on rtr.recording_id = ibr.id
left join recording_tag_value rtv on rtr.tag_id=rtv.id
left join recording_tag_group rtg on rtg.id=rtv.tag_groupid
where
# recording_start_time BETWEEN %s and %s
ibr.id in (100527,100193,100116,99945,99900,99677,99641,99479,99466,99416,99184,96991,94531,94523,94436,93801,93349,92990,92895,92867,97165,96835,96713,96158,95735,95707,95609,95325,93008,92669,95606,95278,95206,94220,94196,93808,93729,93623,93016,93014,100192,99150,99127,98991,98348,95226,95217,93732,93536,92124)
# and ibr.check_type = 2 # 质检类型 1.延保 2.轻改 3.权益
# and rci.car_model like '%%问界%%'
recording_start_time BETWEEN %s and %s
# ibr.id in ()
and ibr.check_type = 1 # 质检类型 1.延保 2.轻改 3.权益
and rci.car_model like '%%问界%%'
# and t4.customer_phone is null
# and t3.employee_name in ('包海霞','杨戎','郭虹','姚爽','肖遥','唐国燕','尚媛珍','夏瑞丽','丘景鹏','于文涛','周菲','史红','赵超','顾彩云','张祝君','董文旗','蒯燕婷','宋占强','赵思源','杨莉','郭虹','姚爽','彭海理','郑曼如','高昕','范达华','叶达恒','方超','余婉仪','史红','黄海潮','陈婷婷','赵超','罗依依','黄浩','王曦','杨冬琼','纪金涛')
# and t3.employee_name in ()
# and (recording_start_time like '%%2025-04%%' or recording_start_time like '%%2025-03%%')
# and t4.customer_phone is not null
group by ibr.id
ORDER BY t3.employee_name, ibr.recording_start_time DESC
) e
CROSS JOIN (SELECT @rank := 0, @current_employee := NULL) vars
...
...
@@ -284,4 +299,4 @@ ORDER BY t3.employee_name, ibr.recording_start_time DESC