OrderDao.xml 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  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="shippingFee" column="shipping_fee"/>
  28. <result property="actualPrice" column="actual_price"/>
  29. <result property="integral" column="integral"/>
  30. <result property="integralMoney" column="integral_money"/>
  31. <result property="orderPrice" column="order_price"/>
  32. <result property="goodsPrice" column="goods_price"/>
  33. <result property="addTime" column="add_time"/>
  34. <result property="confirmTime" column="confirm_time"/>
  35. <result property="payTime" column="pay_time"/>
  36. <result property="freightPrice" column="freight_price"/>
  37. <result property="couponId" column="coupon_id"/>
  38. <result property="couponPrice" column="coupon_price"/>
  39. <result property="callbackStatus" column="callback_status"/>
  40. <result property="orderType" column="order_type"/>
  41. <result property="storeId" column="store_id"/>
  42. <result property="userName" column="username"/>
  43. <result property="orderType" column="order_type"/>
  44. <result property="activityId" column="activity_id"/>
  45. <result property="deliveryDate" column="delivery_date"/>
  46. <result property="deliveryRemark" column="delivery_remark"/>
  47. <result property="predictTime" column="predict_time"/>
  48. <result property="orderBizType" column="order_biz_type"/>
  49. <result property="isPaymentSend" column="is_payment_send"/>
  50. <result property="isEleOrderSend" column="is_ele_order_send"/>
  51. <result property="isCustomsSend" column="is_customs_send"/>
  52. <result property="payFlag" column="pay_flag"/>
  53. <result column="buyer_pay_check" property="buyerPayCheck"/>
  54. <result property="merchSn" column="merch_sn"/>
  55. <result property="sku" column="sku"/>
  56. <result property="createTime" column="create_time"/>
  57. <result property="modTime" column="mod_time"/>
  58. <result property="isOnfflineOrder" column="is_onffline_order"/>
  59. <result property="orderSnWx" column="order_sn_wx"/>
  60. <result property="isMergePay" column="is_merge_pay"/>
  61. <result property="payTransactionId" column="pay_transaction_id"/>
  62. <result property="storeName" column="store_name"/>
  63. <result property="moderSn" column="moder_sn"/>
  64. <result property="unitCode" column="unit_code"/>
  65. <result property="ciqProdModel" column="ciq_prod_model"/>
  66. <result property="oriCntCode" column="ori_cnt_code"/>
  67. <result property="brand" column="brand"/>
  68. <result column="gross_weight" property="grossWeight" />
  69. <result column="net_weight" property="netWeight" />
  70. <result property="fullCutPrice" column="full_cut_price"/>
  71. <result property="campMinusId" column="camp_minus_id"/>
  72. <result property="campName" column="camp_name"/>
  73. </resultMap>
  74. <select id="queryObject" resultType="com.kmall.admin.entity.OrderEntity">
  75. select o.*,u.username as username
  76. from mall_order o
  77. left join mall_user u on o.user_id = u.id
  78. where o.id = #{value}
  79. </select>
  80. <select id="queryObjectBySysUser" resultType="com.kmall.admin.entity.OrderEntity">
  81. select o.*,u.username as username
  82. from mall_order o
  83. left join sys_user u on o.user_id = u.user_id
  84. where o.id = #{value}
  85. </select>
  86. <select id="queryObjectByActivityId" resultType="com.kmall.admin.entity.OrderEntity">
  87. select o.*,u.username as username
  88. from mall_order o
  89. left join mall_user u on o.user_id = u.id
  90. where o.activity_id = #{activityId}
  91. </select>
  92. <select id="getTotalActualPrice" resultType="java.lang.Double">
  93. select sum(a.actual_price) 'totalActualPrice' from mall_order a where merch_order_sn = #{merchOrderSn}
  94. </select>
  95. <select id="queryObjectByMerchOrderSn" resultType="com.kmall.admin.entity.OrderEntity">
  96. select * from mall_order a where merch_order_sn = #{merchOrderSn}
  97. </select>
  98. <select id="queryObjectByOrderSn" resultType="com.kmall.admin.entity.OrderEntity">
  99. select * from mall_order a where order_sn = #{orderSn}
  100. </select>
  101. <select id="queryList" resultType="com.kmall.admin.entity.OrderEntity">
  102. SELECT DISTINCT
  103. o.order_sn,
  104. o.merch_order_sn,
  105. o.order_status,
  106. o.actual_price,
  107. o.order_biz_type,
  108. o.shipping_no,
  109. o.shipping_name,
  110. o.shipping_code,
  111. o.consignee,
  112. o.mobile,
  113. o.province,
  114. o.city,
  115. o.district,
  116. o.address,
  117. o.add_time,
  118. o.pay_id,
  119. o.pay_status,
  120. o.shipping_status,
  121. o.is_merge_pay,
  122. o.buyer_pay_check,
  123. o.order_price,
  124. o.moder_sn,
  125. o.id,
  126. u.username AS username,
  127. p.is_payment_send,
  128. p.is_ele_order_send,
  129. p.is_customs_send,
  130. s.store_name,
  131. o.full_cut_price,
  132. o.camp_minus_id,
  133. o.camp_name
  134. FROM
  135. mall_order o
  136. LEFT JOIN mall_user u ON o.user_id = u.id
  137. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  138. left join mall_store s on o.store_id = s.id
  139. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  140. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  141. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  142. AND r.goods_id = g.goods_id
  143. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  144. WHERE 1=1
  145. <if test="startTime != null and startTime != ''">
  146. AND o.add_time <![CDATA[ > ]]> #{startTime}
  147. </if>
  148. <if test="endTime != null and endTime != ''">
  149. AND o.add_time <![CDATA[ < ]]> #{endTime}
  150. </if>
  151. <if test="storeId != null and storeId != ''">
  152. AND o.store_id = #{storeId}
  153. </if>
  154. <if test="sku != null and sku.trim() != ''">
  155. AND gs.sku = #{sku}
  156. </if>
  157. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  158. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  159. </if>
  160. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  161. AND t.third_merch_sn = #{thirdMerchSn}
  162. </if>
  163. <if test="supplierThirdId != null and supplierThirdId != ''">
  164. AND r.supplier_third_id = #{supplierThirdId}
  165. </if>
  166. <if test="orderBizType != null and orderBizType != ''">
  167. AND o.order_biz_type = #{orderBizType}
  168. </if>
  169. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  170. AND o.merch_order_sn = #{merchOrderSn}
  171. </if>
  172. <if test="merchSn != null and merchSn.trim() != ''">
  173. AND o.merch_sn = #{merchSn}
  174. </if>
  175. <if test="orderSn != null and orderSn.trim() != ''">
  176. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  177. </if>
  178. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  179. AND o.shipping_status = #{shippingStatus}
  180. </if>
  181. <if test="payStatus != null and payStatus.trim() != ''">
  182. AND o.pay_status = #{payStatus}
  183. </if>
  184. <if test="orderStatus != null and orderStatus.trim() != ''">
  185. AND o.order_status = #{orderStatus}
  186. </if>
  187. <if test="shippingId != null and shippingId != 0">
  188. AND o.shipping_id = #{shippingId}
  189. </if>
  190. <if test="orderType != null and orderType.trim() != ''">
  191. AND o.order_type = #{orderType}
  192. </if>
  193. <if test="isOnfiilineOrder != null">
  194. AND o.is_onffline_order = #{isOnfiilineOrder}
  195. </if>
  196. <if test="ids != null and ids.trim() != ''">
  197. AND o.id in (${ids})
  198. </if>
  199. <choose>
  200. <when test="sidx != null and sidx.trim() != ''">
  201. order by ${sidx} ${order}
  202. </when>
  203. <otherwise>
  204. order by o.id desc
  205. </otherwise>
  206. </choose>
  207. <if test="offset != null and limit != null">
  208. limit #{offset}, #{limit}
  209. </if>
  210. </select>
  211. <select id="queryExportList" resultType="com.kmall.admin.entity.OrderEntity">
  212. SELECT
  213. o.order_sn,
  214. o.merch_order_sn,
  215. o.order_status,
  216. o.actual_price,
  217. o.order_biz_type,
  218. o.shipping_no,
  219. o.shipping_name,
  220. o.shipping_code,
  221. o.consignee,
  222. o.mobile,
  223. o.province,
  224. o.city,
  225. o.district,
  226. o.address,
  227. o.add_time,
  228. o.pay_id,
  229. o.pay_transaction_id,
  230. u.id_no 'idNo',
  231. u.username AS username,
  232. p.is_payment_send,
  233. p.is_ele_order_send,
  234. p.is_customs_send,
  235. g.sku,
  236. g.goods_name,
  237. g.number,
  238. g.retail_price,
  239. s.store_name,
  240. nc.NAME ori_cnt_code,
  241. good.ciq_prod_model,
  242. good.brand,
  243. uc.NAME unit_code,
  244. good.gross_weight * g.number gross_weight,
  245. good.net_weight * g.number net_weight,
  246. t2.third_party_merch_name 'supplierThirdPartyMerchName'
  247. FROM
  248. mall_order o
  249. LEFT JOIN mall_user u ON o.user_id = u.id
  250. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  251. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  252. LEFT JOIN mall_store s ON o.store_id = s.id
  253. LEFT JOIN mall_goods good ON good.id = g.goods_id
  254. LEFT JOIN sys_cus_nation_code nc ON nc.CODE = good.ori_cnt_code
  255. LEFT JOIN sys_cus_unit_code uc ON uc.CODE = good.unit_code
  256. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  257. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  258. AND r.goods_id = g.goods_id
  259. LEFT JOIN third_merchant_biz t2 ON t2.third_merch_sn = r.supplier_third_id
  260. WHERE
  261. 1 =1
  262. <if test="startTime != null and startTime != ''">
  263. AND o.add_time <![CDATA[ > ]]> #{startTime}
  264. </if>
  265. <if test="endTime != null and endTime != ''">
  266. AND o.add_time <![CDATA[ < ]]> #{endTime}
  267. </if>
  268. <if test="storeId != null and storeId != ''">
  269. AND o.store_id = #{storeId}
  270. </if>
  271. <if test="orderBizType != null and orderBizType != ''">
  272. AND o.order_biz_type = #{orderBizType}
  273. </if>
  274. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  275. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  276. </if>
  277. <if test="sku != null and sku.trim() != ''">
  278. AND good.sku = #{sku}
  279. </if>
  280. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  281. AND o.merch_order_sn = #{merchOrderSn}
  282. </if>
  283. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  284. AND t.third_merch_sn = #{thirdMerchSn}
  285. </if>
  286. <if test="supplierThirdId != null and supplierThirdId != ''">
  287. AND r.supplier_third_id = #{supplierThirdId}
  288. </if>
  289. <if test="merchSn != null and merchSn.trim() != ''">
  290. AND o.merch_sn = #{merchSn}
  291. </if>
  292. <if test="orderSn != null and orderSn.trim() != ''">
  293. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  294. </if>
  295. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  296. AND o.shipping_status = #{shippingStatus}
  297. </if>
  298. <if test="payStatus != null and payStatus.trim() != ''">
  299. AND o.pay_status = #{payStatus}
  300. </if>
  301. <if test="orderStatus != null and orderStatus.trim() != ''">
  302. AND o.order_status = #{orderStatus}
  303. </if>
  304. <if test="shippingId != null and shippingId != 0">
  305. AND o.shipping_id = #{shippingId}
  306. </if>
  307. <if test="orderType != null and orderType.trim() != ''">
  308. AND o.order_type = #{orderType}
  309. </if>
  310. <if test="isOnfiilineOrder != null">
  311. AND o.is_onffline_order = #{isOnfiilineOrder}
  312. </if>
  313. <if test="ids != null and ids.trim() != ''">
  314. AND o.id in (${ids})
  315. </if>
  316. <choose>
  317. <when test="sidx != null and sidx.trim() != ''">
  318. order by ${sidx} ${order}
  319. </when>
  320. <otherwise>
  321. order by o.id desc
  322. </otherwise>
  323. </choose>
  324. <if test="offset != null and limit != null">
  325. limit #{offset}, #{limit}
  326. </if>
  327. </select>
  328. <select id="queryTotal" resultType="int">
  329. select count(DISTINCT o.id) FROM
  330. mall_order o
  331. LEFT JOIN mall_user u ON o.user_id = u.id
  332. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  333. left join mall_store s on o.store_id = s.id
  334. LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
  335. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  336. LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
  337. AND r.goods_id = g.goods_id
  338. LEFT JOIN mall_goods gs ON g.goods_id = gs.id
  339. WHERE 1=1
  340. <if test="startTime != null and startTime != ''">
  341. AND o.add_time <![CDATA[ > ]]> #{startTime}
  342. </if>
  343. <if test="endTime != null and endTime != ''">
  344. AND o.add_time <![CDATA[ < ]]> #{endTime}
  345. </if>
  346. <if test="storeId != null and storeId != ''">
  347. AND o.store_id = #{storeId}
  348. </if>
  349. <if test="sku != null and sku.trim() != ''">
  350. AND gs.sku = #{sku}
  351. </if>
  352. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  353. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  354. </if>
  355. <if test="thirdMerchSn != null and thirdMerchSn != ''">
  356. AND t.third_merch_sn = #{thirdMerchSn}
  357. </if>
  358. <if test="supplierThirdId != null and supplierThirdId != ''">
  359. AND r.supplier_third_id = #{supplierThirdId}
  360. </if>
  361. <if test="orderBizType != null and orderBizType != ''">
  362. AND o.order_biz_type = #{orderBizType}
  363. </if>
  364. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  365. AND o.merch_order_sn = #{merchOrderSn}
  366. </if>
  367. <if test="merchSn != null and merchSn.trim() != ''">
  368. AND o.merch_sn = #{merchSn}
  369. </if>
  370. <if test="orderSn != null and orderSn.trim() != ''">
  371. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  372. </if>
  373. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  374. AND o.shipping_status = #{shippingStatus}
  375. </if>
  376. <if test="payStatus != null and payStatus.trim() != ''">
  377. AND o.pay_status = #{payStatus}
  378. </if>
  379. <if test="orderStatus != null and orderStatus.trim() != ''">
  380. AND o.order_status = #{orderStatus}
  381. </if>
  382. <if test="shippingId != null and shippingId != 0">
  383. AND o.shipping_id = #{shippingId}
  384. </if>
  385. <if test="orderType != null and orderType.trim() != ''">
  386. AND o.order_type = #{orderType}
  387. </if>
  388. <if test="isOnfiilineOrder != null">
  389. AND o.is_onffline_order = #{isOnfiilineOrder}
  390. </if>
  391. <if test="ids != null and ids.trim() != ''">
  392. AND o.id in (${ids})
  393. </if>
  394. </select>
  395. <select id="queryOffilineOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  396. SELECT
  397. o.*,
  398. u.username AS username,
  399. p.is_payment_send,
  400. p.is_ele_order_send,
  401. p.is_customs_send
  402. FROM
  403. mall_order o
  404. LEFT JOIN sys_user u ON o.user_id = u.user_id
  405. LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
  406. left join mall_store s on o.store_id = s.id
  407. WHERE 1=1
  408. <if test="storeId != null and storeId != ''">
  409. AND o.store_id = #{storeId}
  410. </if>
  411. <if test="merchSn != null and merchSn.trim() != ''">
  412. AND o.merch_sn = #{merchSn}
  413. </if>
  414. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  415. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  416. </if>
  417. <if test="orderSn != null and orderSn.trim() != ''">
  418. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  419. </if>
  420. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  421. AND o.shipping_status = #{shippingStatus}
  422. </if>
  423. <if test="payStatus != null and payStatus.trim() != ''">
  424. AND o.pay_status = #{payStatus}
  425. </if>
  426. <if test="orderStatus != null and orderStatus.trim() != ''">
  427. AND o.order_status = #{orderStatus}
  428. </if>
  429. <if test="shippingId != null and shippingId != 0">
  430. AND o.shipping_id = #{shippingId}
  431. </if>
  432. <if test="orderType != null and orderType.trim() != ''">
  433. AND o.order_type = #{orderType}
  434. </if>
  435. <if test="isOnfiilineOrder != null">
  436. AND o.is_onffline_order = #{isOnfiilineOrder}
  437. </if>
  438. <if test="ids != null and ids.trim() != ''">
  439. AND o.id in (${ids})
  440. </if>
  441. <choose>
  442. <when test="sidx != null and sidx.trim() != ''">
  443. order by ${sidx} ${order}
  444. </when>
  445. <otherwise>
  446. order by id desc
  447. </otherwise>
  448. </choose>
  449. <if test="offset != null and limit != null">
  450. limit #{offset}, #{limit}
  451. </if>
  452. </select>
  453. <insert id="save" parameterType="com.kmall.admin.entity.OrderEntity" useGeneratedKeys="true" keyProperty="id">
  454. insert into mall_order
  455. (
  456. `order_sn`,
  457. `user_id`,
  458. `order_status`,
  459. `shipping_status`,
  460. `pay_status`,
  461. `consignee`,
  462. `country`,
  463. `province`,
  464. `city`,
  465. `district`,
  466. `address`,
  467. `mobile`,
  468. `postscript`,
  469. `shipping_id`,
  470. `shipping_name`,
  471. `shipping_code`,
  472. `shipping_no`,
  473. `pay_id`,
  474. `pay_name`,
  475. `shipping_fee`,
  476. `actual_price`,
  477. `integral`,
  478. `integral_money`,
  479. `order_price`,
  480. `goods_price`,
  481. `add_time`,
  482. `confirm_time`,
  483. `pay_time`,
  484. `freight_price`,
  485. `coupon_id`,
  486. `coupon_price`,
  487. full_cut_price,
  488. camp_minus_id,
  489. camp_name,
  490. `callback_status`,
  491. `order_type`,
  492. `store_id`,
  493. `order_biz_type`,
  494. `is_onffline_order`,
  495. `order_sn_wx`,
  496. `pay_flag`,
  497. `merch_sn`,
  498. `create_time`,
  499. `mod_time`
  500. )
  501. values
  502. (
  503. #{orderSn},
  504. #{userId},
  505. #{orderStatus},
  506. #{shippingStatus},
  507. #{payStatus},
  508. #{consignee},
  509. #{country},
  510. #{province},
  511. #{city},
  512. #{district},
  513. #{address},
  514. #{mobile},
  515. #{postscript},
  516. #{shippingId},
  517. #{shippingName},
  518. #{shippingCode},
  519. #{shippingNo},
  520. #{payId},
  521. #{payName},
  522. #{shippingFee},
  523. #{actualPrice},
  524. #{integral},
  525. #{integralMoney},
  526. #{orderPrice},
  527. #{goodsPrice},
  528. #{addTime},
  529. #{confirmTime},
  530. #{payTime},
  531. #{freightPrice},
  532. #{couponId},
  533. #{couponPrice},
  534. #{fullCutPrice},
  535. #{campMinusId},
  536. #{campName},
  537. #{callbackStatus},
  538. #{orderType},
  539. #{storeId},
  540. #{orderBizType},
  541. #{isOnfflineOrder},
  542. #{orderSnWx},
  543. #{payFlag},
  544. #{merchSn},
  545. #{createTime},
  546. #{modTime}
  547. )
  548. </insert>
  549. <update id="update" parameterType="com.kmall.admin.entity.OrderEntity">
  550. update mall_order
  551. <set>
  552. <if test="orderSn != null">`order_sn` = #{orderSn},</if>
  553. <if test="userId != null">`user_id` = #{userId},</if>
  554. <if test="orderStatus != null">`order_status` = #{orderStatus},</if>
  555. <if test="shippingStatus != null">`shipping_status` = #{shippingStatus},</if>
  556. <if test="payStatus != null">`pay_status` = #{payStatus},</if>
  557. <if test="consignee != null">`consignee` = #{consignee},</if>
  558. <if test="country != null">`country` = #{country},</if>
  559. <if test="province != null">`province` = #{province},</if>
  560. <if test="city != null">`city` = #{city},</if>
  561. <if test="district != null">`district` = #{district},</if>
  562. <if test="address != null">`address` = #{address},</if>
  563. <if test="mobile != null">`mobile` = #{mobile},</if>
  564. <if test="postscript != null">`postscript` = #{postscript},</if>
  565. <if test="shippingId != null">`shipping_id` = #{shippingId},</if>
  566. <if test="shippingName != null">`shipping_name` = #{shippingName},</if>
  567. <if test="shippingCode != null">`shipping_code` = #{shippingCode},</if>
  568. <if test="shippingNo != null">`shipping_no` = #{shippingNo},</if>
  569. <if test="payId != null">`pay_id` = #{payId},</if>
  570. <if test="payName != null">`pay_name` = #{payName},</if>
  571. <if test="shippingFee != null">`shipping_fee` = #{shippingFee},</if>
  572. <if test="actualPrice != null">`actual_price` = #{actualPrice},</if>
  573. <if test="integral != null">`integral` = #{integral},</if>
  574. <if test="integralMoney != null">`integral_money` = #{integralMoney},</if>
  575. <if test="orderPrice != null">`order_price` = #{orderPrice},</if>
  576. <if test="goodsPrice != null">`goods_price` = #{goodsPrice},</if>
  577. <if test="addTime != null">`add_time` = #{addTime},</if>
  578. <if test="confirmTime != null">`confirm_time` = #{confirmTime},</if>
  579. <if test="payTime != null">`pay_time` = #{payTime},</if>
  580. <if test="freightPrice != null">`freight_price` = #{freightPrice},</if>
  581. <if test="couponId != null">`coupon_id` = #{couponId},</if>
  582. <if test="couponPrice != null">`coupon_price` = #{couponPrice},</if>
  583. <if test="fullCutPrice != null">`full_cut_price` = #{fullCutPrice},</if>
  584. <if test="campMinusId != null">`camp_minus_id` = #{campMinusId},</if>
  585. <if test="campName != null">`camp_name` = #{campName},</if>
  586. <if test="callbackStatus != null">`callback_status` = #{callbackStatus},</if>
  587. <if test="orderType != null">`order_type` = #{orderType},</if>
  588. <if test="storeId != null">`store_id` = #{storeId},</if>
  589. <if test="payFlag != null">`pay_flag` = #{payFlag},</if>
  590. <if test="orderSnWx != null">`order_sn_wx` = #{orderSnWx},</if>
  591. <if test="orderBizType != null">`order_biz_type` = #{orderBizType},</if>
  592. <if test="merchSn != null">`merch_sn` = #{merchSn},</if>
  593. <if test="createTime != null">`create_time` = #{createTime},</if>
  594. <if test="modTime != null">`mod_time` = #{modTime},</if>
  595. <if test="createrSn != null">`creater_sn` = #{createrSn},</if>
  596. <if test="moderSn != null">`moder_sn` = #{moderSn},</if>
  597. </set>
  598. where id = #{id}
  599. </update>
  600. <delete id="delete">
  601. delete from mall_order where id = #{value}
  602. </delete>
  603. <delete id="deleteBatch">
  604. delete from mall_order where id in
  605. <foreach item="id" collection="array" open="(" separator="," close=")">
  606. #{id}
  607. </foreach>
  608. </delete>
  609. <update id="riderOrderUpdate" parameterType="com.kmall.admin.entity.OrderEntity">
  610. update mall_order
  611. <set>
  612. `order_status` = #{orderStatus},
  613. `shipping_status` = #{shippingStatus},
  614. `shipping_id` = #{shippingId},
  615. `shipping_name` = #{shippingName},
  616. `shipping_fee` = #{shippingFee},
  617. `shipping_no` = #{shippingNo},
  618. `shipping_mobile` = #{shippingMobile}
  619. </set>
  620. where id = #{id}
  621. </update>
  622. <select id="getYfkOrderUserSum" resultType="int">
  623. select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
  624. 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
  625. left join mall_store s on o.store_id = s.id
  626. where pay_status = 2
  627. <if test="storeId != null and storeId != ''">
  628. AND o.store_id = #{storeId}
  629. </if>
  630. <if test="merchSn != null and merchSn.trim() != ''">
  631. AND o.merch_sn = #{merchSn}
  632. </if>
  633. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  634. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  635. </if>
  636. group by o.user_id) u
  637. </select>
  638. <select id="getOderUserSum" resultType="int">
  639. select count(1) from (select o.user_id,count(o.user_id) as counts from mall_order o
  640. 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
  641. left join mall_store s on o.store_id = s.id
  642. where 1=1
  643. <if test="storeId != null and storeId != ''">
  644. AND o.store_id = #{storeId}
  645. </if>
  646. <if test="merchSn != null and merchSn.trim() != ''">
  647. AND o.merch_sn = #{merchSn}
  648. </if>
  649. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  650. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  651. </if>
  652. group by o.user_id) u
  653. </select>
  654. <select id="getTodayUserOrder" resultType="int">
  655. select count(1) from mall_order o
  656. left join mall_store s on o.store_id = s.id
  657. where pay_status = 2 and pay_time > date_format(sysdate(), '%Y-%m-%d')
  658. <if test="storeId != null and storeId != ''">
  659. AND o.store_id = #{storeId}
  660. </if>
  661. <if test="merchSn != null and merchSn.trim() != ''">
  662. AND o.merch_sn = #{merchSn}
  663. </if>
  664. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  665. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  666. </if>
  667. </select>
  668. <select id="getTodayUserSales" resultType="int">
  669. select ifnull(sum(o.actual_price),0) from mall_order o
  670. 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')
  671. <if test="storeId != null and storeId != ''">
  672. AND o.store_id = #{storeId}
  673. </if>
  674. <if test="merchSn != null and merchSn.trim() != ''">
  675. AND o.merch_sn = #{merchSn}
  676. </if>
  677. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  678. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  679. </if>
  680. </select>
  681. <select id="getIncomeSum" resultType="int">
  682. select ifnull(sum(actual_price),0) from mall_order o
  683. left join mall_store s on o.store_id = s.id where o.pay_status = 2
  684. <if test="storeId != null and storeId != ''">
  685. AND o.store_id = #{storeId}
  686. </if>
  687. <if test="merchSn != null and merchSn.trim() != ''">
  688. AND o.merch_sn = #{merchSn}
  689. </if>
  690. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  691. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  692. </if>
  693. </select>
  694. <select id="getPayedOrderCount" resultType="int">
  695. select count(1) from mall_order o
  696. left join mall_store s on o.store_id = s.id where o.pay_status = 2 and o.is_onffline_order = 0
  697. <if test="storeId != null and storeId != ''">
  698. AND o.store_id = #{storeId}
  699. </if>
  700. <if test="merchSn != null and merchSn.trim() != ''">
  701. AND o.merch_sn = #{merchSn}
  702. </if>
  703. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  704. AND s.third_party_merch_code = #{thirdPartyMerchCode}
  705. </if>
  706. </select>
  707. <select id="promOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  708. SELECT
  709. s.prom_id,
  710. o.id,
  711. o.order_sn,
  712. o.merch_order_sn,
  713. o.actual_price,
  714. o.freight_price,
  715. o.activity_id,
  716. o.order_status,
  717. o.pay_status,
  718. store.store_name storeName,
  719. u.userName userName,
  720. o.buyer_pay_check,
  721. o.order_price,
  722. o.coupon_name couponName,
  723. o.add_time,
  724. o.shipping_status,
  725. (select count(1) from mall_order_goods where order_id = o.id) orderDetailCount,
  726. g.goods_id goodsId
  727. FROM
  728. mk_store_prom_stat s
  729. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  730. LEFT JOIN mall_order o ON r.order_id = o.id
  731. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  732. AND g.id = r.order_goods_id
  733. LEFT JOIN mall_store store ON o.store_id = store.id
  734. LEFT JOIN mall_user u ON o.user_id = u.id
  735. WHERE
  736. r.order_id IS NOT NULL
  737. <if test="promId != null and promId != ''">
  738. AND s.prom_id = #{promId}
  739. </if>
  740. <if test="startTime != null and startTime != ''">
  741. AND o.add_time <![CDATA[ > ]]> #{startTime}
  742. </if>
  743. <if test="endTime != null and endTime != ''">
  744. AND o.add_time <![CDATA[ < ]]> #{endTime}
  745. </if>
  746. <if test="storeId != null and storeId != ''">
  747. AND o.store_id = #{storeId}
  748. </if>
  749. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  750. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  751. </if>
  752. <if test="orderBizType != null and orderBizType != ''">
  753. AND o.order_biz_type = #{orderBizType}
  754. </if>
  755. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  756. AND o.merch_order_sn = #{merchOrderSn}
  757. </if>
  758. <if test="merchSn != null and merchSn.trim() != ''">
  759. AND o.merch_sn = #{merchSn}
  760. </if>
  761. <if test="orderSn != null and orderSn.trim() != ''">
  762. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  763. </if>
  764. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  765. AND o.shipping_status = #{shippingStatus}
  766. </if>
  767. <if test="payStatus != null and payStatus.trim() != ''">
  768. AND o.pay_status = #{payStatus}
  769. </if>
  770. <if test="orderStatus != null and orderStatus.trim() != ''">
  771. AND o.order_status = #{orderStatus}
  772. </if>
  773. <if test="shippingId != null and shippingId != 0">
  774. AND o.shipping_id = #{shippingId}
  775. </if>
  776. <if test="orderType != null and orderType.trim() != ''">
  777. AND o.order_type = #{orderType}
  778. </if>
  779. <if test="isOnfiilineOrder != null">
  780. AND o.is_onffline_order = #{isOnfiilineOrder}
  781. </if>
  782. <choose>
  783. <when test="sidx != null and sidx.trim() != ''">
  784. order by ${sidx} ${order}
  785. </when>
  786. <otherwise>
  787. order by o.id desc
  788. </otherwise>
  789. </choose>
  790. <if test="offset != null and limit != null">
  791. limit #{offset}, #{limit}
  792. </if>
  793. </select>
  794. <select id="queryPromOrderTotal" resultType="int">
  795. SELECT
  796. count(*)
  797. FROM
  798. mk_store_prom_stat s
  799. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  800. LEFT JOIN mall_order o ON r.order_id = o.id
  801. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  802. AND g.id = r.order_goods_id
  803. LEFT JOIN mall_store store ON o.store_id = store.id
  804. LEFT JOIN mall_user u ON o.user_id = u.id
  805. WHERE
  806. r.order_id IS NOT NULL
  807. <if test="promId != null and promId != ''">
  808. AND s.prom_id = #{promId}
  809. </if>
  810. <if test="startTime != null and startTime != ''">
  811. AND o.add_time <![CDATA[ > ]]> #{startTime}
  812. </if>
  813. <if test="endTime != null and endTime != ''">
  814. AND o.add_time <![CDATA[ < ]]> #{endTime}
  815. </if>
  816. <if test="storeId != null and storeId != ''">
  817. AND o.store_id = #{storeId}
  818. </if>
  819. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  820. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  821. </if>
  822. <if test="orderBizType != null and orderBizType != ''">
  823. AND o.order_biz_type = #{orderBizType}
  824. </if>
  825. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  826. AND o.merch_order_sn = #{merchOrderSn}
  827. </if>
  828. <if test="merchSn != null and merchSn.trim() != ''">
  829. AND o.merch_sn = #{merchSn}
  830. </if>
  831. <if test="orderSn != null and orderSn.trim() != ''">
  832. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  833. </if>
  834. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  835. AND o.shipping_status = #{shippingStatus}
  836. </if>
  837. <if test="payStatus != null and payStatus.trim() != ''">
  838. AND o.pay_status = #{payStatus}
  839. </if>
  840. <if test="orderStatus != null and orderStatus.trim() != ''">
  841. AND o.order_status = #{orderStatus}
  842. </if>
  843. <if test="shippingId != null and shippingId != 0">
  844. AND o.shipping_id = #{shippingId}
  845. </if>
  846. <if test="orderType != null and orderType.trim() != ''">
  847. AND o.order_type = #{orderType}
  848. </if>
  849. <if test="isOnfiilineOrder != null">
  850. AND o.is_onffline_order = #{isOnfiilineOrder}
  851. </if>
  852. </select>
  853. <select id="promOrderListExport" resultType="com.kmall.admin.entity.OrderEntity">
  854. SELECT
  855. s.prom_id,
  856. o.id,
  857. o.order_sn,
  858. o.merch_order_sn,
  859. o.actual_price,
  860. g.goods_name,
  861. g.number,
  862. g.retail_price,
  863. o.freight_price,
  864. o.activity_id,
  865. o.order_status,
  866. o.pay_status,
  867. store.store_name storeName,
  868. u.userName userName,
  869. o.buyer_pay_check,
  870. o.order_price,
  871. o.add_time,
  872. o.shipping_status,
  873. g.goods_id goodsId
  874. FROM
  875. mk_store_prom_stat s
  876. LEFT JOIN mk_store_prom_order_real r ON s.prom_id = r.prom_id
  877. LEFT JOIN mall_order o ON r.order_id = o.id
  878. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  879. AND g.id = r.order_goods_id
  880. LEFT JOIN mall_store store ON o.store_id = store.id
  881. LEFT JOIN mall_user u ON o.user_id = u.id
  882. WHERE
  883. r.order_id IS NOT NULL
  884. <if test="promId != null and promId != ''">
  885. AND s.prom_id = #{promId}
  886. </if>
  887. <if test="startTime != null and startTime != ''">
  888. AND o.add_time <![CDATA[ > ]]> #{startTime}
  889. </if>
  890. <if test="endTime != null and endTime != ''">
  891. AND o.add_time <![CDATA[ < ]]> #{endTime}
  892. </if>
  893. <if test="storeId != null and storeId != ''">
  894. AND o.store_id = #{storeId}
  895. </if>
  896. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  897. AND store.third_party_merch_code = #{thirdPartyMerchCode}
  898. </if>
  899. <if test="orderBizType != null and orderBizType != ''">
  900. AND o.order_biz_type = #{orderBizType}
  901. </if>
  902. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  903. AND o.merch_order_sn = #{merchOrderSn}
  904. </if>
  905. <if test="merchSn != null and merchSn.trim() != ''">
  906. AND o.merch_sn = #{merchSn}
  907. </if>
  908. <if test="orderSn != null and orderSn.trim() != ''">
  909. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  910. </if>
  911. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  912. AND o.shipping_status = #{shippingStatus}
  913. </if>
  914. <if test="payStatus != null and payStatus.trim() != ''">
  915. AND o.pay_status = #{payStatus}
  916. </if>
  917. <if test="orderStatus != null and orderStatus.trim() != ''">
  918. AND o.order_status = #{orderStatus}
  919. </if>
  920. <if test="shippingId != null and shippingId != 0">
  921. AND o.shipping_id = #{shippingId}
  922. </if>
  923. <if test="orderType != null and orderType.trim() != ''">
  924. AND o.order_type = #{orderType}
  925. </if>
  926. <if test="isOnfiilineOrder != null">
  927. AND o.is_onffline_order = #{isOnfiilineOrder}
  928. </if>
  929. </select>
  930. <select id="getActualPriceByOutProm" parameterType="map" resultType="java.lang.Double">
  931. SELECT
  932. o.actual_price - ( o.actual_price - g.retail_price * g.number ) promActualPrice
  933. FROM
  934. mk_store_prom_order_real r
  935. LEFT JOIN mall_order o ON r.order_id = o.id
  936. LEFT JOIN mall_order_goods g ON o.id = g.order_id
  937. AND g.id = r.order_goods_id
  938. WHERE 1=1
  939. AND g.goods_id = #{goodsId}
  940. AND r.order_id = #{orderId}
  941. <if test="statusList != null">
  942. AND o.order_status IN
  943. <foreach item="statusList" collection="statusList" open="(" separator="," close=")">
  944. #{statusList}
  945. </foreach>
  946. </if>
  947. </select>
  948. <select id="storeTopicOrderList" resultType="com.kmall.admin.entity.OrderEntity">
  949. SELECT
  950. s.title 'storeTopicName',
  951. pt.prom_type_name 'storeTopicType',
  952. ss.store_name 'storeName',
  953. s.id 'storeTopicId',
  954. o.id,
  955. o.order_sn,
  956. o.merch_order_sn,
  957. o.actual_price,
  958. o.freight_price,
  959. o.activity_id,
  960. o.coupon_id,
  961. o.coupon_name,
  962. o.camp_minus_id,
  963. o.camp_name,
  964. o.order_status,
  965. o.pay_status,
  966. u.userName userName,
  967. o.order_price,
  968. o.add_time,
  969. o.shipping_status
  970. FROM
  971. mall_order o
  972. INNER JOIN mall_store_topic s ON o.activity_id = s.id
  973. LEFT JOIN mk_store_prom_type pt ON s.prom_type_id = pt.prom_type_id
  974. LEFT JOIN mall_store ss ON o.store_id = ss.id
  975. LEFT JOIN mall_user u ON o.user_id = u.id
  976. WHERE
  977. 1=1
  978. <if test="storeTopicId != null and storeTopicId != ''">
  979. AND s.id = #{storeTopicId}
  980. </if>
  981. <if test="startTime != null and startTime != ''">
  982. AND o.add_time <![CDATA[ > ]]> #{startTime}
  983. </if>
  984. <if test="endTime != null and endTime != ''">
  985. AND o.add_time <![CDATA[ < ]]> #{endTime}
  986. </if>
  987. <if test="storeId != null and storeId != ''">
  988. AND o.store_id = #{storeId}
  989. </if>
  990. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  991. AND ss.third_party_merch_code = #{thirdPartyMerchCode}
  992. </if>
  993. <if test="orderBizType != null and orderBizType != ''">
  994. AND o.order_biz_type = #{orderBizType}
  995. </if>
  996. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  997. AND o.merch_order_sn = #{merchOrderSn}
  998. </if>
  999. <if test="merchSn != null and merchSn.trim() != ''">
  1000. AND o.merch_sn = #{merchSn}
  1001. </if>
  1002. <if test="orderSn != null and orderSn.trim() != ''">
  1003. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1004. </if>
  1005. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1006. AND o.shipping_status = #{shippingStatus}
  1007. </if>
  1008. <if test="payStatus != null and payStatus.trim() != ''">
  1009. AND o.pay_status = #{payStatus}
  1010. </if>
  1011. <if test="orderStatus != null and orderStatus.trim() != ''">
  1012. AND o.order_status = #{orderStatus}
  1013. </if>
  1014. <if test="shippingId != null and shippingId != 0">
  1015. AND o.shipping_id = #{shippingId}
  1016. </if>
  1017. <if test="orderType != null and orderType.trim() != ''">
  1018. AND o.order_type = #{orderType}
  1019. </if>
  1020. <if test="isOnfiilineOrder != null">
  1021. AND o.is_onffline_order = #{isOnfiilineOrder}
  1022. </if>
  1023. order by o.id DESC
  1024. <if test="offset != null and limit != null">
  1025. limit #{offset}, #{limit}
  1026. </if>
  1027. </select>
  1028. <select id="queryStoreTopicOrderTotal" resultType="int">
  1029. SELECT
  1030. count(*)
  1031. FROM
  1032. mall_order o
  1033. INNER JOIN mall_store_topic s ON o.activity_id = s.id
  1034. LEFT JOIN mk_store_prom_type pt ON s.prom_type_id = pt.prom_type_id
  1035. LEFT JOIN mall_store ss ON o.store_id = ss.id
  1036. LEFT JOIN mall_user u ON o.user_id = u.id
  1037. WHERE 1=1
  1038. <if test="storeTopicId != null and storeTopicId != ''">
  1039. AND s.id = #{storeTopicId}
  1040. </if>
  1041. <if test="startTime != null and startTime != ''">
  1042. AND o.add_time <![CDATA[ > ]]> #{startTime}
  1043. </if>
  1044. <if test="endTime != null and endTime != ''">
  1045. AND o.add_time <![CDATA[ < ]]> #{endTime}
  1046. </if>
  1047. <if test="storeId != null and storeId != ''">
  1048. AND o.store_id = #{storeId}
  1049. </if>
  1050. <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
  1051. AND ss.third_party_merch_code = #{thirdPartyMerchCode}
  1052. </if>
  1053. <if test="orderBizType != null and orderBizType != ''">
  1054. AND o.order_biz_type = #{orderBizType}
  1055. </if>
  1056. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  1057. AND o.merch_order_sn = #{merchOrderSn}
  1058. </if>
  1059. <if test="merchSn != null and merchSn.trim() != ''">
  1060. AND o.merch_sn = #{merchSn}
  1061. </if>
  1062. <if test="orderSn != null and orderSn.trim() != ''">
  1063. AND o.order_sn LIKE concat('%',#{orderSn},'%')
  1064. </if>
  1065. <if test="shippingStatus != null and shippingStatus.trim() != ''">
  1066. AND o.shipping_status = #{shippingStatus}
  1067. </if>
  1068. <if test="payStatus != null and payStatus.trim() != ''">
  1069. AND o.pay_status = #{payStatus}
  1070. </if>
  1071. <if test="orderStatus != null and orderStatus.trim() != ''">
  1072. AND o.order_status = #{orderStatus}
  1073. </if>
  1074. <if test="shippingId != null and shippingId != 0">
  1075. AND o.shipping_id = #{shippingId}
  1076. </if>
  1077. <if test="orderType != null and orderType.trim() != ''">
  1078. AND o.order_type = #{orderType}
  1079. </if>
  1080. <if test="isOnfiilineOrder != null">
  1081. AND o.is_onffline_order = #{isOnfiilineOrder}
  1082. </if>
  1083. </select>
  1084. </mapper>