Commit 34a0f389 by wenyang Committed by jianan

渠道规则开发2(发佣关账查询)

parent c7458086
...@@ -44,4 +44,6 @@ public class WithdrawQueryInfo { ...@@ -44,4 +44,6 @@ public class WithdrawQueryInfo {
*/ */
List<Long> subsystemIdList; List<Long> subsystemIdList;
private String channelType;
} }
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
select distinct pay.id payId, select distinct pay.id payId,
pay.withdraw_id withdrawId, pay.withdraw_id withdrawId,
pb.payout_yearmonth payoutYearmonth, pb.payout_yearmonth payoutYearmonth,
pra.name practitionerName, ifnull(pra.name,cha.name) practitionerName,
pay.withdraw_amount referralAmount, pay.withdraw_amount referralAmount,
pra.mobile_no mobileNo, pra.mobile_no mobileNo,
opt.drop_option_name practitionerLevel, opt.drop_option_name practitionerLevel,
...@@ -294,19 +294,20 @@ ...@@ -294,19 +294,20 @@
salary.is_active isActive salary.is_active isActive
from ag_acl_customer_fortune_pay pay from ag_acl_customer_fortune_pay pay
inner join ag_acl_customer_fortune f on f.fortune_payed_id = pay.id inner join ag_acl_customer_fortune f on f.fortune_payed_id = pay.id
<!-- inner JOIN ag_po_order o on o.id = f.order_id -->
inner join ag_acl_customer_fortune_payout_batch pb on pb.id = f.payout_batch_id inner join ag_acl_customer_fortune_payout_batch pb on pb.id = f.payout_batch_id
inner JOIN ag_acl_practitioner pra on pay.customer_id = pra.customer_id left join ag_acl_practitioner pra on pay.customer_id = pra.customer_id
LEFT JOIN ag_acl_insurer_branch ib on ib.id = pra.insurer_branch_id left join ag_acl_insurer_branch ib on ib.id = pra.insurer_branch_id
LEFT JOIN ag_acl_insurer_branch_dept dept ON pra.dept_id = dept.id left join ag_acl_insurer_branch_dept dept ON pra.dept_id = dept.id
LEFT JOIN ag_acl_practitioner_subordinate_system sub ON sub.id = pra.subordinate_system_id left join ag_acl_practitioner_subordinate_system sub ON sub.id = pra.subordinate_system_id
inner join ag_acl_practitioner_setting setting on pra.id = setting.practitioner_id left join ag_acl_practitioner_setting setting on pra.id = setting.practitioner_id
left join ag_md_drop_options opt on opt.id = setting.practitioner_level left join ag_md_drop_options opt on opt.id = setting.practitioner_level
left join ag_acl_life_practitioner_salary salary on salary.practitioner_id=pra.id and salary.`year_month`=REPLACE (pb.payout_yearmonth, '-', '') left join ag_acl_life_practitioner_salary salary on salary.practitioner_id=pra.id and salary.`year_month`=REPLACE (pb.payout_yearmonth, '-', '')
left join ag_acl_channel_new cha ON cha.customer_id = f.customer_id
where where
setting.practitioner_type_id = 28 (setting.practitioner_type_id=28 or f.settlement_type='3')
<!-- and pay.withdraw_amount != 0 --> <if test="item.channelType != null">
and f.channel_type = #{item.channelType,jdbcType=VARCHAR}
</if>
<if test="item.payoutYearmonth != null"> <if test="item.payoutYearmonth != null">
and pb.payout_yearmonth = #{item.payoutYearmonth,jdbcType=VARCHAR} and pb.payout_yearmonth = #{item.payoutYearmonth,jdbcType=VARCHAR}
</if> </if>
...@@ -316,9 +317,6 @@ ...@@ -316,9 +317,6 @@
<if test="item.insurerBranchDeptId != null"> <if test="item.insurerBranchDeptId != null">
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT} and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
</if> </if>
<!-- <if test="item.subordinateSystemId != null">
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
</if>-->
<if test="item.subsystemIdList != null and item.subsystemIdList.size() > 0"> <if test="item.subsystemIdList != null and item.subsystemIdList.size() > 0">
and sub.id in and sub.id in
<foreach collection="item.subsystemIdList" index="index" item="subordinateSystemId" open="(" separator="," close=")"> <foreach collection="item.subsystemIdList" index="index" item="subordinateSystemId" open="(" separator="," close=")">
......
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