Commit 34a0f389 by wenyang Committed by jianan

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

parent c7458086
......@@ -43,5 +43,7 @@ public class WithdrawQueryInfo {
* 体系子集id
*/
List<Long> subsystemIdList;
private String channelType;
}
......@@ -278,7 +278,7 @@
select distinct pay.id payId,
pay.withdraw_id withdrawId,
pb.payout_yearmonth payoutYearmonth,
pra.name practitionerName,
ifnull(pra.name,cha.name) practitionerName,
pay.withdraw_amount referralAmount,
pra.mobile_no mobileNo,
opt.drop_option_name practitionerLevel,
......@@ -294,19 +294,20 @@
salary.is_active isActive
from ag_acl_customer_fortune_pay pay
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_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_dept dept ON pra.dept_id = dept.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 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_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_setting setting on pra.id = setting.practitioner_id
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_channel_new cha ON cha.customer_id = f.customer_id
where
setting.practitioner_type_id = 28
<!-- and pay.withdraw_amount != 0 -->
(setting.practitioner_type_id=28 or f.settlement_type='3')
<if test="item.channelType != null">
and f.channel_type = #{item.channelType,jdbcType=VARCHAR}
</if>
<if test="item.payoutYearmonth != null">
and pb.payout_yearmonth = #{item.payoutYearmonth,jdbcType=VARCHAR}
</if>
......@@ -316,9 +317,6 @@
<if test="item.insurerBranchDeptId != null">
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
</if>
<!-- <if test="item.subordinateSystemId != null">
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
</if>-->
<if test="item.subsystemIdList != null and item.subsystemIdList.size() > 0">
and sub.id in
<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