Commit 85e72158 by jianan

4and5-保单发佣明细报表14

parent 440785ab
...@@ -453,13 +453,17 @@ ...@@ -453,13 +453,17 @@
sum(case when drop_option_code ='C01' then f.referral_amount else null end) '23' /*首年销售佣金*/, sum(case when drop_option_code ='C01' then f.referral_amount else null end) '23' /*首年销售佣金*/,
sum(case when drop_option_code ='C02' then f.referral_amount else null end) '24' /*续年销售佣金*/, sum(case when drop_option_code ='C02' then f.referral_amount else null end) '24' /*续年销售佣金*/,
if(f.commission_period!=1,l.mentor_id,'') '25' /*续期辅导人*/, (SELECT group_concat(t.practitioner_id) from ag_acl_customer_fortune t
if(f.commission_period!=1, where t.drop_option_code ='R03' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id
(SELECT group_concat(calculation_rate) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id), ) '25' /*续期辅导人*/,
'') '26' /*续期辅导奖金率*/, (SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
if(f.commission_period!=1, from ag_acl_customer_fortune t
(SELECT group_concat(referral_amount) from ag_acl_customer_fortune where order_id=f.order_id and drop_option_code ='C06' and practitioner_id = l.mentor_id), where t.drop_option_code ='R03' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id
'') '27' /*续期辅导奖*/, ) '26' /*续期辅导奖金率*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
where t.drop_option_code ='R03' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id
) '27' /*续期辅导奖*/,
sum(case when drop_option_code ='C04' then f.calculation_rate else null end) '28' /*'经纪人月销售加码奖金%'*/, sum(case when drop_option_code ='C04' then f.calculation_rate else null end) '28' /*'经纪人月销售加码奖金%'*/,
sum(case when drop_option_code ='C04' then f.referral_amount else null end) '29' /*经纪人月销售加码奖金*/, sum(case when drop_option_code ='C04' then f.referral_amount else null end) '29' /*经纪人月销售加码奖金*/,
...@@ -607,13 +611,13 @@ ...@@ -607,13 +611,13 @@
sum(case when drop_option_code ='S01' then f.referral_amount else null end) '67' /*S01-首年度销售佣金*/, sum(case when drop_option_code ='S01' then f.referral_amount else null end) '67' /*S01-首年度销售佣金*/,
sum(case when drop_option_code ='S03' then f.referral_amount else null end) '68' /*S03-首年度辅导奖金*/, sum(case when drop_option_code ='S03' then f.referral_amount else null end) '68' /*S03-首年度辅导奖金*/,
sum(case when drop_option_code ='R01' then f.referral_amount else null end) '69' /*R01-首年度直接销售佣金(旧)*/, sum(case when drop_option_code ='C95' then f.referral_amount else null end) '69' /*R01-首年度直接销售佣金(旧)*/,
sum(case when drop_option_code ='R02' then f.referral_amount else null end) '70' /*R02-续年度直接销售拥金(旧)*/, sum(case when drop_option_code ='R02' then f.referral_amount else null end) '70' /*R02-续年度直接销售拥金(旧)*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, calculation_rate)) (SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t from ag_acl_customer_fortune t
where t.drop_option_code ='R03' and order_id=f.order_id and t.practitioner_id=l.mentor_id where t.drop_option_code ='R03' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id
) '71' /*R03-续年度辅导佣金(旧)*/, ) '71' /*R03-续年度辅导佣金(旧)*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, calculation_rate)) (SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t from ag_acl_customer_fortune t
where t.drop_option_code ='R04' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id where t.drop_option_code ='R04' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id
) '72' /*R04-续年度绩效奖金(旧)*/, ) '72' /*R04-续年度绩效奖金(旧)*/,
......
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