|
@@ -3292,10 +3292,20 @@
|
|
|
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>
|
|
|
- <if test="userId !=null and userId !=''">
|
|
|
|
|
- iac.leader_id =#{userId}
|
|
|
|
|
|
|
+ <if test="vo.userId !=null and vo.userId !=''">
|
|
|
|
|
+ iac.leader_id =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
|
|
+ AND io.userid IN
|
|
|
|
|
+ <foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
|
|
+
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getDistributionAllAmount" resultType="java.util.HashMap">
|
|
<select id="getDistributionAllAmount" resultType="java.util.HashMap">
|
|
@@ -3305,8 +3315,17 @@
|
|
|
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>
|
|
|
- <if test="userId !=null and userId !=''">
|
|
|
|
|
- ifon.first_level_user_id =#{userId}
|
|
|
|
|
|
|
+ <if test="vo.userId !=null and vo.userId !=''">
|
|
|
|
|
+ ifon.first_level_user_id =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
|
|
+ AND io.userid IN
|
|
|
|
|
+ <foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
group by ifon.first_level_user_id
|
|
group by ifon.first_level_user_id
|
|
@@ -3318,10 +3337,20 @@
|
|
|
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>
|
|
|
- <if test="userId !=null and userId !=''">
|
|
|
|
|
- ifon.two_level_user_id =#{userId}
|
|
|
|
|
|
|
+ <if test="vo.userId !=null and vo.userId !=''">
|
|
|
|
|
+ ifon.two_level_user_id =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
|
|
+ AND io.userid IN
|
|
|
|
|
+ <foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
|
|
+
|
|
|
group by ifon.two_level_user_id
|
|
group by ifon.two_level_user_id
|
|
|
) b on b.twoLevelUserId =ifon.first_level_user_id
|
|
) b on b.twoLevelUserId =ifon.first_level_user_id
|
|
|
left join (
|
|
left join (
|
|
@@ -3332,8 +3361,17 @@
|
|
|
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>
|
|
|
- <if test="userId !=null and userId !=''">
|
|
|
|
|
- ifon.three_level_user_id =#{userId}
|
|
|
|
|
|
|
+ <if test="vo.userId !=null and vo.userId !=''">
|
|
|
|
|
+ ifon.three_level_user_id =#{vo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.ids != null and vo.ids.size()>0 ">
|
|
|
|
|
+ AND io.userid IN
|
|
|
|
|
+ <foreach item="item" collection="vo.ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
|
|
|
+ AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
group by ifon.three_level_user_id
|
|
group by ifon.three_level_user_id
|