|
|
@@ -1089,8 +1089,9 @@
|
|
|
left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
|
|
|
left join ( select sum(transaction_amount) as amount , order_no from t_order_bill_new group by order_no ) b on b.order_no = o.order_no
|
|
|
left join ( select order_no, max(name) as name from outsource_organization group by order_no) e on o.order_no = e.order_no
|
|
|
-left join ( select x.order_no, y.maxTime, x.transaction_amount from t_order_bill_new x inner join ( select order_no, max(create_time) maxTime
|
|
|
- from t_order_bill_new group by order_no)y on x.order_no = y.order_no and x.create_time = y.maxTime) f on o.order_no = f.order_no
|
|
|
+left join (select x.order_no, max(y.maxTime) maxTime, max(x.transaction_amount)transaction_amount
|
|
|
+ from t_order_bill_new x left join (select order_no, max(create_time) maxTime from t_order_bill_new group by order_no)y on
|
|
|
+ x.order_no = y.order_no and x.create_time = y.maxTime group by x.order_no) f on o.order_no = f.order_no
|
|
|
left join ( select order_no , sum(amount) invoiceAmount from t_order_invoice where status = 2 group by order_no ) g on o.order_no = g.order_no
|
|
|
where delete_sign != 1 and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
|
@@ -1138,27 +1139,28 @@ where delete_sign != 1 and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
- where delete_sign != 1 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
- <if test="o.processStatus == 3">
|
|
|
- and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ where delete_sign != 1 and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
+ <if test="o.processStatus == 3">
|
|
|
+ and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.processStatus == 4">
|
|
|
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ and o.process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
and (approval = 0 or approval = 2)
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
- <if test="o.orderStatus != null and o.orderStatus != """>
|
|
|
+ <if test="o.orderStatus != null and o.orderStatus != """>
|
|
|
and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test="o.departmentId != null and o.departmentId != """>
|
|
|
+ <if test="o.departmentId != null and o.departmentId != """>
|
|
|
and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.contractNo != null and o.contractNo != """>
|
|
|
- and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
|
|
|
- </if>
|
|
|
- <if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
- and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
|
|
|
+ and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
+ and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
+
|
|
|
<if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|