|
|
@@ -3294,10 +3294,10 @@
|
|
|
|
|
|
<select id="getExpectNetProfit" resultType="com.ydtech.modules.order.entity.InsAreaCompany">
|
|
|
select
|
|
|
- IFNULL(ifon.jq_costs_premiums,0) + IFNULL(ifon.sy_costs_premiums,0) + IFNULL (ifon.no_costs_premiums,0) as "entranceAllFee",
|
|
|
- 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",
|
|
|
- IFNULL(b.distributionAmount,0) as "distributionAmount"
|
|
|
+ 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"
|
|
|
from ins_area_company iac
|
|
|
left join ins_orders io on io.orderno = iac.orderno
|
|
|
LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
@@ -3316,7 +3316,7 @@
|
|
|
ifon.first_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
- AND io.userid IN
|
|
|
+ AND ifon.first_level_user_id IN
|
|
|
<foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
@@ -3339,7 +3339,7 @@
|
|
|
ifon.two_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
- AND io.userid IN
|
|
|
+ AND ifon.two_level_user_id IN
|
|
|
<foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
@@ -3363,7 +3363,7 @@
|
|
|
ifon.three_level_user_id =#{vo.userId}
|
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
- AND io.userid IN
|
|
|
+ AND ifon.three_level_user_id IN
|
|
|
<foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
@@ -3377,7 +3377,7 @@
|
|
|
) b on b.firstLevelUserId =iac.leader_id
|
|
|
<where>
|
|
|
<if test="vo.userId !=null and vo.userId !=''">
|
|
|
- iac.leader_id =#{vo.userId}
|
|
|
+ io.userid =#{vo.userId}
|
|
|
</if>
|
|
|
<if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
AND io.userid IN
|
|
|
@@ -3467,4 +3467,16 @@
|
|
|
) c on c.threeLevelUserId = a.firstLevelUserId
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findListByDate" resultType="com.ydtech.modules.order.entity.InsAreaCompany">
|
|
|
+ SELECT
|
|
|
+ iac.*
|
|
|
+ FROM ins_area_company as iac
|
|
|
+ <where>
|
|
|
+ iac.orderstatus = 3
|
|
|
+ <if test="benginDate != null and benginDate!='' and endDate != null and endDate!=''">
|
|
|
+ AND iac.createtime BETWEEN #{benginDate} AND #{endDate}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by iac.createtime
|
|
|
+ </select>
|
|
|
</mapper>
|