|
@@ -129,6 +129,10 @@
|
|
|
, t_order.remark
|
|
, t_order.remark
|
|
|
, t_order_detail.orderDetailId
|
|
, t_order_detail.orderDetailId
|
|
|
, t_order_detail.orderDetailStatus
|
|
, t_order_detail.orderDetailStatus
|
|
|
|
|
+ , t_order_detail.prodId
|
|
|
|
|
+ , t_order_detail.prodName
|
|
|
|
|
+ , t_order_detail.prodAttrId
|
|
|
|
|
+ , t_order_detail.prodAttrName
|
|
|
, t_order_detail.vendorId
|
|
, t_order_detail.vendorId
|
|
|
, t_order_detail.quantity
|
|
, t_order_detail.quantity
|
|
|
, t_order_detail.afterSalesQty
|
|
, t_order_detail.afterSalesQty
|
|
@@ -138,12 +142,6 @@
|
|
|
, t_order_detail.payAmount
|
|
, t_order_detail.payAmount
|
|
|
, t_order_detail.confirmTime
|
|
, t_order_detail.confirmTime
|
|
|
, t_order_detail.finishTime
|
|
, t_order_detail.finishTime
|
|
|
- , t_order_delivery.orderDeliveryId
|
|
|
|
|
- , t_order_delivery.orderDeliveryStatus
|
|
|
|
|
- , t_order_delivery.prodId
|
|
|
|
|
- , t_order_delivery.prodName
|
|
|
|
|
- , t_order_delivery.prodAttrId
|
|
|
|
|
- , t_order_delivery.prodAttrName
|
|
|
|
|
, m_merchant.mercName as sellerName
|
|
, m_merchant.mercName as sellerName
|
|
|
, m_merchant.mobile as sellerMobile
|
|
, m_merchant.mobile as sellerMobile
|
|
|
, sys_user.user_name as buyerName
|
|
, sys_user.user_name as buyerName
|
|
@@ -156,8 +154,85 @@
|
|
|
and m_merchant_prod.prodAttrId = t_order_detail.prodAttrId
|
|
and m_merchant_prod.prodAttrId = t_order_detail.prodAttrId
|
|
|
inner join m_prod on m_prod.id = t_order_detail.prodId
|
|
inner join m_prod on m_prod.id = t_order_detail.prodId
|
|
|
inner join m_prod_class on m_prod_class.prodClassId = m_prod.prodClassId
|
|
inner join m_prod_class on m_prod_class.prodClassId = m_prod.prodClassId
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="orderId != null "> and t_order.orderId = #{orderId}</if>
|
|
|
|
|
+ <if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
|
|
|
|
|
+ <if test="orderDetailStatus != null and orderDetailStatus != ''"> and t_order_detail.orderDetailStatus = #{orderDetailStatus}</if>
|
|
|
|
|
+ <if test="recProv != null and recProv != ''"> and t_order.recProv like concat('%', #{recProv}, '%')</if>
|
|
|
|
|
+ <if test="recCity != null and recCity != ''"> and t_order.recCity like concat('%', #{recCity}, '%')</if>
|
|
|
|
|
+ <if test="recDistrict != null and recDistrict != ''"> and t_order.recDistrict like concat('%', #{recDistrict}, '%')</if>
|
|
|
|
|
+ <if test="recName != null and recName != ''"> and t_order.recName like concat('%', #{recName}, '%')</if>
|
|
|
|
|
+ <if test="recMobile != null and recMobile != ''"> and t_order.recMobile like concat('%', #{recMobile}, '%')</if>
|
|
|
|
|
+ <if test="params.orderTimeFrom != null and params.orderTimeFrom != ''"><!-- 开始时间检索 -->
|
|
|
|
|
+ and date_format(t_order.orderTime,'%y%m%d') >= date_format(#{params.orderTimeFrom},'%y%m%d')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="params.orderTimeTo != null and params.orderTimeTo != ''"><!-- 结束时间检索 -->
|
|
|
|
|
+ and date_format(t_order.orderTime,'%y%m%d') <= date_format(#{params.orderTimeTo},'%y%m%d')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="params.cancelTimeFrom != null and params.cancelTimeFrom != ''"><!-- 开始时间检索 -->
|
|
|
|
|
+ and date_format(t_order.cancelTime,'%y%m%d') >= date_format(#{params.cancelTimeFrom},'%y%m%d')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="params.cancelTimeTo != null and params.cancelTimeTo != ''"><!-- 结束时间检索 -->
|
|
|
|
|
+ and date_format(t_order.cancelTime,'%y%m%d') <= date_format(#{params.cancelTimeTo},'%y%m%d')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="buyerName != null and buyerName != ''"> and sys_user.user_name like concat('%', #{buyerName}, '%')</if>
|
|
|
|
|
+ <if test="sellerName != null and sellerName != ''"> and m_merchant.mercName like concat('%', #{sellerName}, '%')</if>
|
|
|
|
|
+ <if test="prodName != null and prodName != '' "> and t_order_delivery.prodName like concat('%', #{prodName}, '%')</if>
|
|
|
|
|
+ <if test="expressNo != null and expressNo != '' ">
|
|
|
|
|
+ and exists(select t_order_detail.orderDetailid from t_order_detail
|
|
|
|
|
+ inner join t_order_delivery on t_order_delivery.orderDetailId = t_order_detail.orderDetailId and t_order_delivery.orderId = t_order_detail.orderId
|
|
|
|
|
+ inner join t_order_delivery_expr on t_order_delivery_expr.orderDetailId = t_order_detail.orderDetailId and t_order_delivery_expr.orderDeliveryId = t_order_delivery.orderDeliveryId
|
|
|
|
|
+ where t_order.orderid = t_order_detail.orderid
|
|
|
|
|
+ and t_order_delivery_expr.expressNo like concat('%', #{expressNo}, '%')
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ and t_order.delFlag = '0'
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by t_order.orderTime, t_order.orderId, t_order_detail.orderDetailId
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="exportVendorOrderVoList" parameterType="OrderVo" resultMap="VendorOrderDetailVoResult">
|
|
|
|
|
+ select t_order.orderId
|
|
|
|
|
+ , t_order.orderNo
|
|
|
|
|
+ , t_order.orderTime
|
|
|
|
|
+ , t_order.recProv
|
|
|
|
|
+ , t_order.recCity
|
|
|
|
|
+ , t_order.recDistrict
|
|
|
|
|
+ , t_order.recAddress
|
|
|
|
|
+ , t_order.recName
|
|
|
|
|
+ , t_order.recMobile
|
|
|
|
|
+ , t_order.remark
|
|
|
|
|
+ , t_order_detail.orderDetailId
|
|
|
|
|
+ , t_order_detail.orderDetailStatus
|
|
|
|
|
+ , t_order_detail.prodId
|
|
|
|
|
+ , t_order_detail.prodName
|
|
|
|
|
+ , t_order_detail.vendorId
|
|
|
|
|
+ , t_order_detail.quantity
|
|
|
|
|
+ , t_order_detail.afterSalesQty
|
|
|
|
|
+ , t_order_detail.refundQty
|
|
|
|
|
+ , t_order_detail.price
|
|
|
|
|
+ , t_order_detail.orderAmount
|
|
|
|
|
+ , t_order_detail.payAmount
|
|
|
|
|
+ , t_order_detail.confirmTime
|
|
|
|
|
+ , t_order_detail.finishTime
|
|
|
|
|
+ , t_order_delivery.orderDeliveryId
|
|
|
|
|
+ , t_order_delivery.orderDeliveryStatus
|
|
|
|
|
+ , t_order_delivery.prodAttrId
|
|
|
|
|
+ , t_order_delivery.prodAttrName
|
|
|
|
|
+ , m_merchant.mercName as sellerName
|
|
|
|
|
+ , m_merchant.mobile as sellerMobile
|
|
|
|
|
+ , sys_user.user_name as buyerName
|
|
|
|
|
+ , m_prod_class.className as className
|
|
|
|
|
+ from t_order
|
|
|
|
|
+ inner join m_merchant on m_merchant.mercId = t_order.sellerId
|
|
|
|
|
+ inner join sys_user on sys_user.user_id = t_order.buyerId
|
|
|
|
|
+ inner join t_order_detail on t_order_detail.orderId = t_order.orderId and t_order_detail.delFlag = '0'
|
|
|
|
|
+ inner join m_merchant_prod on m_merchant_prod.mercId = t_order.sellerId and m_merchant_prod.prodId = t_order_detail.prodId
|
|
|
|
|
+ and m_merchant_prod.prodAttrId = t_order_detail.prodAttrId
|
|
|
|
|
+ inner join m_prod on m_prod.id = t_order_detail.prodId
|
|
|
|
|
+ inner join m_prod_class on m_prod_class.prodClassId = m_prod.prodClassId
|
|
|
inner join t_order_delivery on t_order_delivery.orderDetailId = t_order_detail.orderDetailId and t_order_delivery.orderId = t_order_delivery.orderId
|
|
inner join t_order_delivery on t_order_delivery.orderDetailId = t_order_detail.orderDetailId and t_order_delivery.orderId = t_order_delivery.orderId
|
|
|
- and t_order_delivery.delFlag = '0'
|
|
|
|
|
|
|
+ and t_order_delivery.delFlag = '0'
|
|
|
<where>
|
|
<where>
|
|
|
<if test="orderId != null "> and t_order.orderId = #{orderId}</if>
|
|
<if test="orderId != null "> and t_order.orderId = #{orderId}</if>
|
|
|
<if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
|
|
<if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
|
|
@@ -190,10 +265,10 @@
|
|
|
and t_order_delivery_expr.expressNo like concat('%', #{expressNo}, '%')
|
|
and t_order_delivery_expr.expressNo like concat('%', #{expressNo}, '%')
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="selectedOrderDeliveryIds != null and selectedOrderDeliveryIds != '' ">
|
|
|
|
|
- and t_order_delivery.orderDeliveryId in
|
|
|
|
|
- <foreach collection="orderDeliveryIds" item="deliveryId" open="(" separator="," close=")">
|
|
|
|
|
- #{deliveryId}
|
|
|
|
|
|
|
+ <if test="selectedOrderDetailIds != null and selectedOrderDetailIds != '' ">
|
|
|
|
|
+ and t_order_delivery.orderDetailId in
|
|
|
|
|
+ <foreach collection="orderDetailIds" item="orderDetailId" open="(" separator="," close=")">
|
|
|
|
|
+ #{orderDetailId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
and t_order.delFlag = '0'
|
|
and t_order.delFlag = '0'
|