OrderDao.xml 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118
  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.kmall.admin.dao.OrderDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.kmall.admin.entity.OrderEntity" id="orderMap">
  6. <result property="id" column="id"/>
  7. <result property="merchOrderSn" column="merch_order_sn"/>
  8. <result property="orderSn" column="order_sn"/>
  9. <result property="userId" column="user_id"/>
  10. <result property="orderStatus" column="order_status"/>
  11. <result property="shippingStatus" column="shipping_status"/>
  12. <result property="payStatus" column="pay_status"/>
  13. <result property="consignee" column="consignee"/>
  14. <result property="country" column="country"/>
  15. <result property="province" column="province"/>
  16. <result property="city" column="city"/>
  17. <result property="district" column="district"/>
  18. <result property="address" column="address"/>
  19. <result property="mobile" column="mobile"/>
  20. <result property="postscript" column="postscript"/>
  21. <result property="shippingId" column="shipping_id"/>
  22. <result property="shippingName" column="shipping_name"/>
  23. <result property="shippingCode" column="shipping_code"/>
  24. <result property="shippingNo" column="shipping_no"/>
  25. <result property="payId" column="pay_id"/>
  26. <result property="payName" column="pay_name"/>
  27. <result property="payMobile" column="pay_mobile"/>
  28. <result property="shippingFee" column="shipping_fee"/>
  29. <result property="actualPrice" column="actual_price"/>
  30. <result property="integral" column="integral"/>
  31. <result property="integralMoney" column="integral_money"/>
  32. <result property="orderPrice" column="order_price"/>
  33. <result property="goodsPrice" column="goods_price"/>
  34. <result property="addTime" column="add_time"/>
  35. <result property="confirmTime" column="confirm_time"/>
  36. <result property="payTime" column="pay_time"/>
  37. <result property="freightPrice" column="freight_price"/>
  38. <result property="couponId" column="coupon_id"/>
  39. <result property="couponPrice" column="coupon_price"/>
  40. <result property="callbackStatus" column="callback_status"/>
  41. <result property="orderType" column="order_type"/>
  42. <result property="storeId" column="store_id"/>
  43. <result property="userName" column="username"/>
  44. <result property="orderType" column="order_type"/>
  45. <result property="activityId" column="activity_id"/>
  46. <result property="deliveryDate" column="delivery_date"/>
  47. <result property="deliveryRemark" column="delivery_remark"/>
  48. <result property="predictTime" column="predict_time"/>
  49. <result property="orderBizType" column="order_biz_type"/>
  50. <result property="isPaymentSend" column="is_payment_send"/>
  51. <result property="isEleOrderSend" column="is_ele_order_send"/>
  52. <result property="isCustomsSend" column="is_customs_send"/>
  53. <result property="payFlag" column="pay_flag"/>
  54. <result column="buyer_pay_check" property="buyerPayCheck"/>
  55. <result property="merchSn" column="merch_sn"/>
  56. <result property="sku" column="sku"/>
  57. <result property="createTime" column="create_time"/>
  58. <result property="modTime" column="mod_time"/>
  59. <result property="isOnfflineOrder" column="is_onffline_order"/>
  60. <result property="orderSnWx" column="order_sn_wx"/>
  61. <result property="isMergePay" column="is_merge_pay"/>
  62. <result property="payTransactionId" column="pay_transaction_id"/>
  63. <result property="storeName" column="store_name"/>
  64. <result property="moderSn" column="moder_sn"/>
  65. <result property="unitCode" column="unit_code"/>
  66. <result property="ciqProdModel" column="ciq_prod_model"/>
  67. <result property="oriCntCode" column="ori_cnt_code"/>
  68. <result property="brand" column="brand"/>
  69. <result column="gross_weight" property="grossWeight" />
  70. <result column="net_weight" property="netWeight" />
  71. <result property="fullCutPrice" column="full_cut_price"/>
  72. <result property="campMinusId" column="camp_minus_id"/>
  73. <result property="campName" column="camp_name"/>
  74. <result property="pickUpCodeSn" column="pick_up_code_sn"/>
  75. <result property="pickUpCodeStatus" column="pick_up_code_status"/>
  76. <result property="pickUpCodeSn" column="pick_up_code_sn"/>
  77. </resultMap>
  78. <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
  79. select o.*,u.username as username
  80. from mall_order o
  81. left join mall_user u on o.user_id = u.id
  82. where o.id = #{value}
  83. </select>
  84. <select id="queryObjectBySysUser" resultType="com.kmall.admin.entity.OrderEntity">
  85. select o.*,u.username as username
  86. from mall_order o
  87. left join sys_user u on o.user_id = u.user_id
  88. where o.id = #{value}
  89. </select>
  90. <select id="queryObjectByActivityId" resultType="com.kmall.admin.entity.OrderEntity">
  91. select o.*,u.username as username
  92. from mall_order o
  93. left join mall_user u on o.user_id = u.id
  94. where o.activity_id = #{activityId}
  95. </select>
  96. <select id="getTotalActualPrice" resultType="java.lang.Double">
  97. select sum(a.actual_price) 'totalActualPrice' from mall_order a where merch_order_sn = #{merchOrderSn}
  98. </select>
  99. <select id="queryObjectByMerchOrderSn" resultType="com.kmall.admin.entity.OrderEntity">
  100. select * from mall_order a where merch_order_sn = #{merchOrderSn}
  101. </select>
  102. <select id="queryObjectByOrderSn" resultType="com.kmall.admin.entity.OrderEntity">
  103. select o.*,c.pick_up_code_sn
  104. from mall_order o
  105. left join mall_pick_up_code c
  106. on c.order_sn = o.order_sn where o.order_sn = #{orderSn}
  107. </select>
  108. <select id="queryList" resultType="com.kmall.admin.entity.OrderEntity">
  109. SELECT DISTINCT
  110. o.order_sn,
  111. o.merch_order_sn,
  112. o.order_status,
  113. o.actual_price,
  114. o.order_biz_type,
  115. o.shipping_no,
  116. o.shipping_name,
  117. o.shipping_code,
  118. o.consignee,
  119. o.mobile,
  120. o.province,
  121. o.city,
  122. o.district,
  123. o.address,
  124. o.add_time,
  125. o.pay_id,
  126. o.pay_status,
  127. o.shipping_status,
  128. o.is_merge_pay,
  129. o.buyer_pay_check,
  130. o.order_price,
  131. o.moder_sn,
  132. o.id,
  133. u.username AS username,
  134. p.is_payment_send,
  135. p.is_ele_order_send,
  136. p.is_customs_send,
  137. s.store_name,
  138. o.full_cut_price,
  139. o.camp_minus_id,
  140. o.camp_name
  141. FROM
  142. mall_order o
  143. LEFT JOIN mall_user u ON o.user_id = u.id
  144. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  145. left join mall_store s on o.store_id = s.id
  146. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  147. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  148. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  149. AND r.goods_id = g.goods_id
  150. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  151. WHERE 1=1
  152. <if test="startTime != null and startTime != ''">
  153. AND o.add_time <![CDATA[ > ]]> #{startTime}
  154. </if>
  155. <if test="endTime != null and endTime != ''">
  156. AND o.add_time <![CDATA[ < ]]> #{endTime}
  157. </if>
  158. <if test="storeId != null and storeId != ''">
  159. AND o.store_id = #{storeId}
  160. </if>
  161. <if test="sku != null and sku.trim() != ''">
  162. AND gs.sku = #{sku}
  163. </if>
  164. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  165. AND gs.prod_barcode = #{prodBarcode}
  166. </if>
  167. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  168. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  169. </if>
  170. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  171. AND t.third_merch_sn = #{thirdMerchSn}
  172. </if>
  173. <if test="supplierThirdId != null and supplierThirdId != ''">
  174. AND r.supplier_third_id = #{supplierThirdId}
  175. </if>
  176. <if test="orderBizType != null and orderBizType != ''">
  177. AND o.order_biz_type = #{orderBizType}
  178. </if>
  179. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  180. AND o.merch_order_sn = #{merchOrderSn}
  181. </if>
  182. <if test="merchSn != null and merchSn.trim() != ''">
  183. AND o.merch_sn = #{merchSn}
  184. </if>
  185. <if test="orderSn != null and orderSn.trim() != ''">
  186. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  187. </if>
  188. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  189. AND o.shipping_status = #{shippingStatus}
  190. </if>
  191. <if test="payStatus != null and payStatus.trim() != ''">
  192. AND o.pay_status = #{payStatus}
  193. </if>
  194. <if test="orderStatus != null and orderStatus.trim() != ''">
  195. AND o.order_status = #{orderStatus}
  196. </if>
  197. <if test="shippingId != null and shippingId != 0">
  198. AND o.shipping_id = #{shippingId}
  199. </if>
  200. <if test="orderType != null and orderType.trim() != ''">
  201. AND o.order_type = #{orderType}
  202. </if>
  203. <if test="isOnfiilineOrder != null">
  204. AND o.is_onffline_order = #{isOnfiilineOrder}
  205. </if>
  206. <if test="ids != null and ids.trim() != ''">
  207. AND o.id in (${ids})
  208. </if>
  209. <choose>
  210. <when test="sidx != null and sidx.trim() != ''">
  211. order by ${sidx} ${order}
  212. </when>
  213. <otherwise>
  214. order by o.id desc
  215. </otherwise>
  216. </choose>
  217. <if test="offset != null and limit != null">
  218. limit #{offset}, #{limit}
  219. </if>
  220. </select>
  221. <select id="queryExportList" resultType="com.kmall.admin.entity.OrderEntity">
  222. SELECT
  223. o.order_sn,
  224. o.merch_order_sn,
  225. o.order_status,
  226. o.actual_price,
  227. o.order_biz_type,
  228. o.shipping_no,
  229. o.shipping_name,
  230. o.shipping_code,
  231. o.consignee,
  232. o.mobile,
  233. o.province,
  234. o.city,
  235. o.district,
  236. o.address,
  237. o.add_time,
  238. o.pay_id,
  239. o.shipping_status,
  240. o.shipping_fee,
  241. o.moder_sn,
  242. o.pay_transaction_id,
  243. u.id_no 'idNo',
  244. u.username AS username,
  245. p.is_payment_send,
  246. p.is_ele_order_send,
  247. p.is_customs_send,
  248. g.sku,
  249. g.goods_name,
  250. g.number,
  251. g.retail_price,
  252. s.store_name,
  253. nc.NAME ori_cnt_code,
  254. good.ciq_prod_model,
  255. good.brand,
  256. uc.NAME unit_code,
  257. good.gross_weight * g.number gross_weight,
  258. good.net_weight * g.number net_weight,
  259. t2.third_party_merch_name 'supplierThirdPartyMerchName',
  260. t2.third_party_merch_code 'supplierThirdPartyMerchCode'
  261. FROM
  262. mall_order o
  263. LEFT JOIN mall_user u ON o.user_id = u.id
  264. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  265. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  266. LEFT JOIN mall_store s ON o.store_id = s.id
  267. LEFT JOIN mall_goods good ON good.id = g.goods_id
  268. LEFT JOIN sys_cus_nation_code nc ON nc.CODE = good.ori_cnt_code
  269. LEFT JOIN sys_cus_unit_code uc ON uc.CODE = good.unit_code
  270. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  271. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  272. AND r.goods_id = g.goods_id
  273. LEFT JOIN third_merchant_biz t2 ON t2.third_merch_sn = r.supplier_third_id
  274. WHERE
  275. 1 =1
  276. <if test="storeId != null and storeId != ''">
  277. AND o.store_id = #{storeId}
  278. </if>
  279. <if test="orderStatus != null and orderStatus.trim() != ''">
  280. AND o.order_status = #{orderStatus}
  281. </if>
  282. <if test="sku != null and sku.trim() != ''">
  283. AND g.sku = #{sku}
  284. </if>
  285. <if test="startTime != null and startTime != ''">
  286. AND o.add_time <![CDATA[ > ]]> #{startTime}
  287. </if>
  288. <if test="endTime != null and endTime != ''">
  289. AND o.add_time <![CDATA[ < ]]> #{endTime}
  290. </if>
  291. <if test="storeId != null and storeId != ''">
  292. AND o.store_id = #{storeId}
  293. </if>
  294. <if test="orderBizType != null and orderBizType != ''">
  295. AND o.order_biz_type = #{orderBizType}
  296. </if>
  297. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  298. AND o.merch_order_sn = #{merchOrderSn}
  299. </if>
  300. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  301. AND t.third_merch_sn = #{thirdMerchSn}
  302. </if>
  303. <if test="supplierThirdId != null and supplierThirdId != ''">
  304. AND r.supplier_third_id = #{supplierThirdId}
  305. </if>
  306. <if test="orderSn != null and orderSn.trim() != ''">
  307. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  308. </if>
  309. <if test="payStatus != null and payStatus.trim() != ''">
  310. AND o.pay_status = #{payStatus}
  311. </if>
  312. <if test="isOnfiilineOrder != null">
  313. AND o.is_onffline_order = #{isOnfiilineOrder}
  314. </if>
  315. </select>
  316. <select id="queryTotal" resultType="int">
  317. select count(DISTINCT o.id) FROM
  318. mall_order o
  319. LEFT JOIN mall_user u ON o.user_id = u.id
  320. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  321. left join mall_store s on o.store_id = s.id
  322. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  323. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  324. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  325. AND r.goods_id = g.goods_id
  326. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  327. WHERE 1=1
  328. <if test="startTime != null and startTime != ''">
  329. AND o.add_time <![CDATA[ > ]]> #{startTime}
  330. </if>
  331. <if test="endTime != null and endTime != ''">
  332. AND o.add_time <![CDATA[ < ]]> #{endTime}
  333. </if>
  334. <if test="storeId != null and storeId != ''">
  335. AND o.store_id = #{storeId}
  336. </if>
  337. <if test="sku != null and sku.trim() != ''">
  338. AND gs.sku = #{sku}
  339. </if>
  340. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  341. AND gs.prod_barcode = #{prodBarcode}
  342. </if>
  343. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  344. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  345. </if>
  346. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  347. AND t.third_merch_sn = #{thirdMerchSn}
  348. </if>
  349. <if test="supplierThirdId != null and supplierThirdId != ''">
  350. AND r.supplier_third_id = #{supplierThirdId}
  351. </if>
  352. <if test="orderBizType != null and orderBizType != ''">
  353. AND o.order_biz_type = #{orderBizType}
  354. </if>
  355. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  356. AND o.merch_order_sn = #{merchOrderSn}
  357. </if>
  358. <if test="merchSn != null and merchSn.trim() != ''">
  359. AND o.merch_sn = #{merchSn}
  360. </if>
  361. <if test="orderSn != null and orderSn.trim() != ''">
  362. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  363. </if>
  364. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  365. AND o.shipping_status = #{shippingStatus}
  366. </if>
  367. <if test="payStatus != null and payStatus.trim() != ''">
  368. AND o.pay_status = #{payStatus}
  369. </if>
  370. <if test="orderStatus != null and orderStatus.trim() != ''">
  371. AND o.order_status = #{orderStatus}
  372. </if>
  373. <if test="shippingId != null and shippingId != 0">
  374. AND o.shipping_id = #{shippingId}
  375. </if>
  376. <if test="orderType != null and orderType.trim() != ''">
  377. AND o.order_type = #{orderType}
  378. </if>
  379. <if test="isOnfiilineOrder != null">
  380. AND o.is_onffline_order = #{isOnfiilineOrder}
  381. </if>
  382. <if test="ids != null and ids.trim() != ''">
  383. AND o.id in (${ids})
  384. </if>
  385. </select>
  386. <select id="queryOffilineOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  387. SELECT distinct
  388. o.id,
  389. o.order_sn,
  390. u.username as userName,
  391. c.pick_up_code_sn,
  392. o.pay_name,
  393. o.mobile,
  394. o.is_onffline_order,
  395. o.order_biz_type,
  396. o.order_status,
  397. o.pay_status,
  398. o.coupon_name,
  399. o.coupon_price,
  400. o.actual_price,
  401. o.order_price,
  402. o.pay_time,
  403. o.pay_flag
  404. from mall_order o
  405. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  406. LEFT JOIN mall_sale_record record ON record.order_sn = o.order_sn
  407. LEFT JOIN sys_user u ON record.saller_id = u.user_id
  408. LEFT JOIN mall_pick_up_code c ON o.order_sn = c.order_sn
  409. WHERE 1=1
  410. <if test="storeId != null and storeId != ''">
  411. AND o.store_id = #{storeId}
  412. </if>
  413. <if test="merchSn != null and merchSn.trim() != ''">
  414. AND o.merch_sn = #{merchSn}
  415. </if>
  416. <if test="goodsSn != null and goodsSn.trim() != ''">
  417. AND gs.goods_sn = #{goodsSn}
  418. </if>
  419. <if test="sku != null and sku.trim() != ''">
  420. AND gs.sku = #{sku}
  421. </if>
  422. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  423. AND gs.prod_barcode = #{prodBarcode}
  424. </if>
  425. <if test="startTime != null and startTime != ''">
  426. AND o.add_time <![CDATA[ > ]]> #{startTime}
  427. </if>
  428. <if test="endTime != null and endTime != ''">
  429. AND o.add_time <![CDATA[ < ]]> #{endTime}
  430. </if>
  431. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  432. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  433. </if>
  434. <if test="orderSn != null and orderSn.trim() != ''">
  435. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  436. </if>
  437. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  438. AND o.shipping_status = #{shippingStatus}
  439. </if>
  440. <if test="payStatus != null and payStatus.trim() != ''">
  441. AND o.pay_status = #{payStatus}
  442. </if>
  443. <if test="orderStatus != null and orderStatus.trim() != ''">
  444. AND o.order_status = #{orderStatus}
  445. </if>
  446. <if test="shippingId != null and shippingId != 0">
  447. AND o.shipping_id = #{shippingId}
  448. </if>
  449. <if test="orderType != null and orderType.trim() != ''">
  450. AND o.order_type = #{orderType}
  451. </if>
  452. <if test="isOnfiilineOrder != null">
  453. AND o.is_onffline_order = #{isOnfiilineOrder}
  454. </if>
  455. <if test="ids != null and ids.trim() != ''">
  456. AND o.id in (${ids})
  457. </if>
  458. <choose>
  459. <when test="sidx != null and sidx.trim() != ''">
  460. order by ${sidx} ${order}
  461. </when>
  462. <otherwise>
  463. order by id desc
  464. </otherwise>
  465. </choose>
  466. <if test="offset != null and limit != null">
  467. limit #{offset}, #{limit}
  468. </if>
  469. </select>
  470. <select id="queryOffilineOrderTotal" resultType="int">
  471. select count(DISTINCT o.id) FROM
  472. mall_order o
  473. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  474. LEFT JOIN mall_sale_record record ON record.order_sn = o.order_sn
  475. LEFT JOIN sys_user u ON record.saller_id = u.user_id
  476. LEFT JOIN mall_pick_up_code c ON o.order_sn = c.order_sn
  477. WHERE 1=1
  478. <if test="storeId != null and storeId != ''">
  479. AND o.store_id = #{storeId}
  480. </if>
  481. <if test="merchSn != null and merchSn.trim() != ''">
  482. AND o.merch_sn = #{merchSn}
  483. </if>
  484. <if test="goodsSn != null and goodsSn.trim() != ''">
  485. AND gs.goods_sn = #{goodsSn}
  486. </if>
  487. <if test="sku != null and sku.trim() != ''">
  488. AND gs.sku = #{sku}
  489. </if>
  490. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  491. AND gs.prod_barcode = #{prodBarcode}
  492. </if>
  493. <if test="startTime != null and startTime != ''">
  494. AND o.add_time <![CDATA[ > ]]> #{startTime}
  495. </if>
  496. <if test="endTime != null and endTime != ''">
  497. AND o.add_time <![CDATA[ < ]]> #{endTime}
  498. </if>
  499. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  500. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  501. </if>
  502. <if test="orderSn != null and orderSn.trim() != ''">
  503. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  504. </if>
  505. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  506. AND o.shipping_status = #{shippingStatus}
  507. </if>
  508. <if test="payStatus != null and payStatus.trim() != ''">
  509. AND o.pay_status = #{payStatus}
  510. </if>
  511. <if test="orderStatus != null and orderStatus.trim() != ''">
  512. AND o.order_status = #{orderStatus}
  513. </if>
  514. <if test="shippingId != null and shippingId != 0">
  515. AND o.shipping_id = #{shippingId}
  516. </if>
  517. <if test="orderType != null and orderType.trim() != ''">
  518. AND o.order_type = #{orderType}
  519. </if>
  520. <if test="isOnfiilineOrder != null">
  521. AND o.is_onffline_order = #{isOnfiilineOrder}
  522. </if>
  523. <if test="ids != null and ids.trim() != ''">
  524. AND o.id in (${ids})
  525. </if>
  526. </select>
  527. <insert id="save" parameterType="com.kmall.api.entity.OrderVo" useGeneratedKeys="true" keyProperty="id">
  528. insert into mall_order
  529. (
  530. `order_sn`,
  531. `user_id`,
  532. `order_status`,
  533. `shipping_status`,
  534. `pay_status`,
  535. `consignee`,
  536. `country`,
  537. `province`,
  538. `city`,
  539. `district`,
  540. `address`,
  541. `mobile`,
  542. `postscript`,
  543. `shipping_id`,
  544. `shipping_name`,
  545. `shipping_code`,
  546. `shipping_no`,
  547. `pay_id`,
  548. `pay_name`,
  549. `shipping_fee`,
  550. `actual_price`,
  551. `integral`,
  552. `integral_money`,
  553. `order_price`,
  554. `goods_price`,
  555. `add_time`,
  556. `confirm_time`,
  557. `pay_time`,
  558. `freight_price`,
  559. `coupon_id`,
  560. `coupon_price`,
  561. full_cut_price,
  562. camp_minus_id,
  563. camp_name,
  564. `callback_status`,
  565. `order_type`,
  566. `store_id`,
  567. `order_biz_type`,
  568. `is_onffline_order`,
  569. `order_sn_wx`,
  570. `pay_flag`,
  571. `merch_sn`,
  572. `create_time`,
  573. `mod_time`
  574. )
  575. values
  576. (
  577. #{orderSn},
  578. #{userId},
  579. #{orderStatus},
  580. #{shippingStatus},
  581. #{payStatus},
  582. #{consignee},
  583. #{country},
  584. #{province},
  585. #{city},
  586. #{district},
  587. #{address},
  588. #{mobile},
  589. #{postscript},
  590. #{shippingId},
  591. #{shippingName},
  592. #{shippingCode},
  593. #{shippingNo},
  594. #{payId},
  595. #{payName},
  596. #{shippingFee},
  597. #{actualPrice},
  598. #{integral},
  599. #{integralMoney},
  600. #{orderPrice},
  601. #{goodsPrice},
  602. #{addTime},
  603. #{confirmTime},
  604. #{payTime},
  605. #{freightPrice},
  606. #{couponId},
  607. #{couponPrice},
  608. #{fullCutPrice},
  609. #{campMinusId},
  610. #{campName},
  611. #{callbackStatus},
  612. #{orderType},
  613. #{storeId},
  614. #{orderBizType},
  615. #{isOnfflineOrder},
  616. #{orderSnWx},
  617. #{payFlag},
  618. #{merchSn},
  619. #{createTime},
  620. #{modTime}
  621. )
  622. </insert>
  623. <insert id="saveOrderVo" parameterType="com.kmall.api.entity.OrderVo" useGeneratedKeys="true" keyProperty="id">
  624. insert into mall_order
  625. (
  626. `order_sn`,
  627. `user_id`,
  628. `order_status`,
  629. `shipping_status`,
  630. `shipping_code`,
  631. `pay_status`,
  632. `consignee`,
  633. `country`,
  634. `province`,
  635. `city`,
  636. `district`,
  637. `address`,
  638. `address_id`,
  639. `mobile`,
  640. `postscript`,
  641. `pay_id`,
  642. `pay_name`,
  643. `shipping_fee`,
  644. `actual_price`,
  645. `cash_fee`,
  646. `cash_fee_type`,
  647. `total_fee`,
  648. `fee_type`,
  649. `rate`,
  650. `integral`,
  651. `integral_money`,
  652. `order_price`,
  653. `goods_price`,
  654. `add_time`,
  655. `confirm_time`,
  656. `pay_time`,
  657. `freight_price`,
  658. `coupon_id`,
  659. `coupon_price`,
  660. `full_cut_price`,
  661. camp_minus_id,
  662. camp_name,
  663. `order_type`,
  664. `activity_id`,
  665. `store_id`,
  666. `delivery_date`,
  667. `delivery_remark`,
  668. `predict_time`,
  669. `coupon_name`,
  670. `comment_count`,
  671. <if test="merchSn != null" >
  672. merch_sn,
  673. </if>
  674. <if test="merchOrderSn != null" >
  675. merch_order_sn,
  676. </if>
  677. <if test="isScan != null" >
  678. is_scan,
  679. </if>
  680. <if test="isMergePay != null" >
  681. is_merge_pay,
  682. </if>
  683. <if test="orderBizType != null" >
  684. order_biz_type,
  685. </if>
  686. <if test="payTransactionId != null" >
  687. pay_transaction_id,
  688. </if>
  689. <if test="payMobile != null" >
  690. pay_mobile,
  691. </if>
  692. <if test="buyerPayCheck != null" >
  693. buyer_pay_check,
  694. </if>
  695. <if test="isOnfflineOrder != null" >
  696. `is_onffline_order`,
  697. </if>
  698. <if test="payFlag != null" >
  699. pay_flag,
  700. </if>
  701. <if test="createrSn != null" >
  702. creater_sn,
  703. </if>
  704. <if test="createTime != null" >
  705. create_time,
  706. </if>
  707. <if test="moderSn != null" >
  708. moder_sn,
  709. </if>
  710. <if test="modTime != null" >
  711. mod_time
  712. </if>
  713. )
  714. values
  715. (
  716. #{order_sn},
  717. #{user_id},
  718. #{order_status},
  719. #{shipping_status},
  720. #{shipping_code},
  721. #{pay_status},
  722. #{consignee},
  723. #{country},
  724. #{province},
  725. #{city},
  726. #{district},
  727. #{address},
  728. #{address_id},
  729. #{mobile},
  730. #{postscript},
  731. #{pay_id},
  732. #{pay_name},
  733. #{shipping_fee},
  734. #{actual_price},
  735. #{cashFee},
  736. #{cashFeeType},
  737. #{totalFee},
  738. #{feeType},
  739. #{rate},
  740. #{integral},
  741. #{integral_money},
  742. #{order_price},
  743. #{goods_price},
  744. now(),
  745. #{confirm_time},
  746. #{pay_time},
  747. #{freight_price},
  748. #{coupon_id},
  749. #{coupon_price},
  750. #{full_cut_price},
  751. #{campMinusId},
  752. #{campName},
  753. #{order_type},
  754. #{activity_id},
  755. #{store_id},
  756. #{delivery_date},
  757. #{delivery_remark},
  758. #{predict_time},
  759. #{coupon_name},
  760. #{comment_count},
  761. <if test="merchSn != null" >
  762. #{merchSn},
  763. </if>
  764. <if test="merchOrderSn != null" >
  765. #{merchOrderSn},
  766. </if>
  767. <if test="isScan != null" >
  768. #{isScan},
  769. </if>
  770. <if test="isMergePay != null" >
  771. #{isMergePay},
  772. </if>
  773. <if test="orderBizType != null" >
  774. #{orderBizType,jdbcType=CHAR},
  775. </if>
  776. <if test="payTransactionId != null" >
  777. #{payTransactionId},
  778. </if>
  779. <if test="payMobile != null" >
  780. #{payMobile},
  781. </if>
  782. <if test="buyerPayCheck != null" >
  783. #{buyerPayCheck},
  784. </if>
  785. <if test="isOnfflineOrder != null" >
  786. #{isOnfflineOrder},
  787. </if>
  788. <if test="payFlag != null" >
  789. #{payFlag},
  790. </if>
  791. <if test="createrSn != null" >
  792. #{createrSn},
  793. </if>
  794. <if test="createTime != null" >
  795. #{createTime},
  796. </if>
  797. <if test="moderSn != null" >
  798. #{moderSn},
  799. </if>
  800. <if test="modTime != null" >
  801. #{modTime}
  802. </if>
  803. )
  804. </insert>
  805. <update id="update" parameterType="com.kmall.admin.entity.OrderEntity">
  806. update mall_order
  807. <set>
  808. <if test="orderSn != null">`order_sn` = #{orderSn},</if>
  809. <if test="userId != null">`user_id` = #{userId},</if>
  810. <if test="orderStatus != null">`order_status` = #{orderStatus},</if>
  811. <if test="shippingStatus != null">`shipping_status` = #{shippingStatus},</if>
  812. <if test="payStatus != null">`pay_status` = #{payStatus},</if>
  813. <if test="consignee != null">`consignee` = #{consignee},</if>
  814. <if test="country != null">`country` = #{country},</if>
  815. <if test="province != null">`province` = #{province},</if>
  816. <if test="city != null">`city` = #{city},</if>
  817. <if test="district != null">`district` = #{district},</if>
  818. <if test="address != null">`address` = #{address},</if>
  819. <if test="mobile != null">`mobile` = #{mobile},</if>
  820. <if test="postscript != null">`postscript` = #{postscript},</if>
  821. <if test="shippingId != null">`shipping_id` = #{shippingId},</if>
  822. <if test="shippingName != null">`shipping_name` = #{shippingName},</if>
  823. <if test="shippingCode != null">`shipping_code` = #{shippingCode},</if>
  824. <if test="shippingNo != null">`shipping_no` = #{shippingNo},</if>
  825. <if test="payId != null">`pay_id` = #{payId},</if>
  826. <if test="payName != null">`pay_name` = #{payName},</if>
  827. <if test="shippingFee != null">`shipping_fee` = #{shippingFee},</if>
  828. <if test="actualPrice != null">`actual_price` = #{actualPrice},</if>
  829. <if test="integral != null">`integral` = #{integral},</if>
  830. <if test="integralMoney != null">`integral_money` = #{integralMoney},</if>
  831. <if test="orderPrice != null">`order_price` = #{orderPrice},</if>
  832. <if test="goodsPrice != null">`goods_price` = #{goodsPrice},</if>
  833. <if test="addTime != null">`add_time` = #{addTime},</if>
  834. <if test="confirmTime != null">`confirm_time` = #{confirmTime},</if>
  835. <if test="payTime != null">`pay_time` = #{payTime},</if>
  836. <if test="freightPrice != null">`freight_price` = #{freightPrice},</if>
  837. <if test="couponId != null">`coupon_id` = #{couponId},</if>
  838. <if test="couponPrice != null">`coupon_price` = #{couponPrice},</if>
  839. <if test="fullCutPrice != null">`full_cut_price` = #{fullCutPrice},</if>
  840. <if test="campMinusId != null">`camp_minus_id` = #{campMinusId},</if>
  841. <if test="campName != null">`camp_name` = #{campName},</if>
  842. <if test="callbackStatus != null">`callback_status` = #{callbackStatus},</if>
  843. <if test="AliTradeNo != null">`ali_trade_no` = #{AliTradeNo},</if>
  844. <if test="orderType != null">`order_type` = #{orderType},</if>
  845. <if test="storeId != null">`store_id` = #{storeId},</if>
  846. <if test="payFlag != null">`pay_flag` = #{payFlag},</if>
  847. <if test="orderSnWx != null">`order_sn_wx` = #{orderSnWx},</if>
  848. <if test="orderBizType != null">`order_biz_type` = #{orderBizType},</if>
  849. <if test="merchSn != null">`merch_sn` = #{merchSn},</if>
  850. <if test="createTime != null">`create_time` = #{createTime},</if>
  851. <if test="modTime != null">`mod_time` = #{modTime},</if>
  852. <if test="createrSn != null">`creater_sn` = #{createrSn},</if>
  853. <if test="moderSn != null">`moder_sn` = #{moderSn},</if>
  854. </set>
  855. where id = #{id}
  856. </update>
  857. <delete id="delete">
  858. delete from mall_order where id = #{value}
  859. </delete>
  860. <delete id="deleteBatch">
  861. delete from mall_order where id in
  862. <foreach item="id" collection="array" open="(" separator="," close=")">
  863. #{id}
  864. </foreach>
  865. </delete>
  866. <update id="riderOrderUpdate" parameterType="com.kmall.admin.entity.OrderEntity">
  867. update mall_order
  868. <set>
  869. `order_status` = #{orderStatus},
  870. `shipping_status` = #{shippingStatus},
  871. `shipping_id` = #{shippingId},
  872. `shipping_name` = #{shippingName},
  873. `shipping_fee` = #{shippingFee},
  874. `shipping_no` = #{shippingNo},
  875. `shipping_mobile` = #{shippingMobile}
  876. </set>
  877. where id = #{id}
  878. </update>
  879. <select id="getYfkOrderUserSum" resultType="int">
  880. select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
  881. inner join mall_merch_user mu on o.user_id=mu.user_id and o.merch_sn=mu.merch_sn and o.store_id=mu.store_id
  882. left join mall_store s on o.store_id = s.id
  883. where pay_status = 2
  884. <if test="storeId != null and storeId != ''">
  885. AND o.store_id = #{storeId}
  886. </if>
  887. <if test="merchSn != null and merchSn.trim() != ''">
  888. AND o.merch_sn = #{merchSn}
  889. </if>
  890. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  891. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  892. </if>
  893. group by o.user_id) u
  894. </select>
  895. <select id="getOderUserSum" resultType="int">
  896. select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
  897. inner join mall_merch_user mu on o.user_id=mu.user_id and o.merch_sn=mu.merch_sn and o.store_id=mu.store_id
  898. left join mall_store s on o.store_id = s.id
  899. where 1=1
  900. <if test="storeId != null and storeId != ''">
  901. AND o.store_id = #{storeId}
  902. </if>
  903. <if test="merchSn != null and merchSn.trim() != ''">
  904. AND o.merch_sn = #{merchSn}
  905. </if>
  906. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  907. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  908. </if>
  909. group by o.user_id) u
  910. </select>
  911. <select id="getTodayUserOrder" resultType="int">
  912. select count(1) from mall_order o
  913. left join mall_store s on o.store_id = s.id
  914. where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
  915. <if test="storeId != null and storeId != ''">
  916. AND o.store_id = #{storeId}
  917. </if>
  918. <if test="merchSn != null and merchSn.trim() != ''">
  919. AND o.merch_sn = #{merchSn}
  920. </if>
  921. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  922. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  923. </if>
  924. </select>
  925. <select id="getTodayUserSales" resultType="int">
  926. select ifnull(sum(o.actual_price),0) from mall_order o
  927. left join mall_store s on o.store_id = s.id where o.pay_status = 2 and o.pay_time > date_format(sysdate(), '%Y-%m-%d')
  928. <if test="storeId != null and storeId != ''">
  929. AND o.store_id = #{storeId}
  930. </if>
  931. <if test="merchSn != null and merchSn.trim() != ''">
  932. AND o.merch_sn = #{merchSn}
  933. </if>
  934. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  935. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  936. </if>
  937. </select>
  938. <select id="getIncomeSum" resultType="int">
  939. select ifnull(sum(actual_price),0) from mall_order o
  940. left join mall_store s on o.store_id = s.id where o.pay_status = 2
  941. <if test="storeId != null and storeId != ''">
  942. AND o.store_id = #{storeId}
  943. </if>
  944. <if test="merchSn != null and merchSn.trim() != ''">
  945. AND o.merch_sn = #{merchSn}
  946. </if>
  947. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  948. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  949. </if>
  950. </select>
  951. <select id="getPayedOrderCount" resultType="int">
  952. select count(1) from mall_order o
  953. left join mall_store s on o.store_id = s.id where o.pay_status = 2 and o.is_onffline_order = 0
  954. <if test="storeId != null and storeId != ''">
  955. AND o.store_id = #{storeId}
  956. </if>
  957. <if test="merchSn != null and merchSn.trim() != ''">
  958. AND o.merch_sn = #{merchSn}
  959. </if>
  960. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  961. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  962. </if>
  963. </select>
  964. <select id="promOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  965. SELECT
  966. s.prom_id,
  967. o.id,
  968. o.order_sn,
  969. o.merch_order_sn,
  970. o.actual_price,
  971. o.freight_price,
  972. o.activity_id,
  973. o.order_status,
  974. o.pay_status,
  975. store.store_name storeName,
  976. u.userName userName,
  977. o.buyer_pay_check,
  978. o.order_price,
  979. o.coupon_name couponName,
  980. o.add_time,
  981. o.shipping_status,
  982. (select count(1) from mall_order_goods where order_id = o.id) orderDetailCount,
  983. g.goods_id goodsId
  984. FROM
  985. mk_store_prom_stat s
  986. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  987. LEFT JOIN mall_order o ON r.order_id = o.id
  988. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  989. AND g.id = r.order_goods_id
  990. LEFT JOIN mall_store store ON o.store_id = store.id
  991. LEFT JOIN mall_user u ON o.user_id = u.id
  992. WHERE
  993. r.order_id IS NOT NULL
  994. <if test="promId != null and promId != ''">
  995. AND s.prom_id = #{promId}
  996. </if>
  997. <if test="startTime != null and startTime != ''">
  998. AND o.add_time <![CDATA[ > ]]> #{startTime}
  999. </if>
  1000. <if test="endTime != null and endTime != ''">
  1001. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1002. </if>
  1003. <if test="storeId != null and storeId != ''">
  1004. AND o.store_id = #{storeId}
  1005. </if>
  1006. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1007. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  1008. </if>
  1009. <if test="orderBizType != null and orderBizType != ''">
  1010. AND o.order_biz_type = #{orderBizType}
  1011. </if>
  1012. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1013. AND o.merch_order_sn = #{merchOrderSn}
  1014. </if>
  1015. <if test="merchSn != null and merchSn.trim() != ''">
  1016. AND o.merch_sn = #{merchSn}
  1017. </if>
  1018. <if test="orderSn != null and orderSn.trim() != ''">
  1019. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1020. </if>
  1021. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1022. AND o.shipping_status = #{shippingStatus}
  1023. </if>
  1024. <if test="payStatus != null and payStatus.trim() != ''">
  1025. AND o.pay_status = #{payStatus}
  1026. </if>
  1027. <if test="orderStatus != null and orderStatus.trim() != ''">
  1028. AND o.order_status = #{orderStatus}
  1029. </if>
  1030. <if test="shippingId != null and shippingId != 0">
  1031. AND o.shipping_id = #{shippingId}
  1032. </if>
  1033. <if test="orderType != null and orderType.trim() != ''">
  1034. AND o.order_type = #{orderType}
  1035. </if>
  1036. <if test="isOnfiilineOrder != null">
  1037. AND o.is_onffline_order = #{isOnfiilineOrder}
  1038. </if>
  1039. <choose>
  1040. <when test="sidx != null and sidx.trim() != ''">
  1041. order by ${sidx} ${order}
  1042. </when>
  1043. <otherwise>
  1044. order by o.id desc
  1045. </otherwise>
  1046. </choose>
  1047. <if test="offset != null and limit != null">
  1048. limit #{offset}, #{limit}
  1049. </if>
  1050. </select>
  1051. <select id="queryPromOrderTotal" resultType="int">
  1052. SELECT
  1053. count(*)
  1054. FROM
  1055. mk_store_prom_stat s
  1056. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  1057. LEFT JOIN mall_order o ON r.order_id = o.id
  1058. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1059. AND g.id = r.order_goods_id
  1060. LEFT JOIN mall_store store ON o.store_id = store.id
  1061. LEFT JOIN mall_user u ON o.user_id = u.id
  1062. WHERE
  1063. r.order_id IS NOT NULL
  1064. <if test="promId != null and promId != ''">
  1065. AND s.prom_id = #{promId}
  1066. </if>
  1067. <if test="startTime != null and startTime != ''">
  1068. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1069. </if>
  1070. <if test="endTime != null and endTime != ''">
  1071. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1072. </if>
  1073. <if test="storeId != null and storeId != ''">
  1074. AND o.store_id = #{storeId}
  1075. </if>
  1076. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1077. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  1078. </if>
  1079. <if test="orderBizType != null and orderBizType != ''">
  1080. AND o.order_biz_type = #{orderBizType}
  1081. </if>
  1082. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1083. AND o.merch_order_sn = #{merchOrderSn}
  1084. </if>
  1085. <if test="merchSn != null and merchSn.trim() != ''">
  1086. AND o.merch_sn = #{merchSn}
  1087. </if>
  1088. <if test="orderSn != null and orderSn.trim() != ''">
  1089. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1090. </if>
  1091. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1092. AND o.shipping_status = #{shippingStatus}
  1093. </if>
  1094. <if test="payStatus != null and payStatus.trim() != ''">
  1095. AND o.pay_status = #{payStatus}
  1096. </if>
  1097. <if test="orderStatus != null and orderStatus.trim() != ''">
  1098. AND o.order_status = #{orderStatus}
  1099. </if>
  1100. <if test="shippingId != null and shippingId != 0">
  1101. AND o.shipping_id = #{shippingId}
  1102. </if>
  1103. <if test="orderType != null and orderType.trim() != ''">
  1104. AND o.order_type = #{orderType}
  1105. </if>
  1106. <if test="isOnfiilineOrder != null">
  1107. AND o.is_onffline_order = #{isOnfiilineOrder}
  1108. </if>
  1109. </select>
  1110. <select id="promOrderListExport" resultType="com.kmall.admin.entity.OrderEntity">
  1111. SELECT
  1112. s.prom_id,
  1113. o.id,
  1114. o.order_sn,
  1115. o.merch_order_sn,
  1116. o.actual_price,
  1117. g.goods_name,
  1118. g.number,
  1119. g.retail_price,
  1120. o.freight_price,
  1121. o.activity_id,
  1122. o.order_status,
  1123. o.pay_status,
  1124. store.store_name storeName,
  1125. u.userName userName,
  1126. o.buyer_pay_check,
  1127. o.order_price,
  1128. o.add_time,
  1129. o.shipping_status,
  1130. g.goods_id goodsId
  1131. FROM
  1132. mk_store_prom_stat s
  1133. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  1134. LEFT JOIN mall_order o ON r.order_id = o.id
  1135. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1136. AND g.id = r.order_goods_id
  1137. LEFT JOIN mall_store store ON o.store_id = store.id
  1138. LEFT JOIN mall_user u ON o.user_id = u.id
  1139. WHERE
  1140. r.order_id IS NOT NULL
  1141. <if test="promId != null and promId != ''">
  1142. AND s.prom_id = #{promId}
  1143. </if>
  1144. <if test="startTime != null and startTime != ''">
  1145. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1146. </if>
  1147. <if test="endTime != null and endTime != ''">
  1148. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1149. </if>
  1150. <if test="storeId != null and storeId != ''">
  1151. AND o.store_id = #{storeId}
  1152. </if>
  1153. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1154. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  1155. </if>
  1156. <if test="orderBizType != null and orderBizType != ''">
  1157. AND o.order_biz_type = #{orderBizType}
  1158. </if>
  1159. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1160. AND o.merch_order_sn = #{merchOrderSn}
  1161. </if>
  1162. <if test="merchSn != null and merchSn.trim() != ''">
  1163. AND o.merch_sn = #{merchSn}
  1164. </if>
  1165. <if test="orderSn != null and orderSn.trim() != ''">
  1166. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1167. </if>
  1168. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1169. AND o.shipping_status = #{shippingStatus}
  1170. </if>
  1171. <if test="payStatus != null and payStatus.trim() != ''">
  1172. AND o.pay_status = #{payStatus}
  1173. </if>
  1174. <if test="orderStatus != null and orderStatus.trim() != ''">
  1175. AND o.order_status = #{orderStatus}
  1176. </if>
  1177. <if test="shippingId != null and shippingId != 0">
  1178. AND o.shipping_id = #{shippingId}
  1179. </if>
  1180. <if test="orderType != null and orderType.trim() != ''">
  1181. AND o.order_type = #{orderType}
  1182. </if>
  1183. <if test="isOnfiilineOrder != null">
  1184. AND o.is_onffline_order = #{isOnfiilineOrder}
  1185. </if>
  1186. </select>
  1187. <select id="getActualPriceByOutProm" parameterType="map" resultType="java.lang.Double">
  1188. SELECT
  1189. o.actual_price - ( o.actual_price - g.retail_price * g.number ) promActualPrice
  1190. FROM
  1191. mk_store_prom_order_real r
  1192. LEFT JOIN mall_order o ON r.order_id = o.id
  1193. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1194. AND g.id = r.order_goods_id
  1195. WHERE 1=1
  1196. AND g.goods_id = #{goodsId}
  1197. AND r.order_id = #{orderId}
  1198. <if test="statusList != null">
  1199. AND o.order_status IN
  1200. <foreach item="statusList" collection="statusList" open="(" separator="," close=")">
  1201. #{statusList}
  1202. </foreach>
  1203. </if>
  1204. </select>
  1205. <select id="storeTopicOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  1206. SELECT
  1207. s.title 'storeTopicName',
  1208. pt.prom_type_name 'storeTopicType',
  1209. ss.store_name 'storeName',
  1210. s.id 'storeTopicId',
  1211. o.id,
  1212. o.order_sn,
  1213. o.merch_order_sn,
  1214. o.actual_price,
  1215. o.freight_price,
  1216. o.activity_id,
  1217. o.coupon_id,
  1218. o.coupon_name,
  1219. o.camp_minus_id,
  1220. o.camp_name,
  1221. o.order_status,
  1222. o.pay_status,
  1223. u.userName userName,
  1224. o.order_price,
  1225. o.add_time,
  1226. o.shipping_status
  1227. FROM
  1228. mall_order o
  1229. INNER JOIN mall_store_topic s ON o.activity_id = s.id
  1230. LEFT JOIN mk_store_prom_type pt ON s.prom_type_id = pt.prom_type_id
  1231. LEFT JOIN mall_store ss ON o.store_id = ss.id
  1232. LEFT JOIN mall_user u ON o.user_id = u.id
  1233. WHERE
  1234. 1=1
  1235. <if test="storeTopicId != null and storeTopicId != ''">
  1236. AND s.id = #{storeTopicId}
  1237. </if>
  1238. <if test="startTime != null and startTime != ''">
  1239. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1240. </if>
  1241. <if test="endTime != null and endTime != ''">
  1242. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1243. </if>
  1244. <if test="storeId != null and storeId != ''">
  1245. AND o.store_id = #{storeId}
  1246. </if>
  1247. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1248. AND ss.third_party_merch_code = #{thirdPartyMerchCode}
  1249. </if>
  1250. <if test="orderBizType != null and orderBizType != ''">
  1251. AND o.order_biz_type = #{orderBizType}
  1252. </if>
  1253. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1254. AND o.merch_order_sn = #{merchOrderSn}
  1255. </if>
  1256. <if test="merchSn != null and merchSn.trim() != ''">
  1257. AND o.merch_sn = #{merchSn}
  1258. </if>
  1259. <if test="orderSn != null and orderSn.trim() != ''">
  1260. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1261. </if>
  1262. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1263. AND o.shipping_status = #{shippingStatus}
  1264. </if>
  1265. <if test="payStatus != null and payStatus.trim() != ''">
  1266. AND o.pay_status = #{payStatus}
  1267. </if>
  1268. <if test="orderStatus != null and orderStatus.trim() != ''">
  1269. AND o.order_status = #{orderStatus}
  1270. </if>
  1271. <if test="shippingId != null and shippingId != 0">
  1272. AND o.shipping_id = #{shippingId}
  1273. </if>
  1274. <if test="orderType != null and orderType.trim() != ''">
  1275. AND o.order_type = #{orderType}
  1276. </if>
  1277. <if test="isOnfiilineOrder != null">
  1278. AND o.is_onffline_order = #{isOnfiilineOrder}
  1279. </if>
  1280. order by o.id DESC
  1281. <if test="offset != null and limit != null">
  1282. limit #{offset}, #{limit}
  1283. </if>
  1284. </select>
  1285. <select id="queryStoreTopicOrderTotal" resultType="int">
  1286. SELECT
  1287. count(*)
  1288. FROM
  1289. mall_order o
  1290. INNER JOIN mall_store_topic s ON o.activity_id = s.id
  1291. LEFT JOIN mk_store_prom_type pt ON s.prom_type_id = pt.prom_type_id
  1292. LEFT JOIN mall_store ss ON o.store_id = ss.id
  1293. LEFT JOIN mall_user u ON o.user_id = u.id
  1294. WHERE 1=1
  1295. <if test="storeTopicId != null and storeTopicId != ''">
  1296. AND s.id = #{storeTopicId}
  1297. </if>
  1298. <if test="startTime != null and startTime != ''">
  1299. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1300. </if>
  1301. <if test="endTime != null and endTime != ''">
  1302. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1303. </if>
  1304. <if test="storeId != null and storeId != ''">
  1305. AND o.store_id = #{storeId}
  1306. </if>
  1307. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1308. AND ss.third_party_merch_code = #{thirdPartyMerchCode}
  1309. </if>
  1310. <if test="orderBizType != null and orderBizType != ''">
  1311. AND o.order_biz_type = #{orderBizType}
  1312. </if>
  1313. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1314. AND o.merch_order_sn = #{merchOrderSn}
  1315. </if>
  1316. <if test="merchSn != null and merchSn.trim() != ''">
  1317. AND o.merch_sn = #{merchSn}
  1318. </if>
  1319. <if test="orderSn != null and orderSn.trim() != ''">
  1320. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1321. </if>
  1322. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1323. AND o.shipping_status = #{shippingStatus}
  1324. </if>
  1325. <if test="payStatus != null and payStatus.trim() != ''">
  1326. AND o.pay_status = #{payStatus}
  1327. </if>
  1328. <if test="orderStatus != null and orderStatus.trim() != ''">
  1329. AND o.order_status = #{orderStatus}
  1330. </if>
  1331. <if test="shippingId != null and shippingId != 0">
  1332. AND o.shipping_id = #{shippingId}
  1333. </if>
  1334. <if test="orderType != null and orderType.trim() != ''">
  1335. AND o.order_type = #{orderType}
  1336. </if>
  1337. <if test="isOnfiilineOrder != null">
  1338. AND o.is_onffline_order = #{isOnfiilineOrder}
  1339. </if>
  1340. </select>
  1341. <!-- 可根据自己的需求,是否要使用 -->
  1342. <resultMap type="com.kmall.admin.dto.OrderRecognitionDto" id="orderRecognitionMap">
  1343. <result property="id" column="id"/>
  1344. <result property="merchOrderSn" column="merch_order_sn"/>
  1345. <result property="orderSn" column="order_sn"/>
  1346. <result property="userId" column="user_id"/>
  1347. <result property="orderStatus" column="order_status"/>
  1348. <result property="shippingStatus" column="shipping_status"/>
  1349. <result property="payStatus" column="pay_status"/>
  1350. <result property="consignee" column="consignee"/>
  1351. <result property="country" column="country"/>
  1352. <result property="province" column="province"/>
  1353. <result property="city" column="city"/>
  1354. <result property="district" column="district"/>
  1355. <result property="address" column="address"/>
  1356. <result property="mobile" column="mobile"/>
  1357. <result property="postscript" column="postscript"/>
  1358. <result property="shippingId" column="shipping_id"/>
  1359. <result property="shippingName" column="shipping_name"/>
  1360. <result property="shippingCode" column="shipping_code"/>
  1361. <result property="shippingNo" column="shipping_no"/>
  1362. <result property="payId" column="pay_id"/>
  1363. <result property="payName" column="pay_name"/>
  1364. <result property="shippingFee" column="shipping_fee"/>
  1365. <result property="actualPrice" column="actual_price"/>
  1366. <result property="integral" column="integral"/>
  1367. <result property="integralMoney" column="integral_money"/>
  1368. <result property="orderPrice" column="order_price"/>
  1369. <result property="goodsPrice" column="goods_price"/>
  1370. <result property="addTime" column="add_time"/>
  1371. <result property="confirmTime" column="confirm_time"/>
  1372. <result property="payTime" column="pay_time"/>
  1373. <result property="freightPrice" column="freight_price"/>
  1374. <result property="couponId" column="coupon_id"/>
  1375. <result property="couponPrice" column="coupon_price"/>
  1376. <result property="callbackStatus" column="callback_status"/>
  1377. <result property="orderType" column="order_type"/>
  1378. <result property="storeId" column="store_id"/>
  1379. <result property="userName" column="username"/>
  1380. <result property="orderType" column="order_type"/>
  1381. <result property="activityId" column="activity_id"/>
  1382. <result property="deliveryDate" column="delivery_date"/>
  1383. <result property="deliveryRemark" column="delivery_remark"/>
  1384. <result property="predictTime" column="predict_time"/>
  1385. <result property="orderBizType" column="order_biz_type"/>
  1386. <result property="isPaymentSend" column="is_payment_send"/>
  1387. <result property="isEleOrderSend" column="is_ele_order_send"/>
  1388. <result property="isCustomsSend" column="is_customs_send"/>
  1389. <result property="payFlag" column="pay_flag"/>
  1390. <result column="buyer_pay_check" property="buyerPayCheck"/>
  1391. <result property="merchSn" column="merch_sn"/>
  1392. <result property="sku" column="sku"/>
  1393. <result property="createTime" column="create_time"/>
  1394. <result property="modTime" column="mod_time"/>
  1395. <result property="isOnfflineOrder" column="is_onffline_order"/>
  1396. <result property="orderSnWx" column="order_sn_wx"/>
  1397. <result property="isMergePay" column="is_merge_pay"/>
  1398. <result property="payTransactionId" column="pay_transaction_id"/>
  1399. <result property="storeName" column="store_name"/>
  1400. <result property="moderSn" column="moder_sn"/>
  1401. <result property="unitCode" column="unit_code"/>
  1402. <result property="ciqProdModel" column="ciq_prod_model"/>
  1403. <result property="oriCntCode" column="ori_cnt_code"/>
  1404. <result property="brand" column="brand"/>
  1405. <result column="gross_weight" property="grossWeight" />
  1406. <result column="net_weight" property="netWeight" />
  1407. <result property="fullCutPrice" column="full_cut_price"/>
  1408. <result property="campMinusId" column="camp_minus_id"/>
  1409. <result property="campName" column="camp_name"/>
  1410. <result property="isTempNoti" column="is_temp_noti"/>
  1411. <result property="isFaceCheck" column="is_face_check"/>
  1412. <result property="tempNotiMsg" column="temp_noti_msg"/>
  1413. <result property="recognitionReturnMsg" column="recognition_return_msg"/>
  1414. <result property="lastFaceTime" column="last_face_time"/>
  1415. <result property="failCount" column="fail_count"/>
  1416. <result property="checkOperatorType" column="check_operator_type"/>
  1417. <result property="faceLivenessId" column="faceLivenessId"/>
  1418. </resultMap>
  1419. <select id="queryOrderListByRecognition" resultMap="orderRecognitionMap">
  1420. SELECT DISTINCT
  1421. o.order_sn,
  1422. o.merch_order_sn,
  1423. o.order_status,
  1424. o.actual_price,
  1425. o.order_biz_type,
  1426. o.shipping_no,
  1427. o.shipping_name,
  1428. o.shipping_code,
  1429. o.consignee,
  1430. o.mobile,
  1431. o.province,
  1432. o.city,
  1433. o.district,
  1434. o.address,
  1435. o.add_time,
  1436. o.pay_id,
  1437. o.pay_status,
  1438. o.shipping_status,
  1439. o.is_merge_pay,
  1440. o.buyer_pay_check,
  1441. o.order_price,
  1442. o.moder_sn,
  1443. o.id,
  1444. u.username AS username,
  1445. o.user_id,
  1446. p.is_payment_send,
  1447. p.is_ele_order_send,
  1448. p.is_customs_send,
  1449. s.store_name,
  1450. o.full_cut_price,
  1451. o.camp_minus_id,
  1452. o.camp_name,
  1453. fd.is_temp_noti,
  1454. fd.is_face_check,
  1455. fd.temp_noti_msg,
  1456. fd.recognition_return_msg,
  1457. fd.fail_count,
  1458. fd.id 'faceLivenessId',
  1459. fd.check_operator_type,
  1460. u.last_face_time,
  1461. t.is_face_check 'thirdIsFaceCheck'
  1462. FROM
  1463. mall_order o
  1464. LEFT JOIN mall_user u ON o.user_id = u.id
  1465. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  1466. left join mall_store s on o.store_id = s.id
  1467. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  1468. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1469. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  1470. AND r.goods_id = g.goods_id
  1471. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  1472. INNER JOIN face_liveness_recognition_return_data fd on fd.order_sn = o.order_sn and fd.user_id = o.user_id
  1473. WHERE 1=1
  1474. <if test="startTime != null and startTime != ''">
  1475. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1476. </if>
  1477. <if test="endTime != null and endTime != ''">
  1478. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1479. </if>
  1480. <if test="storeId != null and storeId != ''">
  1481. AND o.store_id = #{storeId}
  1482. </if>
  1483. <if test="sku != null and sku.trim() != ''">
  1484. AND gs.sku = #{sku}
  1485. </if>
  1486. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1487. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  1488. </if>
  1489. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  1490. AND t.third_merch_sn = #{thirdMerchSn}
  1491. </if>
  1492. <if test="supplierThirdId != null and supplierThirdId != ''">
  1493. AND r.supplier_third_id = #{supplierThirdId}
  1494. </if>
  1495. <if test="orderBizType != null and orderBizType != ''">
  1496. AND o.order_biz_type = #{orderBizType}
  1497. </if>
  1498. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1499. AND o.merch_order_sn = #{merchOrderSn}
  1500. </if>
  1501. <if test="merchSn != null and merchSn.trim() != ''">
  1502. AND o.merch_sn = #{merchSn}
  1503. </if>
  1504. <if test="orderSn != null and orderSn.trim() != ''">
  1505. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1506. </if>
  1507. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1508. AND o.shipping_status = #{shippingStatus}
  1509. </if>
  1510. <if test="payStatus != null and payStatus.trim() != ''">
  1511. AND o.pay_status = #{payStatus}
  1512. </if>
  1513. <if test="orderStatus != null and orderStatus.trim() != ''">
  1514. AND o.order_status = #{orderStatus}
  1515. </if>
  1516. <if test="shippingId != null and shippingId != 0">
  1517. AND o.shipping_id = #{shippingId}
  1518. </if>
  1519. <if test="orderType != null and orderType.trim() != ''">
  1520. AND o.order_type = #{orderType}
  1521. </if>
  1522. <if test="isOnfiilineOrder != null">
  1523. AND o.is_onffline_order = #{isOnfiilineOrder}
  1524. </if>
  1525. <if test="ids != null and ids.trim() != ''">
  1526. AND o.id in (${ids})
  1527. </if>
  1528. <choose>
  1529. <when test="sidx != null and sidx.trim() != ''">
  1530. order by ${sidx} ${order}
  1531. </when>
  1532. <otherwise>
  1533. order by o.id desc
  1534. </otherwise>
  1535. </choose>
  1536. <if test="offset != null and limit != null">
  1537. limit #{offset}, #{limit}
  1538. </if>
  1539. </select>
  1540. <select id="queryOrderListByRecognitionTotal" resultType="int">
  1541. SELECT count(1)
  1542. FROM
  1543. mall_order o
  1544. LEFT JOIN mall_user u ON o.user_id = u.id
  1545. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  1546. left join mall_store s on o.store_id = s.id
  1547. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  1548. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1549. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  1550. AND r.goods_id = g.goods_id
  1551. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  1552. INNER JOIN face_liveness_recognition_return_data fd on fd.order_sn = o.order_sn and fd.user_id = o.user_id
  1553. WHERE 1=1
  1554. <if test="startTime != null and startTime != ''">
  1555. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1556. </if>
  1557. <if test="endTime != null and endTime != ''">
  1558. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1559. </if>
  1560. <if test="storeId != null and storeId != ''">
  1561. AND o.store_id = #{storeId}
  1562. </if>
  1563. <if test="sku != null and sku.trim() != ''">
  1564. AND gs.sku = #{sku}
  1565. </if>
  1566. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1567. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  1568. </if>
  1569. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  1570. AND t.third_merch_sn = #{thirdMerchSn}
  1571. </if>
  1572. <if test="supplierThirdId != null and supplierThirdId != ''">
  1573. AND r.supplier_third_id = #{supplierThirdId}
  1574. </if>
  1575. <if test="orderBizType != null and orderBizType != ''">
  1576. AND o.order_biz_type = #{orderBizType}
  1577. </if>
  1578. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1579. AND o.merch_order_sn = #{merchOrderSn}
  1580. </if>
  1581. <if test="merchSn != null and merchSn.trim() != ''">
  1582. AND o.merch_sn = #{merchSn}
  1583. </if>
  1584. <if test="orderSn != null and orderSn.trim() != ''">
  1585. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1586. </if>
  1587. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1588. AND o.shipping_status = #{shippingStatus}
  1589. </if>
  1590. <if test="payStatus != null and payStatus.trim() != ''">
  1591. AND o.pay_status = #{payStatus}
  1592. </if>
  1593. <if test="orderStatus != null and orderStatus.trim() != ''">
  1594. AND o.order_status = #{orderStatus}
  1595. </if>
  1596. <if test="shippingId != null and shippingId != 0">
  1597. AND o.shipping_id = #{shippingId}
  1598. </if>
  1599. <if test="orderType != null and orderType.trim() != ''">
  1600. AND o.order_type = #{orderType}
  1601. </if>
  1602. <if test="isOnfiilineOrder != null">
  1603. AND o.is_onffline_order = #{isOnfiilineOrder}
  1604. </if>
  1605. <if test="ids != null and ids.trim() != ''">
  1606. AND o.id in (${ids})
  1607. </if>
  1608. </select>
  1609. <select id="queryOrderByRecogTemp" resultType="com.kmall.admin.dto.SendTempDto">
  1610. SELECT
  1611. o.add_time 'addTime',
  1612. u.weixin_openid 'openId',
  1613. o.merch_order_sn 'merchOrderSn',
  1614. o.id 'orderId',
  1615. o.order_sn 'orderSn'
  1616. FROM
  1617. mall_order o
  1618. INNER JOIN mall_user u ON o.user_id = u.id
  1619. where o.id = #{value}
  1620. </select>
  1621. <select id="queryRealtimeSales" resultType="com.kmall.admin.entity.RealtimeSalesDetection">
  1622. SELECT
  1623. s.id AS storeId,
  1624. o.merch_sn AS merchSn,
  1625. m.merch_name AS merchName,
  1626. count( distinct o.order_sn ) AS guestNumber,
  1627. sum( og.actual_payment_amount/ (1+og.goods_rate) ) + sum(og.discounted_price)AS totalSales,
  1628. sum( og.actual_payment_amount/ (1+og.goods_rate) ) + sum(og.discounted_price) AS actualSales,
  1629. s.store_name AS storeName,
  1630. max( o.add_time ) AS lastSalesTime ,
  1631. sum( g.cost_price) AS totalCost
  1632. FROM
  1633. mall_order o
  1634. LEFT JOIN mall_store s ON o.store_id = s.id
  1635. LEFT JOIN mall_merch m ON o.merch_sn = m.merch_sn
  1636. LEFT JOIN mall_order_goods og ON o.id = og.order_id
  1637. LEFT JOIN mall_goods g ON og.goods_id = g.id
  1638. LEFT JOIN mall_product_store_rela sr ON sr.goods_id = g.id
  1639. LEFT JOIN mall_category c ON sr.category_id = c.id
  1640. WHERE
  1641. 1 = 1
  1642. and (o.order_status = '300' or o.order_status = '201')
  1643. <if test="storeId != null and storeId.trim() != ''">
  1644. and o.store_id=#{storeId}
  1645. </if>
  1646. <if test="merchSn != null and merchSn.trim() != ''">
  1647. and o.merch_sn=#{merchSn}
  1648. </if>
  1649. <choose>
  1650. <when test="compareDate != null and compareDate != ''">
  1651. and ( datediff ( o.add_time , #{compareDate} ) = 0 )
  1652. </when>
  1653. <when test="salesDate != null and salesDate != ''">
  1654. and ( datediff ( o.add_time , #{salesDate} ) = 0 )
  1655. </when >
  1656. <otherwise></otherwise>
  1657. </choose>
  1658. <if test="categoryId != null and categoryId != ''">
  1659. AND (c.parent_id = #{categoryId} or c.id = #{categoryId})
  1660. </if>
  1661. </select>
  1662. <select id="purchaseSalesInStockDetailList" resultType="com.kmall.admin.entity.PurchaseSalesInStockDetail">
  1663. select
  1664. substr(msmc.create_time,1,10) as time,
  1665. if(msmc.change_type = 1 ,'销售','期初') as type,
  1666. sum(if((msmc.change_type = 2 or msmc.change_type = 3 ),msmc.store_change_num,0)) as addNum,
  1667. sum(if(msmc.change_type = 1 ,msmc.store_change_num,0)) as lessNum,
  1668. rela.stock_num as endingInventory,
  1669. rela.stock_num as inventory,
  1670. 0 as costPrice,
  1671. rela.retail_price as retailPrice,
  1672. 0 as addAmount,
  1673. sum(if(msmc.change_type = 1 ,msmc.store_change_num,0)*rela.retail_price) as lessAmount,
  1674. 0 as price
  1675. from mall_product_store_rela rela
  1676. left join mall_store_mng_change msmc on msmc.goods_id = rela.goods_id
  1677. left join mall_goods g on g.id = msmc.goods_id
  1678. WHERE 1=1 and msmc.creater_sn <![CDATA[ <> ]]> '定时任务'
  1679. <if test="storeId != null and storeId != ''">
  1680. AND rela.store_id = #{storeId}
  1681. </if>
  1682. <if test="goodsSn != null and goodsSn.trim() != ''">
  1683. AND g.goods_sn = #{goodsSn}
  1684. </if>
  1685. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  1686. AND g.prod_barcode = #{prodBarcode}
  1687. </if>
  1688. <if test="startTime != null and startTime.trim() != ''">
  1689. AND substr(msmc.create_time,1,10) <![CDATA[ >= ]]> #{startTime}
  1690. </if>
  1691. <if test="endTime != null and endTime.trim() != ''">
  1692. AND substr(msmc.create_time,1,10) <![CDATA[ <= ]]> #{endTime}
  1693. </if>
  1694. group by substr(msmc.create_time,1,10)
  1695. <if test="offset != null and limit != null">
  1696. limit #{offset}, #{limit}
  1697. </if>
  1698. </select>
  1699. <select id="purchaseSalesInStockDetailTotal" resultType="int">
  1700. select count(1) from ( select count(DISTINCT rela.id)
  1701. from mall_product_store_rela rela
  1702. left join mall_store_mng_change msmc on msmc.goods_id = rela.goods_id
  1703. left join mall_goods g on g.id = msmc.goods_id
  1704. WHERE 1=1 and msmc.creater_sn <![CDATA[ <> ]]> '定时任务'
  1705. <if test="storeId != null and storeId != ''">
  1706. AND rela.store_id = #{storeId}
  1707. </if>
  1708. <if test="goodsSn != null and goodsSn.trim() != ''">
  1709. AND g.goods_sn = #{goodsSn}
  1710. </if>
  1711. <if test="sku != null and sku.trim() != ''">
  1712. AND g.sku = #{sku}
  1713. </if>
  1714. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  1715. AND g.prod_barcode = #{prodBarcode}
  1716. </if>
  1717. <if test="startTime != null and startTime.trim() != ''">
  1718. AND substr(msmc.create_time,1,10) <![CDATA[ >= ]]> #{startTime}
  1719. </if>
  1720. <if test="endTime != null and endTime.trim() != ''">
  1721. AND substr(msmc.create_time,1,10) <![CDATA[ <= ]]> #{endTime}
  1722. </if>
  1723. group by substr(msmc.create_time,1,10)
  1724. ) b
  1725. </select>
  1726. <select id="queryTopicPriceByOrderSnAndSku" resultType="java.math.BigDecimal">
  1727. SELECT mst.topic_price FROM mall_order mo
  1728. inner JOIN mall_order_goods mog ON mo.id = mog.order_id
  1729. inner JOIN mall_store_topic mst ON mog.store_topic_id=mst.id
  1730. WHERE mo.order_sn=#{orderSn} AND mog.sku=#{sku};
  1731. </select>
  1732. <select id="queryExportOffilineOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  1733. SELECT distinct
  1734. o.id,
  1735. o.order_sn,
  1736. u.username as userName,
  1737. o.pay_name,
  1738. o.mobile,
  1739. o.is_onffline_order,
  1740. o.order_biz_type,
  1741. o.order_status,
  1742. o.pay_status,
  1743. o.coupon_name,
  1744. o.coupon_price,
  1745. g.actual_payment_amount as actualPrice,
  1746. o.order_price,
  1747. o.pay_time,
  1748. o.pay_flag,
  1749. u.username AS userName,
  1750. g.discounted_price as couponPrice ,
  1751. s.store_name storeName,
  1752. g.sku,
  1753. g.goods_name as goodsName,
  1754. g.retail_price,
  1755. g.number
  1756. FROM
  1757. mall_order o
  1758. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1759. left join mall_store s on o.store_id = s.id
  1760. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  1761. left join mall_sale_record record on record.order_sn = o.order_sn
  1762. LEFT JOIN sys_user u ON record.saller_id = u.user_id
  1763. WHERE 1=1
  1764. <if test="orderSn != null and orderSn.trim() != ''">
  1765. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1766. </if>
  1767. <if test="orderStatus != null and orderStatus.trim() != ''">
  1768. AND o.order_status = #{orderStatus}
  1769. </if>
  1770. <if test="isOnfiilineOrder != null">
  1771. AND o.is_onffline_order = #{isOnfiilineOrder}
  1772. </if>
  1773. <if test="startTime != null and startTime != ''">
  1774. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1775. </if>
  1776. <if test="endTime != null and endTime != ''">
  1777. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1778. </if>
  1779. </select>
  1780. <select id="queryMasterExportOffilineOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  1781. SELECT distinct
  1782. o.id,
  1783. o.order_sn,
  1784. u.username as userName,
  1785. o.pay_name,
  1786. o.mobile,
  1787. o.is_onffline_order,
  1788. o.order_biz_type,
  1789. o.order_status,
  1790. o.pay_status,
  1791. o.coupon_name,
  1792. o.coupon_price,
  1793. o.actual_price,
  1794. o.order_price,
  1795. o.pay_time,
  1796. o.pay_flag,
  1797. u.username AS userName,
  1798. s.store_name storeName
  1799. FROM
  1800. mall_order o
  1801. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1802. left join mall_store s on o.store_id = s.id
  1803. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  1804. left join mall_sale_record record on record.order_sn = o.order_sn
  1805. LEFT JOIN sys_user u ON record.saller_id = u.user_id
  1806. WHERE 1=1
  1807. <if test="storeId != null and storeId != ''">
  1808. AND o.store_id = #{storeId}
  1809. </if>
  1810. <if test="merchSn != null and merchSn.trim() != ''">
  1811. AND o.merch_sn = #{merchSn}
  1812. </if>
  1813. <if test="goodsSn != null and goodsSn.trim() != ''">
  1814. AND gs.goods_sn = #{goodsSn}
  1815. </if>
  1816. <if test="sku != null and sku.trim() != ''">
  1817. AND gs.sku = #{sku}
  1818. </if>
  1819. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  1820. AND gs.prod_barcode = #{prodBarcode}
  1821. </if>
  1822. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1823. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  1824. </if>
  1825. <if test="orderSn != null and orderSn.trim() != ''">
  1826. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1827. </if>
  1828. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1829. AND o.shipping_status = #{shippingStatus}
  1830. </if>
  1831. <if test="payStatus != null and payStatus.trim() != ''">
  1832. AND o.pay_status = #{payStatus}
  1833. </if>
  1834. <if test="orderStatus != null and orderStatus.trim() != ''">
  1835. AND o.order_status = #{orderStatus}
  1836. </if>
  1837. <if test="shippingId != null and shippingId != 0">
  1838. AND o.shipping_id = #{shippingId}
  1839. </if>
  1840. <if test="orderType != null and orderType.trim() != ''">
  1841. AND o.order_type = #{orderType}
  1842. </if>
  1843. <if test="isOnfiilineOrder != null">
  1844. AND o.is_onffline_order = #{isOnfiilineOrder}
  1845. </if>
  1846. <if test="ids != null and ids.trim() != ''">
  1847. AND o.id in (${ids})
  1848. </if>
  1849. <if test="startTime != null and startTime != ''">
  1850. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1851. </if>
  1852. <if test="endTime != null and endTime != ''">
  1853. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1854. </if>
  1855. </select>
  1856. <select id="queryMasterExportList" resultType="com.kmall.admin.entity.OrderEntity">
  1857. SELECT DISTINCT
  1858. o.order_sn,
  1859. o.merch_order_sn,
  1860. o.order_status,
  1861. o.actual_price,
  1862. o.order_biz_type,
  1863. o.shipping_no,
  1864. o.shipping_name,
  1865. o.shipping_code,
  1866. o.consignee,
  1867. o.mobile,
  1868. o.province,
  1869. o.city,
  1870. o.district,
  1871. o.address,
  1872. o.add_time,
  1873. o.pay_id,
  1874. o.pay_status,
  1875. o.shipping_status,
  1876. o.is_merge_pay,
  1877. o.buyer_pay_check,
  1878. o.order_price,
  1879. o.moder_sn,
  1880. o.id,
  1881. u.username AS username,
  1882. p.is_payment_send,
  1883. p.is_ele_order_send,
  1884. p.is_customs_send,
  1885. s.store_name,
  1886. o.full_cut_price,
  1887. o.camp_minus_id,
  1888. o.camp_name
  1889. FROM
  1890. mall_order o
  1891. LEFT JOIN mall_user u ON o.user_id = u.id
  1892. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  1893. left join mall_store s on o.store_id = s.id
  1894. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  1895. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  1896. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  1897. AND r.goods_id = g.goods_id
  1898. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  1899. WHERE 1=1
  1900. <if test="startTime != null and startTime != ''">
  1901. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1902. </if>
  1903. <if test="endTime != null and endTime != ''">
  1904. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1905. </if>
  1906. <if test="storeId != null and storeId != ''">
  1907. AND o.store_id = #{storeId}
  1908. </if>
  1909. <if test="sku != null and sku.trim() != ''">
  1910. AND gs.sku = #{sku}
  1911. </if>
  1912. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  1913. AND gs.prod_barcode = #{prodBarcode}
  1914. </if>
  1915. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1916. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  1917. </if>
  1918. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  1919. AND t.third_merch_sn = #{thirdMerchSn}
  1920. </if>
  1921. <if test="supplierThirdId != null and supplierThirdId != ''">
  1922. AND r.supplier_third_id = #{supplierThirdId}
  1923. </if>
  1924. <if test="orderBizType != null and orderBizType != ''">
  1925. AND o.order_biz_type = #{orderBizType}
  1926. </if>
  1927. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1928. AND o.merch_order_sn = #{merchOrderSn}
  1929. </if>
  1930. <if test="merchSn != null and merchSn.trim() != ''">
  1931. AND o.merch_sn = #{merchSn}
  1932. </if>
  1933. <if test="orderSn != null and orderSn.trim() != ''">
  1934. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1935. </if>
  1936. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1937. AND o.shipping_status = #{shippingStatus}
  1938. </if>
  1939. <if test="payStatus != null and payStatus.trim() != ''">
  1940. AND o.pay_status = #{payStatus}
  1941. </if>
  1942. <if test="orderStatus != null and orderStatus.trim() != ''">
  1943. AND o.order_status = #{orderStatus}
  1944. </if>
  1945. <if test="shippingId != null and shippingId != 0">
  1946. AND o.shipping_id = #{shippingId}
  1947. </if>
  1948. <if test="orderType != null and orderType.trim() != ''">
  1949. AND o.order_type = #{orderType}
  1950. </if>
  1951. <if test="isOnfiilineOrder != null">
  1952. AND o.is_onffline_order = #{isOnfiilineOrder}
  1953. </if>
  1954. <if test="ids != null and ids.trim() != ''">
  1955. AND o.id in (${ids})
  1956. </if>
  1957. </select>
  1958. <select id="queryPickUpCodeList" resultType="com.kmall.admin.entity.OrderEntity">
  1959. SELECT distinct
  1960. o.*,
  1961. c.pick_up_code_sn,
  1962. c.pick_up_code_status
  1963. FROM mall_order o
  1964. LEFT JOIN mall_pick_up_code c ON c.order_sn = o.order_sn
  1965. WHERE 1=1
  1966. <if test="storeId != null and storeId != ''">
  1967. AND o.store_id = #{storeId}
  1968. </if>
  1969. <if test="isOnfiilineOrder != null">
  1970. AND o.is_onffline_order = #{isOnfiilineOrder}
  1971. </if>
  1972. <if test="orderSn != null and orderSn.trim() != ''">
  1973. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1974. </if>
  1975. <if test="payName != null and payName.trim() != ''">
  1976. AND o.pay_name = LIKE concat('%',#{payName},'%')
  1977. </if>
  1978. <if test="payMobile != null and payMobile.trim() != ''">
  1979. AND o.pay_mobile LIKE concat('%',#{pay_mobile},'%')
  1980. </if>
  1981. <if test="startTime != null and startTime.trim() != ''">
  1982. AND o.add_time &gt;= #{startTime}
  1983. </if>
  1984. <if test="endTime != null and endTime.trim() != ''">
  1985. AND o.add_time &lt; #{endTime}
  1986. </if>
  1987. order by o.id desc
  1988. </select>
  1989. <select id="queryExportSystemFormatList" resultType="com.kmall.admin.dto.SystemFormatDto">
  1990. SELECT distinct
  1991. o.id,
  1992. o.order_sn as receiptNo,
  1993. u.username as cashRegisterNo,
  1994. o.pay_time as timeStampDetails,
  1995. u.username as staffID,
  1996. u.username as staffName,
  1997. c.id as hsCode,
  1998. c.name as hsCodeName,
  1999. gs.goods_sn as ematouCode,
  2000. gs.plu as plu,
  2001. gs.english_name as productNameEN,
  2002. gs.name as productNameCN,
  2003. gs.prod_barcode as barcode,
  2004. gs.ciq_prod_model as packSize,
  2005. uc.name as productSpecification,
  2006. b.name as brand,
  2007. gs.daily_price as edlp,
  2008. g.number as unitSold,
  2009. g.actual_payment_amount as sales,
  2010. o.order_price as totalSalesInclTax,
  2011. gs.goods_rate as taxRate,
  2012. sup.child_supplier_name as supplierName
  2013. FROM
  2014. mall_order o
  2015. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  2016. left join mall_store s on o.store_id = s.id
  2017. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  2018. left join mall_sale_record record on record.order_sn = o.order_sn
  2019. LEFT JOIN sys_user u ON record.saller_id = u.user_id
  2020. left join sys_cus_unit_code uc on uc.code = gs.unit_code
  2021. left join mall_product_store_rela sr on sr.goods_id=gs.id
  2022. left join mall_brand b on b.id=sr.brand_id
  2023. left join mall_category c on b.category_id = c.id
  2024. left join mall_supplier sup on gs.supplier_id = sup.id
  2025. WHERE 1=1
  2026. <if test="orderSn != null and orderSn.trim() != ''">
  2027. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  2028. </if>
  2029. <if test="orderStatus != null and orderStatus.trim() != ''">
  2030. AND o.order_status = #{orderStatus}
  2031. </if>
  2032. <if test="isOnfiilineOrder != null">
  2033. AND o.is_onffline_order = #{isOnfiilineOrder}
  2034. </if>
  2035. <if test="startTime != null and startTime != ''">
  2036. AND o.add_time <![CDATA[ > ]]> #{startTime}
  2037. </if>
  2038. <if test="endTime != null and endTime != ''">
  2039. AND o.add_time <![CDATA[ < ]]> #{endTime}
  2040. </if>
  2041. </select>
  2042. <update id="updateOrderInfo" parameterType="map">
  2043. UPDATE mall_order a
  2044. <set>
  2045. <if test="orderStatus != null">a.order_status = #{orderStatus},</if>
  2046. <if test="payStatus != null">a.pay_status = #{payStatus},</if>
  2047. <if test="payFlag != null">a.pay_flag = #{payFlag},</if>
  2048. <if test="orderSnWx != null">a.order_sn_wx = #{orderSnWx},</if>
  2049. <if test="payTransactionId != null">a.pay_transaction_id = #{payTransactionId},</if>
  2050. <if test="payTime != null">a.pay_time = #{payTime},</if>
  2051. <if test="totalFee != null">a.total_fee = #{totalFee},</if>
  2052. <if test="feeType != null">a.fee_type = #{feeType},</if>
  2053. <if test="cashFee != null">a.cash_fee = #{cashFee},</if>
  2054. <if test="cashFeeType != null">a.cash_fee_type = #{cashFeeType},</if>
  2055. <if test="rate != null">a.rate = #{rate},</if>
  2056. </set>
  2057. WHERE 1 = 1
  2058. AND a.id = #{orderId}
  2059. </update>
  2060. <update id="updateOrderProcessRecord" parameterType="map">
  2061. UPDATE mall_order_process_record a
  2062. <set>
  2063. <if test="payTime != null">a.pay_succ_time = #{payTime}</if>
  2064. </set>
  2065. WHERE 1 = 1
  2066. AND a.order_sn = #{orderSn}
  2067. </update>
  2068. </mapper>