|
@@ -3310,10 +3310,10 @@
|
|
|
|
|
|
|
|
<select id="getExpectNetProfit" resultType="com.ydtech.modules.order.entity.InsAreaCompany">
|
|
<select id="getExpectNetProfit" resultType="com.ydtech.modules.order.entity.InsAreaCompany">
|
|
|
select
|
|
select
|
|
|
- sum(IFNULL(ifon.jq_costs_premiums,0) + IFNULL(ifon.sy_costs_premiums,0) + IFNULL (ifon.no_costs_premiums,0)) as "entranceAllFee",
|
|
|
|
|
- sum(IFNULL(jq_export_other_costs_premiums,0) + IFNULL(jq_export_supervise_costs_premiums,0) +IFNULL(sy_export_other_costs_premiums,0) +IFNULL(sy_export_supervise_costs_premiums,0)
|
|
|
|
|
- +IFNULL(no_export_supervise_costs_premiums,0)+IFNULL(no_export_supervise_costs_premiums,0) ) as "exportAllFee",
|
|
|
|
|
- sum(IFNULL(b.distributionAmount,0)) as "distributionAmount"
|
|
|
|
|
|
|
+ ROUND(sum(IFNULL(ifon.jq_costs_premiums,0) + IFNULL(ifon.sy_costs_premiums,0) + IFNULL (ifon.no_costs_premiums,0)),2) as "entranceAllFee",
|
|
|
|
|
+ ROUND(sum(IFNULL(jq_export_other_costs_premiums,0) + IFNULL(jq_export_supervise_costs_premiums,0) +IFNULL(sy_export_other_costs_premiums,0) +IFNULL(sy_export_supervise_costs_premiums,0)
|
|
|
|
|
+ +IFNULL(no_export_supervise_costs_premiums,0)+IFNULL(no_export_supervise_costs_premiums,0) ),2) as "exportAllFee",
|
|
|
|
|
+ ROUND(sum(IFNULL(b.distributionAmount,0)),2) as "distributionAmount"
|
|
|
from ins_area_company iac
|
|
from ins_area_company iac
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
@@ -3328,8 +3328,9 @@
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
|
- ifon.first_level_user_id =#{vo.userId}
|
|
|
|
|
|
|
+ AND ifon.first_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
AND ifon.first_level_user_id IN
|
|
AND ifon.first_level_user_id IN
|
|
@@ -3351,8 +3352,9 @@
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
|
- ifon.two_level_user_id =#{vo.userId}
|
|
|
|
|
|
|
+ AND ifon.two_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
AND ifon.two_level_user_id IN
|
|
AND ifon.two_level_user_id IN
|
|
@@ -3375,8 +3377,9 @@
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
|
- ifon.three_level_user_id =#{vo.userId}
|
|
|
|
|
|
|
+ AND ifon.three_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
AND ifon.three_level_user_id IN
|
|
AND ifon.three_level_user_id IN
|
|
@@ -3392,8 +3395,9 @@
|
|
|
) c on c.threeLevelUserId = a.firstLevelUserId
|
|
) c on c.threeLevelUserId = a.firstLevelUserId
|
|
|
) b on b.firstLevelUserId =iac.leader_id
|
|
) b on b.firstLevelUserId =iac.leader_id
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
|
- io.userid =#{vo.userId}
|
|
|
|
|
|
|
+ AND io.userid =#{vo.userId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
AND io.userid IN
|
|
AND io.userid IN
|