Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
8425a250
Commit
8425a250
authored
Dec 31, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发佣检核25-发佣检核根据保单号查询不显示手工数据
parent
14b0eeca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
70 deletions
+72
-70
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
+72
-70
No files found.
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
View file @
8425a250
...
@@ -82,8 +82,8 @@
...
@@ -82,8 +82,8 @@
t.predict_month_period predictMonthPeriod,
t.predict_month_period predictMonthPeriod,
op.drop_option_name commissionPayoutStatus,
op.drop_option_name commissionPayoutStatus,
pb.payout_yearmonth monthPeriod
pb.payout_yearmonth monthPeriod
FROM ag_acl_customer_fortune t
FROM ag_acl_customer_fortune t
LEFT JOIN ag_po_order o ON o.id = t.order_id
LEFT JOIN ag_po_order o ON o.id = t.order_id
LEFT JOIN ag_product p ON p.id = o.product_id
LEFT JOIN ag_product p ON p.id = o.product_id
LEFT JOIN ag_product_plan pp ON pp.id = o.plan_id
LEFT JOIN ag_product_plan pp ON pp.id = o.plan_id
LEFT JOIN ag_po_order_commission oc ON oc.order_id = t.order_id AND oc.id = t.commission_id
LEFT JOIN ag_po_order_commission oc ON oc.order_id = t.order_id AND oc.id = t.commission_id
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
LEFT JOIN ag_acl_practitioner_setting setting ON setting.practitioner_id = pra.id
LEFT JOIN ag_acl_practitioner_setting setting ON setting.practitioner_id = pra.id
LEFT JOIN ag_acl_customer_fortune_payout_batch pb ON pb.id = t.payout_batch_id
LEFT JOIN ag_acl_customer_fortune_payout_batch pb ON pb.id = t.payout_batch_id
LEFT JOIN ag_md_drop_options op ON op.drop_option_code = t.status
LEFT JOIN ag_md_drop_options op ON op.drop_option_code = t.status
LEFT JOIN ag_md_drop_master mas ON mas.id = op.drop_master_id
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_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_md_drop_master mas1 ON mas1.id = op1.drop_master_id
WHERE t.settlement_type = '1'
WHERE t.settlement_type = '1'
...
@@ -142,68 +142,70 @@
...
@@ -142,68 +142,70 @@
<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>
UNION ALL
<if
test=
"item.policyNo == null"
>
SELECT '' orderId,t.id fortuneId,'' commissionPayoutYearmonth,'' insurerName,'' productName,
UNION ALL
'' policyNo,
SELECT '' orderId,t.id fortuneId,'' commissionPayoutYearmonth,'' insurerName,'' productName,
'' paymentTermUnit,
'' policyNo,
'' coverTermType,
'' paymentTermUnit,
'0.00' orderPrice,
'' coverTermType,
pra.name practitionerName,
'0.00' orderPrice,
dept.name insurerBranchDeptName,
pra.name practitionerName,
sub.name subordinateSystemName,
dept.name insurerBranchDeptName,
<!-- t.practitioner_level practitionerLevel, -->
sub.name subordinateSystemName,
op1.drop_option_name practitionerLevel,
<!-- t.practitioner_level practitionerLevel, -->
t.commission_amount commissionAmount,
op1.drop_option_name practitionerLevel,
t.commission_type commissionType,
t.commission_amount commissionAmount,
t.referral_rate referralRate,
t.commission_type commissionType,
t.referral_amount referralAmount,
t.referral_rate referralRate,
t.predict_month_period predictMonthPeriod,
t.referral_amount referralAmount,
op.drop_option_name commissionPayoutStatus,
t.predict_month_period predictMonthPeriod,
pb.payout_yearmonth monthPeriod
op.drop_option_name commissionPayoutStatus,
FROM ag_acl_customer_fortune t
pb.payout_yearmonth monthPeriod
LEFT JOIN ag_acl_practitioner pra ON pra.id = t.practitioner_id
FROM ag_acl_customer_fortune t
LEFT JOIN ag_acl_insurer_branch_dept dept ON pra.dept_id = dept.id
LEFT JOIN ag_acl_practitioner pra ON pra.id = t.practitioner_id
LEFT JOIN ag_acl_practitioner_subordinate_system sub ON sub.id = pra.subordinate_system_id
LEFT JOIN ag_acl_insurer_branch_dept dept ON pra.dept_id = dept.id
LEFT JOIN ag_acl_practitioner_setting setting ON setting.practitioner_id = pra.id
LEFT JOIN ag_acl_practitioner_subordinate_system sub ON sub.id = pra.subordinate_system_id
LEFT JOIN ag_acl_customer_fortune_payout_batch pb ON pb.id = t.payout_batch_id
LEFT JOIN ag_acl_practitioner_setting setting ON setting.practitioner_id = pra.id
LEFT JOIN ag_md_drop_options op ON op.drop_option_code = t.status
LEFT JOIN ag_acl_customer_fortune_payout_batch pb ON pb.id = t.payout_batch_id
LEFT JOIN ag_md_drop_master mas ON mas.id = op.drop_master_id
LEFT JOIN ag_md_drop_options op ON op.drop_option_code = t.status
LEFT JOIN ag_md_drop_options op1 ON op1.id = setting.practitioner_level
LEFT JOIN ag_md_drop_master mas ON mas.id = op.drop_master_id
LEFT JOIN ag_md_drop_master mas1 ON mas1.id = op1.drop_master_id
LEFT JOIN ag_md_drop_options op1 ON op1.id = setting.practitioner_level
WHERE t.settlement_type = '2'
LEFT JOIN ag_md_drop_master mas1 ON mas1.id = op1.drop_master_id
AND mas.drop_code = 'Fortune_Payout_Status'
WHERE t.settlement_type = '2'
AND mas1.scenario_code = 'practitioner_level'
AND mas.drop_code = 'Fortune_Payout_Status'
and setting.practitioner_type_id = 28
AND mas1.scenario_code = 'practitioner_level'
<if
test=
"item.insurerBranchId != null"
>
and setting.practitioner_type_id = 28
and pra.insurer_branch_id = #{item.insurerBranchId,jdbcType=BIGINT}
<if
test=
"item.insurerBranchId != null"
>
</if>
and pra.insurer_branch_id = #{item.insurerBranchId,jdbcType=BIGINT}
<if
test=
"item.insurerBranchDeptId != null"
>
</if>
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
<if
test=
"item.insurerBranchDeptId != null"
>
</if>
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
<!-- <if test="item.subordinateSystemId != null">
</if>
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
<!-- <if test="item.subordinateSystemId != null">
</if>-->
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
<if
test=
"item.subsystemIdList != null and item.subsystemIdList.size() > 0"
>
</if>-->
and sub.id in
<if
test=
"item.subsystemIdList != null and item.subsystemIdList.size() > 0"
>
<foreach
collection=
"item.subsystemIdList"
index=
"index"
item=
"subordinateSystemId"
open=
"("
separator=
","
close=
")"
>
and sub.id in
#{subordinateSystemId}
<foreach
collection=
"item.subsystemIdList"
index=
"index"
item=
"subordinateSystemId"
open=
"("
separator=
","
close=
")"
>
</foreach>
#{subordinateSystemId}
</if>
</foreach>
<if
test=
"item.practitionerId != null"
>
</if>
and pra.id = #{item.practitionerId,jdbcType=BIGINT}
<if
test=
"item.practitionerId != null"
>
</if>
and pra.id = #{item.practitionerId,jdbcType=BIGINT}
<if
test=
"item.commissionPayoutStatus != null"
>
</if>
and t.status = #{item.commissionPayoutStatus,jdbcType=BIGINT}
<if
test=
"item.commissionPayoutStatus != null"
>
</if>
and t.status = #{item.commissionPayoutStatus,jdbcType=BIGINT}
<!-- <if test="item.commissionPayoutYearmonth != null"> -->
</if>
<!-- and c.check_yearmonth = #{item.commissionPayoutYearmonth,jdbcType=VARCHAR} -->
<!-- <if test="item.commissionPayoutYearmonth != null"> -->
<!-- </if> -->
<!-- and c.check_yearmonth = #{item.commissionPayoutYearmonth,jdbcType=VARCHAR} -->
<if
test=
"item.predictMonthPeriod != null"
>
<!-- </if> -->
and DATE_FORMAT(t.predict_month_period, '%Y-%m') = #{item.predictMonthPeriod,jdbcType=VARCHAR}
<if
test=
"item.predictMonthPeriod != null"
>
</if>
and DATE_FORMAT(t.predict_month_period, '%Y-%m') = #{item.predictMonthPeriod,jdbcType=VARCHAR}
<if
test=
"item.payoutYearmonth != null"
>
</if>
and pb.payout_yearmonth = #{item.payoutYearmonth,jdbcType=VARCHAR}
<if
test=
"item.payoutYearmonth != null"
>
</if>
and pb.payout_yearmonth = #{item.payoutYearmonth,jdbcType=VARCHAR}
</if>
</if>
</select>
</select>
<select
id=
"fortunePayToOrder"
resultType=
"com.yd.dal.entity.agms.fortune.FortunePayToOrderInfo"
>
<select
id=
"fortunePayToOrder"
resultType=
"com.yd.dal.entity.agms.fortune.FortunePayToOrderInfo"
>
...
@@ -354,11 +356,11 @@
...
@@ -354,11 +356,11 @@
i.name insurerName,
i.name insurerName,
p.name productName,
p.name productName,
pp.name planName,
pp.name planName,
o.effective_start_date
effectiveStartDate,
if(o.effective_start_date is not null,left(o.effective_start_date,10),o.effective_start_date)
effectiveStartDate,
o.policy_no policyNo,
o.policy_no policyNo,
f.order_price
orderPrice,
if(f.order_price is null,0,f.order_price)
orderPrice,
f.fyc_amount
fycAmount,
if(f.fyc_amount is null,0,f.fyc_amount)
fycAmount,
f.grade_commission_rate
gradeCommissionRate,
if(f.grade_commission_rate is null,0,f.grade_commission_rate)
gradeCommissionRate,
(select s.name from ag_acl_practitioner_subordinate_system s where s.id = pra.subordinate_system_id) subordinateSystemName,
(select s.name from ag_acl_practitioner_subordinate_system s where s.id = pra.subordinate_system_id) subordinateSystemName,
pra.name practitionerName,
pra.name practitionerName,
if(f.commission_rate is null,0,f.commission_rate) commissionRate,
if(f.commission_rate is null,0,f.commission_rate) commissionRate,
...
@@ -367,7 +369,7 @@
...
@@ -367,7 +369,7 @@
f.drop_option_code dropOptionCode,
f.drop_option_code dropOptionCode,
f.remark remark,
f.remark remark,
f.commission_type commissionType,
f.commission_type commissionType,
f.referral_amount
referralAmount,
if(f.referral_amount is null,0,f.referral_amount)
referralAmount,
f.calculation_formula calculationFormula,
f.calculation_formula calculationFormula,
f.withdrawed_id withdrawId
f.withdrawed_id withdrawId
from ag_acl_customer_fortune f
from ag_acl_customer_fortune f
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment