LEFT JOIN ag_md_drop_master mas ON mas.id = op.drop_master_id
LEFT JOIN ag_md_drop_options op1 ON op1.id = setting.practitioner_level
LEFT JOIN ag_md_drop_master mas1 ON mas1.id = op1.drop_master_id
<!-- LEFT JOIN ag_acl_channel_new cha ON cha.customer_id = t.customer_id -->
LEFT JOIN ag_acl_channel_new cha ON cha.id = t.channel_id
LEFT JOIN (select distinct poc.order_id,poc.commission_period,c.* FROM ag_po_order_commission poc,ag_po_order_commission_check c
WHERE poc.commission_check_id=c.id AND poc.commission_status='2' AND poc.commission_type='1'
...
...
@@ -69,7 +68,7 @@
GROUP BY poc.order_id,poc.commission_period
</if>
) c ON c.order_id=t.order_id AND c.commission_period=t.commission_period
WHERE ((t.settlement_type='1' and setting.practitioner_type_id=28 and mas1.scenario_code='practitioner_level' ) or t.settlement_type='3')
WHERE ((t.settlement_type='1' and setting.practitioner_type_id=28 and mas1.scenario_code='practitioner_level' ) or (t.settlement_type='3' and t.order_id is not null))
and mas.drop_code = 'Fortune_Payout_Status'
and EXISTS(select 1 from ag_po_order_commission poc
where poc.commission_status='2' and poc.commission_type='1'
...
...
@@ -152,9 +151,8 @@
LEFT JOIN ag_md_drop_master mas ON mas.id = op.drop_master_id
LEFT JOIN ag_md_drop_options op1 ON op1.id = setting.practitioner_level
LEFT JOIN ag_md_drop_master mas1 ON mas1.id = op1.drop_master_id
<!-- LEFT JOIN ag_acl_channel_new cha ON cha.customer_id = t.customer_id -->
LEFT JOIN ag_acl_channel_new cha ON cha.id = t.channel_id
WHERE ((t.settlement_type='2' and mas1.scenario_code='practitioner_level' and setting.practitioner_type_id=28) or t.settlement_type='3')
WHERE ((t.settlement_type='2' and mas1.scenario_code='practitioner_level' and setting.practitioner_type_id=28) or (t.settlement_type='3' and t.order_id is null))
AND mas.drop_code = 'Fortune_Payout_Status'
<iftest="item.insurerBranchId != null">
and pra.insurer_branch_id = #{item.insurerBranchId,jdbcType=BIGINT}