|
|
@@ -822,8 +822,10 @@
|
|
|
|
|
|
<!-- 查看所有待财务管理员分配的订单数据 -->
|
|
|
<select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
+ select * from (
|
|
|
select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
+ ,liquidation_status
|
|
|
from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
@@ -832,7 +834,6 @@
|
|
|
<if test="o.processStatus != null">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- or (approval = 2 and finance_id is null and delete_sign = 0)
|
|
|
<if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -848,30 +849,80 @@
|
|
|
<bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ union
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
+ ,liquidation_status
|
|
|
+ from t_order_new o
|
|
|
+ left join `user` u on o.buyer_id = u.id
|
|
|
+ left join admin a on o.salesman_id = a.id
|
|
|
+ where delete_sign = 0 and approval = 2 and finance_id is null
|
|
|
+ <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+)oo
|
|
|
<if test="ob == 1">
|
|
|
- order by o.sign_time desc
|
|
|
+ order by oo.signTime desc
|
|
|
</if>
|
|
|
<if test="ob == 2">
|
|
|
- order by o.liquidation_status,o.sign_time desc
|
|
|
+ order by oo.liquidation_status,oo.signTime desc
|
|
|
</if>
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
|
|
|
- select count(*) from t_order_new o
|
|
|
+ select count(*) from (
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
+ ,liquidation_status
|
|
|
+ from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
where delete_sign = 0
|
|
|
and order_status = 2
|
|
|
<if test="o.processStatus != null">
|
|
|
- and process_status = #{o.processStatus,jdbcType=VARCHAR}
|
|
|
+ and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- or (approval = 2 and finance_id is null and delete_sign = 0)
|
|
|
<if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='financeId != null and financeId != ""'>
|
|
|
+ <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ union
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
+ ,liquidation_status
|
|
|
+ from t_order_new o
|
|
|
+ left join `user` u on o.buyer_id = u.id
|
|
|
+ left join admin a on o.salesman_id = a.id
|
|
|
+ where delete_sign = 0 and approval = 2 and finance_id is null
|
|
|
+ <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.financeId != null and o.financeId != ""'>
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
@@ -883,6 +934,7 @@
|
|
|
<bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+)oo
|
|
|
</select>
|
|
|
<!-- 查看某订单状态是否符合要求 -->
|
|
|
<select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
|