1
0

WxOrderGrab.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.emato.ccnet.wx.dao.mapper.wx.WxOrderGrabMapper" >
  4. <resultMap id="wxOrderDate" type="com.emato.ccnet.wx.dao.entity.wx.WxOrderDate" >
  5. <result column="merch_order_sn" property="merchOrderId" jdbcType="VARCHAR" />
  6. <result column="order_sn" property="orderSn" jdbcType="VARCHAR" />
  7. <result column="id" property="wxOrderId" jdbcType="VARCHAR" />
  8. <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
  9. <result column="merch_name" property="merchName" jdbcType="VARCHAR" />
  10. <result column="third_party_merch_code" property="thirdPartyMerchCode" jdbcType="VARCHAR" />
  11. <result column="third_party_merch_name" property="thirdPartyMerchName" jdbcType="VARCHAR" />
  12. <result column="store_number" property="shopId" jdbcType="VARCHAR" />
  13. <result column="add_time" property="placeOrderlTime" jdbcType="TIMESTAMP" />
  14. <result column="user_id" property="buyerRegNo" jdbcType="VARCHAR" />
  15. <result column="buyer_bill_time" property="buyerBillTime" jdbcType="TIMESTAMP" />
  16. <result column="id_no" property="buyerIdCode" jdbcType="VARCHAR" />
  17. <result column="username" property="buyerName" jdbcType="VARCHAR" />
  18. <result column="buyer_tel" property="buyerTel" jdbcType="VARCHAR" />
  19. <result column="id_no" property="consigneeIdCode" jdbcType="VARCHAR" />
  20. <result column="consignee" property="consigneeName" jdbcType="VARCHAR" />
  21. <result column="mobile" property="consigneeMob" jdbcType="VARCHAR" />
  22. <result column="province" property="consigneeProvince" jdbcType="VARCHAR" />
  23. <result column="city" property="consigneeCity" jdbcType="VARCHAR" />
  24. <result column="district" property="consigneeDistrict" jdbcType="VARCHAR" />
  25. <result column="address" property="consigneeAddress" jdbcType="VARCHAR" />
  26. <result column="pay_name" property="payerName" jdbcType="VARCHAR" />
  27. <result column="id_no" property="payerIdCode" jdbcType="VARCHAR" />
  28. <result column="pay_mobile" property="payerMob" jdbcType="VARCHAR" />
  29. <result column="pay_transaction_id" property="payNo" jdbcType="VARCHAR" />
  30. <result column="actual_price" property="acturalPaid" jdbcType="DECIMAL" />
  31. <result column="pay_time" property="payTime" jdbcType="TIMESTAMP" />
  32. <result column="order_biz_type" property="wsFlag" jdbcType="CHAR" />
  33. <result column="buyer_pay_check" property="buyerPayCheck" jdbcType="CHAR" />
  34. <result column="expr_agreement_type" property="exprAgreementType" />
  35. <result column="coupon_price" property="couponPrice" />
  36. <result column="full_cut_price" property="fullCutPrice" />
  37. </resultMap>
  38. <resultMap id="wxOrderGoodsDate" type="com.emato.ccnet.wx.dao.entity.wx.WxOrderGoodsDate" >
  39. <result column="order_id" property="wxOrderId" jdbcType="VARCHAR" />
  40. <result column="sku" property="itemNo" jdbcType="VARCHAR" />
  41. <result column="goods_name" property="itemName" jdbcType="VARCHAR" />
  42. <result column="prod_barcode" property="barCode" jdbcType="VARCHAR" />
  43. <result column="unit_code" property="unit" jdbcType="VARCHAR" />
  44. <result column="number" property="qty" jdbcType="DECIMAL" />
  45. <result column="settle_price" property="totalPrice" jdbcType="DECIMAL" />
  46. <result column="ori_cnt_code" property="country" jdbcType="VARCHAR" />
  47. <result column="cus_rec_code" property="ciqGno" jdbcType="VARCHAR" />
  48. <result column="cus_goods_code" property="gcode" jdbcType="VARCHAR" />
  49. <result column="cus_decl_ele" property="gmodel" jdbcType="VARCHAR" />
  50. <result column="ciq_prod_model" property="ciqGmodel" jdbcType="VARCHAR" />
  51. <result column="goods_rate" property="taxTotal" jdbcType="VARCHAR" />
  52. <result column="brand" property="brand" jdbcType="VARCHAR" />
  53. </resultMap>
  54. <!-- 获取运单数据-->
  55. <select id="getWxOrderDate" parameterType="hashMap" resultMap="wxOrderDate">
  56. SELECT mo.merch_order_sn,mo.order_sn,mo.id,ms.merch_sn,ms.merch_name, ms.store_number,ms.third_party_merch_code,ms.third_party_merch_name,mo.store_id,mo.add_time,mo.user_id,mo.add_time AS buyer_bill_time,mu.id_no,mu.username,
  57. mu.mobile AS buyer_tel,mo.consignee,mo.mobile,mo.province,mo.city,mo.district,mo.address,mo.pay_name,mo.pay_mobile,mo.pay_transaction_id,mo.actual_price,
  58. mo.pay_time,mo.order_biz_type, mo.buyer_pay_check,ms.expr_agreement_type,mo.coupon_price,mo.full_cut_price
  59. FROM mall_order mo
  60. LEFT OUTER JOIN mall_user mu ON mo.user_id = mu.id
  61. LEFT OUTER JOIN mall_store ms ON mo.store_id = ms.id
  62. <where>
  63. mo.order_biz_type in ('00','02','10') and mo.order_status = '201' and mo.is_scan = 0
  64. </where>
  65. ORDER BY mo.id limit #{number}
  66. </select>
  67. <!--商品详情-->
  68. <select id="getWxOrderGoodsDate" parameterType="java.lang.String" resultMap="wxOrderGoodsDate">
  69. SELECT mog.order_id,mog.sku,mog.goods_name,mog.number,mog.settle_price, mg.goods_desc,
  70. mg.prod_barcode,mg.unit_code, mg.ori_cnt_code,mg.cus_rec_code,mg.cus_goods_code,
  71. mg.cus_decl_ele,mg.ciq_prod_model,mg.goods_rate, mg.brand
  72. FROM mall_order_goods mog
  73. LEFT OUTER JOIN mall_goods mg ON mog.goods_id = mg.id
  74. WHERE
  75. mog.order_id in
  76. <foreach collection="list" item="orderId" index="index" open="(" close=")" separator="," >
  77. #{orderId}
  78. </foreach>
  79. ORDER BY mog.id
  80. </select>
  81. <update id="updateIsScanBatch" parameterType="List">
  82. UPDATE mall_order
  83. <trim prefix="set" suffixOverrides=",">
  84. <trim prefix="is_scan =case" suffix="end,">
  85. <foreach collection="list" item="i" index="idx">
  86. <if test="i.isScan !=null and i.isScan !=''">
  87. when id=#{i.orderId} then #{i.isScan}
  88. </if>
  89. </foreach>
  90. </trim>
  91. </trim>
  92. <where>
  93. <if test="list != null and list.size()>0">
  94. <foreach collection="list" item="i" index="index" separator="or" >
  95. id=#{i.orderId}
  96. </foreach>
  97. </if>
  98. </where>
  99. </update>
  100. <update id="updateMallOrderProcessRecord" parameterType="hashMap">
  101. update mall_order_process_record
  102. <set >
  103. <if test="paymentStartTime != null">
  104. payment_start_time = #{paymentStartTime},
  105. </if>
  106. <if test="paymentSuccTime != null">
  107. payment_succ_time = #{paymentSuccTime}, </if>
  108. <if test="isPaymentSend != null" >
  109. is_payment_send = #{isPaymentSend,jdbcType=VARCHAR},
  110. </if>
  111. <if test="eleOrderStartTime != null" >
  112. ele_order_start_time = #{eleOrderStartTime,jdbcType=VARCHAR},
  113. </if>
  114. <if test="eleOrderSuccTime != null" >
  115. ele_order_succ_time = #{eleOrderSuccTime,jdbcType=VARCHAR},
  116. </if>
  117. <if test="isEleOrderSend != null" >
  118. is_ele_order_send = #{isEleOrderSend,jdbcType=VARCHAR},
  119. </if>
  120. <if test="waybillStartTime != null" >
  121. waybill_start_time = #{waybillStartTime,jdbcType=VARCHAR},
  122. </if>
  123. <if test="waybillSuccTime != null" >
  124. waybill_succ_time = #{waybillSuccTime,jdbcType=VARCHAR},
  125. </if>
  126. <if test="customsStartTime != null" >
  127. customs_start_time = #{customsStartTime,jdbcType=VARCHAR},
  128. </if>
  129. <if test="customsSuccTime != null" >
  130. customs_succ_time = #{customsSuccTime,jdbcType=VARCHAR},
  131. </if>
  132. <if test="isCustomsSend != null" >
  133. is_customs_send = #{isCustomsSend,jdbcType=TIMESTAMP},
  134. </if>
  135. <if test="shipmentStartTime != null" >
  136. shipment_start_time = #{shipmentStartTime,jdbcType=VARCHAR},
  137. </if>
  138. <if test="shipmentSuccTime != null" >
  139. shipment_succ_time = #{shipmentSuccTime,jdbcType=VARCHAR},
  140. </if>
  141. <if test="logisticsNo != null">
  142. logistics_no = #{logisticsNo},
  143. </if>
  144. <if test="invtNo != null">
  145. invt_no = #{invtNo},
  146. </if>
  147. </set>
  148. where order_sn = #{orderSn,jdbcType=VARCHAR}
  149. </update>
  150. <update id="updateBuyerPayCheck" parameterType="hashMap">
  151. update mall_order
  152. <set >
  153. <if test="buyerPayCheck != null">
  154. buyer_pay_check = #{buyerPayCheck},
  155. </if>
  156. <if test="orderStatus != null">
  157. order_status = #{orderStatus},
  158. </if>
  159. <if test="shippingNo != null">
  160. shipping_no = #{shippingNo},
  161. </if>
  162. <if test="shippingCode != null">
  163. shipping_code = #{shippingCode},
  164. </if>
  165. <if test="shippingName != null">
  166. shipping_name = #{shippingName},
  167. </if>
  168. <if test="shippingStatus != null">
  169. shipping_status = #{shippingStatus},
  170. </if>
  171. </set>
  172. where order_sn = #{orderSn,jdbcType=VARCHAR}
  173. </update>
  174. </mapper>