...
|
...
|
@@ -86,25 +86,19 @@ |
|
|
limit #{billsTradeReq.start},#{billsTradeReq.size}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTransferOutTradeNoByOrderCodes" resultType="com.yoho.order.model.TradeBillsTransferOutTradeNo">
|
|
|
<select id="selectTransferOutTradeNoByIds" resultType="com.yoho.order.model.TradeBillsTransferOutTradeNo">
|
|
|
SELECT tb.id,
|
|
|
CASE t.interface_type
|
|
|
WHEN 2 THEN concat(t.id, '_', IF(tb.deal_relate_id != 0,tb.deal_relate_id,tb.id))
|
|
|
WHEN 3 THEN '钱包'
|
|
|
END AS outTradeNo,
|
|
|
tb.order_code AS orderCode
|
|
|
END AS outTradeNo
|
|
|
FROM ufo_order.trade_bills tb
|
|
|
LEFT JOIN ufo_order.orders_pay_transfer t ON t.buyer_order_code = tb.order_code
|
|
|
WHERE tb.income_outcome = 1 AND tb.deal_status != 1
|
|
|
<!-- 转账单 -->
|
|
|
AND (
|
|
|
tb.trade_type = 3 <!-- 补偿款 -->
|
|
|
OR (tb.user_type =2 AND tb.trade_type = 2) <!-- 卖家货款 -->
|
|
|
OR (tb.user_type =2 AND tb.trade_type = 4) <!-- 卖家返利 -->
|
|
|
)
|
|
|
AND tb.order_code IN
|
|
|
<foreach collection="orderCodes" item="orderCode" open="(" close=")" separator=",">
|
|
|
#{orderCode}
|
|
|
<!-- 程序保障是转账单 id -->
|
|
|
AND tb.id IN
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
...
|
...
|
|