OrderSubmitMapper.xml 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.caimei.mapper.OrderSubmitMapper">
  6. <select id="findShopByCartIds" resultType="com.caimei.model.vo.ShopVo">
  7. SELECT DISTINCT
  8. s.shopID AS shopId,
  9. s.name,
  10. s.logo,
  11. p.returnGoodsStutas,
  12. p.splitCode
  13. FROM
  14. cm_cart cc
  15. LEFT JOIN product p ON cc.productID = p.productID
  16. LEFT JOIN shop s ON p.shopID = s.shopID
  17. WHERE
  18. cc.cm_cartID IN
  19. <foreach item="cartId" index="index" collection="cartIds" open="(" separator="," close=")">
  20. #{cartId}
  21. </foreach>
  22. group by cc.shopID
  23. ORDER BY
  24. cc.addTime DESC
  25. </select>
  26. <select id="findByShopCartProduct" resultType="com.caimei.model.vo.CartProductVo">
  27. SELECT
  28. cc.skuId,
  29. cc.cm_cartID AS cartId,
  30. cc.productID AS productId,
  31. cc.productCount as num,
  32. cc.heUserId,
  33. chs.price,
  34. chs.price as normalPrice,
  35. chp.includedTax,
  36. chp.invoiceType,
  37. chp.clubTaxPoint,
  38. p.name,
  39. p.shopID AS shopId,
  40. p.mainImage as productImage,
  41. cs.unit as productUnit
  42. FROM cm_cart cc
  43. LEFT JOIN cm_sku cs on cc.skuId=cs.skuId
  44. LEFT JOIN cm_hehe_sku chs on cc.skuId=chs.skuId
  45. LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId
  46. LEFT JOIN product p ON cc.productID = p.productID
  47. WHERE
  48. chp.validFlag = 1
  49. AND p.shopID = #{shopId}
  50. and p.splitCode = #{splitCode}
  51. AND cc.cm_cartID IN
  52. <foreach item="cartId" index="index" collection="cartIds" open="(" separator="," close=")">
  53. #{cartId}
  54. </foreach>
  55. </select>
  56. <select id="findUser" resultType="com.caimei.model.po.UserPo">
  57. SELECT userID,
  58. mobile,
  59. bindMobile,
  60. userName,
  61. name
  62. FROM user
  63. WHERE userID = #{userId}
  64. </select>
  65. <select id="getProduct" resultType="com.caimei.model.po.CmHeHeProductPo">
  66. SELECT cs.skuId,
  67. chp.id,
  68. chp.productId,
  69. chs.price,
  70. chs.price as normalPrice,
  71. chp.includedTax,
  72. chp.invoiceType,
  73. cs.costCheckFlag AS costType,
  74. chp.clubTaxPoint,
  75. chp.shopTaxPoint,
  76. cs.costPrice,
  77. cs.costProportional,
  78. p.shopID AS shopId,
  79. cs.unit,
  80. p.name,
  81. p.mainImage,
  82. p.splitCode,
  83. s.name AS shopName
  84. FROM cm_hehe_product chp
  85. LEFT JOIN cm_sku cs on cs.productId = chp.productId
  86. LEFT JOIN cm_hehe_sku chs on cs.skuId=chs.skuId
  87. LEFT JOIN product p ON chp.productId = p.productID
  88. LEFT JOIN shop s ON p.shopID = s.shopID
  89. WHERE cs.skuId = #{skuId}
  90. </select>
  91. <delete id="deleteCartByProductId">
  92. DELETE
  93. FROM cm_cart
  94. WHERE userID = #{userId}
  95. AND skuId = #{skuId}
  96. AND heUserId = #{heUserId}
  97. </delete>
  98. <insert id="insertOrder" keyColumn="orderID" keyProperty="orderID" parameterType="com.caimei.model.po.CmOrderPo"
  99. useGeneratedKeys="true">
  100. insert into cm_order
  101. <trim prefix="(" suffix=")" suffixOverrides=",">
  102. <if test="orderNo != null">
  103. orderNo,
  104. </if>
  105. <if test="organizeID != null">
  106. organizeID,
  107. </if>
  108. <if test="userID != null">
  109. userID,
  110. </if>
  111. <if test="buyUserID != null">
  112. buyUserID,
  113. </if>
  114. <if test="shopOrderIDs != null">
  115. shopOrderIDs,
  116. </if>
  117. <if test="orderSubmitType != null">
  118. orderSubmitType,
  119. </if>
  120. <if test="orderType != null">
  121. orderType,
  122. </if>
  123. <if test="secondHandOrderFlag != null">
  124. secondHandOrderFlag,
  125. </if>
  126. <if test="hasActProduct != null">
  127. hasActProduct,
  128. </if>
  129. <if test="status != null">
  130. `status`,
  131. </if>
  132. <if test="receiptStatus != null">
  133. receiptStatus,
  134. </if>
  135. <if test="payStatus != null">
  136. payStatus,
  137. </if>
  138. <if test="sendOutStatus != null">
  139. sendOutStatus,
  140. </if>
  141. <if test="refundType != null">
  142. refundType,
  143. </if>
  144. <if test="payFlag != null">
  145. payFlag,
  146. </if>
  147. <if test="onlinePayFlag != null">
  148. onlinePayFlag,
  149. </if>
  150. <if test="productTotalFee != null">
  151. productTotalFee,
  152. </if>
  153. <if test="orderTotalFee != null">
  154. orderTotalFee,
  155. </if>
  156. <if test="payTotalFee != null">
  157. payTotalFee,
  158. </if>
  159. <if test="payableAmount != null">
  160. payableAmount,
  161. </if>
  162. <if test="balancePayFee != null">
  163. balancePayFee,
  164. </if>
  165. <if test="preferential != null">
  166. preferential,
  167. </if>
  168. <if test="discountFee != null">
  169. discountFee,
  170. </if>
  171. <if test="promotionFullReduction != null">
  172. promotionFullReduction,
  173. </if>
  174. <if test="spID != null">
  175. spID,
  176. </if>
  177. <if test="mainSpID != null">
  178. mainSpID,
  179. </if>
  180. <if test="note != null">
  181. note,
  182. </if>
  183. <if test="clubID != null">
  184. clubID,
  185. </if>
  186. <if test="clubScanTime != null">
  187. clubScanTime,
  188. </if>
  189. <if test="orderSource != null">
  190. orderSource,
  191. </if>
  192. <if test="closeTime != null">
  193. closeTime,
  194. </if>
  195. <if test="confirmTime != null">
  196. confirmTime,
  197. </if>
  198. <if test="payTime != null">
  199. payTime,
  200. </if>
  201. <if test="orderTime != null">
  202. orderTime,
  203. </if>
  204. <if test="productCount != null">
  205. productCount,
  206. </if>
  207. <if test="presentCount != null">
  208. presentCount,
  209. </if>
  210. <if test="promotionalGiftsCount != null">
  211. promotionalGiftsCount,
  212. </if>
  213. <if test="invoiceFlag != null">
  214. invoiceFlag,
  215. </if>
  216. <if test="confirmFlag != null">
  217. confirmFlag,
  218. </if>
  219. <if test="clauseID != null">
  220. clauseID,
  221. </if>
  222. <if test="clauseContent != null">
  223. clauseContent,
  224. </if>
  225. <if test="clauseName != null">
  226. clauseName,
  227. </if>
  228. <if test="updateDate != null">
  229. updateDate,
  230. </if>
  231. <if test="freePostFlag != null">
  232. freePostFlag,
  233. </if>
  234. <if test="freight != null">
  235. freight,
  236. </if>
  237. <if test="couponAmount != null">
  238. couponAmount,
  239. </if>
  240. <if test="reductionAmount != null">
  241. reductionAmount,
  242. </if>
  243. <if test="delFlag != null">
  244. delFlag,
  245. </if>
  246. <if test="freePostageTicketID != null">
  247. freePostageTicketID,
  248. </if>
  249. <if test="splitFlag != null">
  250. splitFlag,
  251. </if>
  252. <if test="closeReason != null">
  253. closeReason,
  254. </if>
  255. <if test="postageOrderFlag != null">
  256. postageOrderFlag,
  257. </if>
  258. <if test="thirdPartyOrderNo != null">
  259. thirdPartyOrderNo,
  260. </if>
  261. <if test="affirmPaymentFlag != null">
  262. affirmPaymentFlag,
  263. </if>
  264. <if test="rebateFlag != null">
  265. rebateFlag,
  266. </if>
  267. <if test="zeroCostFlag != null">
  268. zeroCostFlag,
  269. </if>
  270. </trim>
  271. <trim prefix="values (" suffix=")" suffixOverrides=",">
  272. <if test="orderNo != null">
  273. #{orderNo,jdbcType=VARCHAR},
  274. </if>
  275. <if test="organizeID != null">
  276. #{organizeID},
  277. </if>
  278. <if test="userID != null">
  279. #{userID,jdbcType=BIGINT},
  280. </if>
  281. <if test="buyUserID != null">
  282. #{buyUserID,jdbcType=INTEGER},
  283. </if>
  284. <if test="shopOrderIDs != null">
  285. #{shopOrderIDs,jdbcType=VARCHAR},
  286. </if>
  287. <if test="orderSubmitType != null">
  288. #{orderSubmitType,jdbcType=INTEGER},
  289. </if>
  290. <if test="orderType != null">
  291. #{orderType,jdbcType=INTEGER},
  292. </if>
  293. <if test="secondHandOrderFlag != null">
  294. #{secondHandOrderFlag,jdbcType=VARCHAR},
  295. </if>
  296. <if test="hasActProduct != null">
  297. #{hasActProduct,jdbcType=CHAR},
  298. </if>
  299. <if test="status != null">
  300. #{status,jdbcType=CHAR},
  301. </if>
  302. <if test="receiptStatus != null">
  303. #{receiptStatus,jdbcType=CHAR},
  304. </if>
  305. <if test="payStatus != null">
  306. #{payStatus,jdbcType=CHAR},
  307. </if>
  308. <if test="sendOutStatus != null">
  309. #{sendOutStatus,jdbcType=CHAR},
  310. </if>
  311. <if test="refundType != null">
  312. #{refundType,jdbcType=CHAR},
  313. </if>
  314. <if test="payFlag != null">
  315. #{payFlag,jdbcType=CHAR},
  316. </if>
  317. <if test="onlinePayFlag != null">
  318. #{onlinePayFlag,jdbcType=CHAR},
  319. </if>
  320. <if test="productTotalFee != null">
  321. #{productTotalFee,jdbcType=DECIMAL},
  322. </if>
  323. <if test="orderTotalFee != null">
  324. #{orderTotalFee,jdbcType=DECIMAL},
  325. </if>
  326. <if test="payTotalFee != null">
  327. #{payTotalFee,jdbcType=DECIMAL},
  328. </if>
  329. <if test="payableAmount != null">
  330. #{payableAmount,jdbcType=DECIMAL},
  331. </if>
  332. <if test="balancePayFee != null">
  333. #{balancePayFee,jdbcType=DECIMAL},
  334. </if>
  335. <if test="preferential != null">
  336. #{preferential,jdbcType=DECIMAL},
  337. </if>
  338. <if test="discountFee != null">
  339. #{discountFee,jdbcType=DECIMAL},
  340. </if>
  341. <if test="promotionFullReduction != null">
  342. #{promotionFullReduction,jdbcType=DECIMAL},
  343. </if>
  344. <if test="spID != null">
  345. #{spID,jdbcType=BIGINT},
  346. </if>
  347. <if test="mainSpID != null">
  348. #{mainSpID,jdbcType=BIGINT},
  349. </if>
  350. <if test="note != null">
  351. #{note,jdbcType=VARCHAR},
  352. </if>
  353. <if test="clubID != null">
  354. #{clubID,jdbcType=BIGINT},
  355. </if>
  356. <if test="clubScanTime != null">
  357. #{clubScanTime,jdbcType=VARCHAR},
  358. </if>
  359. <if test="orderSource != null">
  360. #{orderSource,jdbcType=CHAR},
  361. </if>
  362. <if test="closeTime != null">
  363. #{closeTime,jdbcType=VARCHAR},
  364. </if>
  365. <if test="confirmTime != null">
  366. #{confirmTime,jdbcType=VARCHAR},
  367. </if>
  368. <if test="payTime != null">
  369. #{payTime,jdbcType=VARCHAR},
  370. </if>
  371. <if test="orderTime != null">
  372. #{orderTime,jdbcType=VARCHAR},
  373. </if>
  374. <if test="productCount != null">
  375. #{productCount,jdbcType=INTEGER},
  376. </if>
  377. <if test="presentCount != null">
  378. #{presentCount,jdbcType=INTEGER},
  379. </if>
  380. <if test="promotionalGiftsCount != null">
  381. #{promotionalGiftsCount,jdbcType=INTEGER},
  382. </if>
  383. <if test="invoiceFlag != null">
  384. #{invoiceFlag,jdbcType=CHAR},
  385. </if>
  386. <if test="confirmFlag != null">
  387. #{confirmFlag,jdbcType=CHAR},
  388. </if>
  389. <if test="clauseID != null">
  390. #{clauseID,jdbcType=BIGINT},
  391. </if>
  392. <if test="clauseContent != null">
  393. #{clauseContent,jdbcType=VARCHAR},
  394. </if>
  395. <if test="clauseName != null">
  396. #{clauseName,jdbcType=VARCHAR},
  397. </if>
  398. <if test="updateDate != null">
  399. #{updateDate,jdbcType=VARCHAR},
  400. </if>
  401. <if test="freePostFlag != null">
  402. #{freePostFlag,jdbcType=CHAR},
  403. </if>
  404. <if test="freight != null">
  405. #{freight,jdbcType=DECIMAL},
  406. </if>
  407. <if test="couponAmount != null">
  408. #{couponAmount,jdbcType=DECIMAL},
  409. </if>
  410. <if test="reductionAmount != null">
  411. #{reductionAmount,jdbcType=DECIMAL},
  412. </if>
  413. <if test="delFlag != null">
  414. #{delFlag,jdbcType=CHAR},
  415. </if>
  416. <if test="freePostageTicketID != null">
  417. #{freePostageTicketID,jdbcType=INTEGER},
  418. </if>
  419. <if test="splitFlag != null">
  420. #{splitFlag,jdbcType=CHAR},
  421. </if>
  422. <if test="closeReason != null">
  423. #{closeReason,jdbcType=VARCHAR},
  424. </if>
  425. <if test="postageOrderFlag != null">
  426. #{postageOrderFlag,jdbcType=CHAR},
  427. </if>
  428. <if test="thirdPartyOrderNo != null">
  429. #{thirdPartyOrderNo,jdbcType=CHAR},
  430. </if>
  431. <if test="affirmPaymentFlag != null">
  432. #{affirmPaymentFlag,jdbcType=CHAR},
  433. </if>
  434. <if test="rebateFlag != null">
  435. #{rebateFlag,jdbcType=CHAR},
  436. </if>
  437. <if test="zeroCostFlag != null">
  438. #{zeroCostFlag,jdbcType=INTEGER},
  439. </if>
  440. </trim>
  441. </insert>
  442. <select id="findMaxShopOrderNo" resultType="java.lang.String">
  443. SELECT shopOrderNo
  444. FROM cm_shop_order
  445. WHERE orderID = #{orderId}
  446. ORDER BY shopOrderNo DESC
  447. LIMIT 1
  448. </select>
  449. <insert id="insertShopOrder" keyColumn="shopOrderID" keyProperty="shopOrderID"
  450. parameterType="com.caimei.model.po.CmShopOrderPo" useGeneratedKeys="true">
  451. insert into cm_shop_order
  452. <trim prefix="(" suffix=")" suffixOverrides=",">
  453. <if test="shopOrderNo != null">
  454. shopOrderNo,
  455. </if>
  456. <if test="orderNo != null">
  457. orderNo,
  458. </if>
  459. <if test="orderID != null">
  460. orderID,
  461. </if>
  462. <if test="organizeID != null">
  463. organizeID,
  464. </if>
  465. <if test="userID != null">
  466. userID,
  467. </if>
  468. <if test="shopID != null">
  469. shopID,
  470. </if>
  471. <if test="orderPromotionsId != null">
  472. orderPromotionsId,
  473. </if>
  474. <if test="orderType != null">
  475. orderType,
  476. </if>
  477. <if test="orderSubmitType != null">
  478. orderSubmitType,
  479. </if>
  480. <if test="presentNum != null">
  481. presentNum,
  482. </if>
  483. <if test="itemCount != null">
  484. itemCount,
  485. </if>
  486. <if test="outStoreNum != null">
  487. outStoreNum,
  488. </if>
  489. <if test="outStoreTimes != null">
  490. outStoreTimes,
  491. </if>
  492. <if test="townID != null">
  493. townID,
  494. </if>
  495. <if test="note != null">
  496. note,
  497. </if>
  498. <if test="accountAmount != null">
  499. accountAmount,
  500. </if>
  501. <if test="productAmount != null">
  502. productAmount,
  503. </if>
  504. <if test="totalAmount != null">
  505. totalAmount,
  506. </if>
  507. <if test="needPayAmount != null">
  508. needPayAmount,
  509. </if>
  510. <if test="discountAmount != null">
  511. discountAmount,
  512. </if>
  513. <if test="preferential != null">
  514. preferential,
  515. </if>
  516. <if test="promotionFullReduction != null">
  517. promotionFullReduction,
  518. </if>
  519. <if test="payFlag != null">
  520. payFlag,
  521. </if>
  522. <if test="orderTime != null">
  523. orderTime,
  524. </if>
  525. <if test="payTime != null">
  526. payTime,
  527. </if>
  528. <if test="finishTime != null">
  529. finishTime,
  530. </if>
  531. <if test="autoOverTimeMills != null">
  532. autoOverTimeMills,
  533. </if>
  534. <if test="payStatus != null">
  535. payStatus,
  536. </if>
  537. <if test="sendOutStatus != null">
  538. sendOutStatus,
  539. </if>
  540. <if test="refundStatus != null">
  541. refundStatus,
  542. </if>
  543. <if test="returnGoodsStatus != null">
  544. returnGoodsStatus,
  545. </if>
  546. <if test="receiveGoodsTime != null">
  547. receiveGoodsTime,
  548. </if>
  549. <if test="autoReceiveTimeMills != null">
  550. autoReceiveTimeMills,
  551. </if>
  552. <if test="totalAddedValueTax != null">
  553. totalAddedValueTax,
  554. </if>
  555. <if test="canRefundAmount != null">
  556. canRefundAmount,
  557. </if>
  558. <if test="refundAmount != null">
  559. refundAmount,
  560. </if>
  561. <if test="clubID != null">
  562. clubID,
  563. </if>
  564. <if test="spID != null">
  565. spID,
  566. </if>
  567. <if test="mainSpID != null">
  568. mainSpID,
  569. </if>
  570. <if test="orderBeanAmount != null">
  571. orderBeanAmount,
  572. </if>
  573. <if test="useBeanAmount != null">
  574. useBeanAmount,
  575. </if>
  576. <if test="useBeanFlag != null">
  577. useBeanFlag,
  578. </if>
  579. <if test="canRefundFlag != null">
  580. canRefundFlag,
  581. </if>
  582. <if test="useBalanceFlag != null">
  583. useBalanceFlag,
  584. </if>
  585. <if test="canRefundBeans != null">
  586. canRefundBeans,
  587. </if>
  588. <if test="freePostageFee != null">
  589. freePostageFee,
  590. </if>
  591. <if test="freePostageTicketID != null">
  592. freePostageTicketID,
  593. </if>
  594. <if test="brokerage != null">
  595. brokerage,
  596. </if>
  597. <if test="delFlag != null">
  598. delFlag,
  599. </if>
  600. <if test="refundsAmount != null">
  601. refundsAmount,
  602. </if>
  603. <if test="orderStatusFlag != null">
  604. orderStatusFlag,
  605. </if>
  606. <if test="buyStatus != null">
  607. buyStatus,
  608. </if>
  609. <if test="deliveryTimeMills != null">
  610. deliveryTimeMills,
  611. </if>
  612. <if test="orderDeliveryID != null">
  613. orderDeliveryID,
  614. </if>
  615. <if test="splitFlag != null">
  616. splitFlag,
  617. </if>
  618. <if test="receiptedFlag != null">
  619. receiptedFlag,
  620. </if>
  621. <if test="receiptedType != null">
  622. receiptedType,
  623. </if>
  624. <if test="paying != null">
  625. paying,
  626. </if>
  627. <if test="shopProductAmount != null">
  628. shopProductAmount,
  629. </if>
  630. <if test="shopPostFee != null">
  631. shopPostFee,
  632. </if>
  633. <if test="shopTaxFee != null">
  634. shopTaxFee,
  635. </if>
  636. <if test="shouldPayShopAmount != null">
  637. shouldPayShopAmount,
  638. </if>
  639. <if test="payedShopAmount != null">
  640. payedShopAmount,
  641. </if>
  642. <if test="shopOtherFee != null">
  643. shopOtherFee,
  644. </if>
  645. <if test="costType != null">
  646. costType,
  647. </if>
  648. <if test="proportional != null">
  649. proportional,
  650. </if>
  651. <if test="modifyShouldPayNote != null">
  652. modifyShouldPayNote,
  653. </if>
  654. <if test="modifyShouldPayUserID != null">
  655. modifyShouldPayUserID,
  656. </if>
  657. <if test="modifyShouldPayDate != null">
  658. modifyShouldPayDate,
  659. </if>
  660. <if test="zeroCostFlag != null">
  661. zeroCostFlag,
  662. </if>
  663. <if test="splitCode != null">
  664. splitCode,
  665. </if>
  666. <if test="realPay != null">
  667. realPay,
  668. </if>
  669. <if test="eachDiscount != null">
  670. eachDiscount,
  671. </if>
  672. <if test="receiptAmount != null">
  673. receiptAmount,
  674. </if>
  675. <if test="receiptStatus != null">
  676. receiptStatus,
  677. </if>
  678. </trim>
  679. <trim prefix="values (" suffix=")" suffixOverrides=",">
  680. <if test="shopOrderNo != null">
  681. #{shopOrderNo,jdbcType=VARCHAR},
  682. </if>
  683. <if test="orderNo != null">
  684. #{orderNo,jdbcType=VARCHAR},
  685. </if>
  686. <if test="orderID != null">
  687. #{orderID,jdbcType=BIGINT},
  688. </if>
  689. <if test="organizeID != null">
  690. #{organizeID},
  691. </if>
  692. <if test="userID != null">
  693. #{userID,jdbcType=INTEGER},
  694. </if>
  695. <if test="shopID != null">
  696. #{shopID,jdbcType=INTEGER},
  697. </if>
  698. <if test="orderPromotionsId != null">
  699. #{orderPromotionsId},
  700. </if>
  701. <if test="orderType != null">
  702. #{orderType,jdbcType=INTEGER},
  703. </if>
  704. <if test="orderSubmitType != null">
  705. #{orderSubmitType,jdbcType=INTEGER},
  706. </if>
  707. <if test="presentNum != null">
  708. #{presentNum,jdbcType=INTEGER},
  709. </if>
  710. <if test="itemCount != null">
  711. #{itemCount,jdbcType=INTEGER},
  712. </if>
  713. <if test="outStoreNum != null">
  714. #{outStoreNum,jdbcType=INTEGER},
  715. </if>
  716. <if test="outStoreTimes != null">
  717. #{outStoreTimes,jdbcType=INTEGER},
  718. </if>
  719. <if test="townID != null">
  720. #{townID,jdbcType=INTEGER},
  721. </if>
  722. <if test="note != null">
  723. #{note,jdbcType=VARCHAR},
  724. </if>
  725. <if test="accountAmount != null">
  726. #{accountAmount,jdbcType=DECIMAL},
  727. </if>
  728. <if test="productAmount != null">
  729. #{productAmount,jdbcType=DECIMAL},
  730. </if>
  731. <if test="totalAmount != null">
  732. #{totalAmount,jdbcType=DECIMAL},
  733. </if>
  734. <if test="needPayAmount != null">
  735. #{needPayAmount,jdbcType=DECIMAL},
  736. </if>
  737. <if test="discountAmount != null">
  738. #{discountAmount,jdbcType=DECIMAL},
  739. </if>
  740. <if test="preferential != null">
  741. #{preferential,jdbcType=DECIMAL},
  742. </if>
  743. <if test="promotionFullReduction != null">
  744. #{promotionFullReduction},
  745. </if>
  746. <if test="payFlag != null">
  747. #{payFlag,jdbcType=CHAR},
  748. </if>
  749. <if test="orderTime != null">
  750. #{orderTime,jdbcType=VARCHAR},
  751. </if>
  752. <if test="payTime != null">
  753. #{payTime,jdbcType=VARCHAR},
  754. </if>
  755. <if test="finishTime != null">
  756. #{finishTime,jdbcType=VARCHAR},
  757. </if>
  758. <if test="autoOverTimeMills != null">
  759. #{autoOverTimeMills,jdbcType=BIGINT},
  760. </if>
  761. <if test="payStatus != null">
  762. #{payStatus,jdbcType=CHAR},
  763. </if>
  764. <if test="sendOutStatus != null">
  765. #{sendOutStatus,jdbcType=CHAR},
  766. </if>
  767. <if test="refundStatus != null">
  768. #{refundStatus,jdbcType=INTEGER},
  769. </if>
  770. <if test="returnGoodsStatus != null">
  771. #{returnGoodsStatus,jdbcType=INTEGER},
  772. </if>
  773. <if test="receiveGoodsTime != null">
  774. #{receiveGoodsTime,jdbcType=VARCHAR},
  775. </if>
  776. <if test="autoReceiveTimeMills != null">
  777. #{autoReceiveTimeMills,jdbcType=BIGINT},
  778. </if>
  779. <if test="totalAddedValueTax != null">
  780. #{totalAddedValueTax,jdbcType=DECIMAL},
  781. </if>
  782. <if test="canRefundAmount != null">
  783. #{canRefundAmount,jdbcType=FLOAT},
  784. </if>
  785. <if test="refundAmount != null">
  786. #{refundAmount,jdbcType=FLOAT},
  787. </if>
  788. <if test="clubID != null">
  789. #{clubID,jdbcType=INTEGER},
  790. </if>
  791. <if test="spID != null">
  792. #{spID,jdbcType=INTEGER},
  793. </if>
  794. <if test="mainSpID != null">
  795. #{mainSpID,jdbcType=INTEGER},
  796. </if>
  797. <if test="orderBeanAmount != null">
  798. #{orderBeanAmount,jdbcType=INTEGER},
  799. </if>
  800. <if test="useBeanAmount != null">
  801. #{useBeanAmount,jdbcType=INTEGER},
  802. </if>
  803. <if test="useBeanFlag != null">
  804. #{useBeanFlag,jdbcType=INTEGER},
  805. </if>
  806. <if test="canRefundFlag != null">
  807. #{canRefundFlag,jdbcType=INTEGER},
  808. </if>
  809. <if test="useBalanceFlag != null">
  810. #{useBalanceFlag,jdbcType=INTEGER},
  811. </if>
  812. <if test="canRefundBeans != null">
  813. #{canRefundBeans,jdbcType=INTEGER},
  814. </if>
  815. <if test="freePostageFee != null">
  816. #{freePostageFee,jdbcType=DECIMAL},
  817. </if>
  818. <if test="freePostageTicketID != null">
  819. #{freePostageTicketID,jdbcType=INTEGER},
  820. </if>
  821. <if test="brokerage != null">
  822. #{brokerage,jdbcType=DECIMAL},
  823. </if>
  824. <if test="delFlag != null">
  825. #{delFlag,jdbcType=VARCHAR},
  826. </if>
  827. <if test="refundsAmount != null">
  828. #{refundsAmount,jdbcType=DECIMAL},
  829. </if>
  830. <if test="orderStatusFlag != null">
  831. #{orderStatusFlag,jdbcType=CHAR},
  832. </if>
  833. <if test="buyStatus != null">
  834. #{buyStatus,jdbcType=VARCHAR},
  835. </if>
  836. <if test="deliveryTimeMills != null">
  837. #{deliveryTimeMills,jdbcType=VARCHAR},
  838. </if>
  839. <if test="orderDeliveryID != null">
  840. #{orderDeliveryID,jdbcType=INTEGER},
  841. </if>
  842. <if test="splitFlag != null">
  843. #{splitFlag,jdbcType=CHAR},
  844. </if>
  845. <if test="receiptedFlag != null">
  846. #{receiptedFlag,jdbcType=VARCHAR},
  847. </if>
  848. <if test="receiptedType != null">
  849. #{receiptedType,jdbcType=VARCHAR},
  850. </if>
  851. <if test="paying != null">
  852. #{paying,jdbcType=CHAR},
  853. </if>
  854. <if test="shopProductAmount != null">
  855. #{shopProductAmount,jdbcType=DECIMAL},
  856. </if>
  857. <if test="shopPostFee != null">
  858. #{shopPostFee,jdbcType=DECIMAL},
  859. </if>
  860. <if test="shopTaxFee != null">
  861. #{shopTaxFee,jdbcType=DECIMAL},
  862. </if>
  863. <if test="shouldPayShopAmount != null">
  864. #{shouldPayShopAmount,jdbcType=DECIMAL},
  865. </if>
  866. <if test="payedShopAmount != null">
  867. #{payedShopAmount,jdbcType=DECIMAL},
  868. </if>
  869. <if test="shopOtherFee != null">
  870. #{shopOtherFee,jdbcType=DECIMAL},
  871. </if>
  872. <if test="costType != null">
  873. #{costType,jdbcType=CHAR},
  874. </if>
  875. <if test="proportional != null">
  876. #{proportional,jdbcType=DECIMAL},
  877. </if>
  878. <if test="modifyShouldPayNote != null">
  879. #{modifyShouldPayNote,jdbcType=VARCHAR},
  880. </if>
  881. <if test="modifyShouldPayUserID != null">
  882. #{modifyShouldPayUserID,jdbcType=BIGINT},
  883. </if>
  884. <if test="modifyShouldPayDate != null">
  885. #{modifyShouldPayDate,jdbcType=TIMESTAMP},
  886. </if>
  887. <if test="zeroCostFlag != null">
  888. #{zeroCostFlag,jdbcType=INTEGER},
  889. </if>
  890. <if test="splitCode != null">
  891. #{splitCode},
  892. </if>
  893. <if test="realPay != null">
  894. #{realPay},
  895. </if>
  896. <if test="eachDiscount != null">
  897. #{eachDiscount},
  898. </if>
  899. <if test="receiptAmount != null">
  900. #{receiptAmount},
  901. </if>
  902. <if test="receiptStatus != null">
  903. #{receiptStatus},
  904. </if>
  905. </trim>
  906. </insert>
  907. <insert id="insertOrderProduct" keyColumn="orderProductID" keyProperty="orderProductID"
  908. parameterType="com.caimei.model.po.CmOrderProductPo" useGeneratedKeys="true">
  909. insert into cm_order_product
  910. <trim prefix="(" suffix=")" suffixOverrides=",">
  911. <if test="skuId != null">
  912. skuId,
  913. </if>
  914. <if test="orderNo != null">
  915. orderNo,
  916. </if>
  917. <if test="orderID != null">
  918. orderID,
  919. </if>
  920. <if test="shopOrderID != null">
  921. shopOrderID,
  922. </if>
  923. <if test="shopOrderNo != null">
  924. shopOrderNo,
  925. </if>
  926. <if test="shopID != null">
  927. shopID,
  928. </if>
  929. <if test="productID != null">
  930. productID,
  931. </if>
  932. <if test="organizeProductID != null">
  933. organizeProductID,
  934. </if>
  935. <if test="organizeID != null">
  936. organizeID,
  937. </if>
  938. <if test="num != null">
  939. num,
  940. </if>
  941. <if test="presentNum != null">
  942. presentNum,
  943. </if>
  944. <if test="outStoreType != null">
  945. outStoreType,
  946. </if>
  947. <if test="productNo != null">
  948. productNo,
  949. </if>
  950. <if test="price != null">
  951. price,
  952. </if>
  953. <if test="normalPrice != null">
  954. normalPrice,
  955. </if>
  956. <if test="costPrice != null">
  957. costPrice,
  958. </if>
  959. <if test="totalAmount != null">
  960. totalAmount,
  961. </if>
  962. <if test="totalFee != null">
  963. totalFee,
  964. </if>
  965. <if test="shouldPayFee != null">
  966. shouldPayFee,
  967. </if>
  968. <if test="discount != null">
  969. discount,
  970. </if>
  971. <if test="discountPrice != null">
  972. discountPrice,
  973. </if>
  974. <if test="taxRate != null">
  975. taxRate,
  976. </if>
  977. <if test="addedValueTax != null">
  978. addedValueTax,
  979. </if>
  980. <if test="totalAddedValueTax != null">
  981. totalAddedValueTax,
  982. </if>
  983. <if test="shouldPayTotalTax != null">
  984. shouldPayTotalTax,
  985. </if>
  986. <if test="singleShouldPayTotalTax != null">
  987. singleShouldPayTotalTax,
  988. </if>
  989. <if test="shopProductAmount != null">
  990. shopProductAmount,
  991. </if>
  992. <if test="shopFee != null">
  993. shopFee,
  994. </if>
  995. <if test="otherFee != null">
  996. otherFee,
  997. </if>
  998. <if test="cmFee != null">
  999. cmFee,
  1000. </if>
  1001. <if test="singleShopFee != null">
  1002. singleShopFee,
  1003. </if>
  1004. <if test="singleOtherFee != null">
  1005. singleOtherFee,
  1006. </if>
  1007. <if test="singleCmFee != null">
  1008. singleCmFee,
  1009. </if>
  1010. <if test="status != null">
  1011. `status`,
  1012. </if>
  1013. <if test="totalBeans != null">
  1014. totalBeans,
  1015. </if>
  1016. <if test="useBalanceAmount != null">
  1017. useBalanceAmount,
  1018. </if>
  1019. <if test="useBeanAmount != null">
  1020. useBeanAmount,
  1021. </if>
  1022. <if test="notOutStore != null">
  1023. notOutStore,
  1024. </if>
  1025. <if test="cmbeanPrice != null">
  1026. cmbeanPrice,
  1027. </if>
  1028. <if test="isActProduct != null">
  1029. isActProduct,
  1030. </if>
  1031. <if test="isGiftProduct != null">
  1032. isGiftProduct,
  1033. </if>
  1034. <if test="productActInfo != null">
  1035. productActInfo,
  1036. </if>
  1037. <if test="buyAgainFlag != null">
  1038. buyAgainFlag,
  1039. </if>
  1040. <if test="confirmProductFlag != null">
  1041. confirmProductFlag,
  1042. </if>
  1043. <if test="payStatus != null">
  1044. payStatus,
  1045. </if>
  1046. <if test="shopName != null">
  1047. shopName,
  1048. </if>
  1049. <if test="name != null">
  1050. `name`,
  1051. </if>
  1052. <if test="productUnit != null">
  1053. productUnit,
  1054. </if>
  1055. <if test="productImage != null">
  1056. productImage,
  1057. </if>
  1058. <if test="actType != null">
  1059. actType,
  1060. </if>
  1061. <if test="actPreferential != null">
  1062. actPreferential,
  1063. </if>
  1064. <if test="productType != null">
  1065. productType,
  1066. </if>
  1067. <if test="orderPromotionsId != null">
  1068. orderPromotionsId,
  1069. </if>
  1070. <if test="preferential != null">
  1071. preferential,
  1072. </if>
  1073. <if test="discountFee != null">
  1074. discountFee,
  1075. </if>
  1076. <if test="cancelNum != null">
  1077. cancelNum,
  1078. </if>
  1079. <if test="supplierTaxRate != null">
  1080. supplierTaxRate,
  1081. </if>
  1082. <if test="includedTax != null">
  1083. includedTax,
  1084. </if>
  1085. <if test="invoiceType != null">
  1086. invoiceType,
  1087. </if>
  1088. <if test="ladderPriceFlag != null">
  1089. ladderPriceFlag,
  1090. </if>
  1091. <if test="heUserId != null">
  1092. heUserId,
  1093. </if>
  1094. </trim>
  1095. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1096. <if test="skuId != null">
  1097. #{skuId},
  1098. </if>
  1099. <if test="orderNo != null">
  1100. #{orderNo,jdbcType=VARCHAR},
  1101. </if>
  1102. <if test="orderID != null">
  1103. #{orderID,jdbcType=BIGINT},
  1104. </if>
  1105. <if test="shopOrderID != null">
  1106. #{shopOrderID,jdbcType=INTEGER},
  1107. </if>
  1108. <if test="shopOrderNo != null">
  1109. #{shopOrderNo,jdbcType=VARCHAR},
  1110. </if>
  1111. <if test="shopID != null">
  1112. #{shopID,jdbcType=BIGINT},
  1113. </if>
  1114. <if test="productID != null">
  1115. #{productID,jdbcType=INTEGER},
  1116. </if>
  1117. <if test="organizeProductID != null">
  1118. #{organizeProductID,jdbcType=INTEGER},
  1119. </if>
  1120. <if test="organizeID != null">
  1121. #{organizeID},
  1122. </if>
  1123. <if test="num != null">
  1124. #{num,jdbcType=INTEGER},
  1125. </if>
  1126. <if test="presentNum != null">
  1127. #{presentNum,jdbcType=INTEGER},
  1128. </if>
  1129. <if test="outStoreType != null">
  1130. #{outStoreType,jdbcType=CHAR},
  1131. </if>
  1132. <if test="productNo != null">
  1133. #{productNo,jdbcType=VARCHAR},
  1134. </if>
  1135. <if test="price != null">
  1136. #{price,jdbcType=DECIMAL},
  1137. </if>
  1138. <if test="normalPrice != null">
  1139. #{normalPrice,jdbcType=DECIMAL},
  1140. </if>
  1141. <if test="costPrice != null">
  1142. #{costPrice,jdbcType=DECIMAL},
  1143. </if>
  1144. <if test="totalAmount != null">
  1145. #{totalAmount,jdbcType=DECIMAL},
  1146. </if>
  1147. <if test="totalFee != null">
  1148. #{totalFee,jdbcType=DECIMAL},
  1149. </if>
  1150. <if test="shouldPayFee != null">
  1151. #{shouldPayFee,jdbcType=DECIMAL},
  1152. </if>
  1153. <if test="discount != null">
  1154. #{discount,jdbcType=DECIMAL},
  1155. </if>
  1156. <if test="discountPrice != null">
  1157. #{discountPrice,jdbcType=DECIMAL},
  1158. </if>
  1159. <if test="taxRate != null">
  1160. #{taxRate,jdbcType=DECIMAL},
  1161. </if>
  1162. <if test="addedValueTax != null">
  1163. #{addedValueTax,jdbcType=DECIMAL},
  1164. </if>
  1165. <if test="totalAddedValueTax != null">
  1166. #{totalAddedValueTax,jdbcType=DECIMAL},
  1167. </if>
  1168. <if test="shouldPayTotalTax != null">
  1169. #{shouldPayTotalTax,jdbcType=DECIMAL},
  1170. </if>
  1171. <if test="singleShouldPayTotalTax != null">
  1172. #{singleShouldPayTotalTax,jdbcType=DECIMAL},
  1173. </if>
  1174. <if test="shopProductAmount != null">
  1175. #{shopProductAmount,jdbcType=DECIMAL},
  1176. </if>
  1177. <if test="shopFee != null">
  1178. #{shopFee,jdbcType=DECIMAL},
  1179. </if>
  1180. <if test="otherFee != null">
  1181. #{otherFee,jdbcType=DECIMAL},
  1182. </if>
  1183. <if test="cmFee != null">
  1184. #{cmFee,jdbcType=DECIMAL},
  1185. </if>
  1186. <if test="singleShopFee != null">
  1187. #{singleShopFee,jdbcType=DECIMAL},
  1188. </if>
  1189. <if test="singleOtherFee != null">
  1190. #{singleOtherFee,jdbcType=DECIMAL},
  1191. </if>
  1192. <if test="singleCmFee != null">
  1193. #{singleCmFee,jdbcType=DECIMAL},
  1194. </if>
  1195. <if test="status != null">
  1196. #{status,jdbcType=CHAR},
  1197. </if>
  1198. <if test="totalBeans != null">
  1199. #{totalBeans,jdbcType=DECIMAL},
  1200. </if>
  1201. <if test="useBalanceAmount != null">
  1202. #{useBalanceAmount,jdbcType=DOUBLE},
  1203. </if>
  1204. <if test="useBeanAmount != null">
  1205. #{useBeanAmount,jdbcType=INTEGER},
  1206. </if>
  1207. <if test="notOutStore != null">
  1208. #{notOutStore,jdbcType=INTEGER},
  1209. </if>
  1210. <if test="cmbeanPrice != null">
  1211. #{cmbeanPrice,jdbcType=INTEGER},
  1212. </if>
  1213. <if test="isActProduct != null">
  1214. #{isActProduct,jdbcType=VARCHAR},
  1215. </if>
  1216. <if test="isGiftProduct != null">
  1217. #{isGiftProduct,jdbcType=VARCHAR},
  1218. </if>
  1219. <if test="productActInfo != null">
  1220. #{productActInfo,jdbcType=VARCHAR},
  1221. </if>
  1222. <if test="buyAgainFlag != null">
  1223. #{buyAgainFlag,jdbcType=CHAR},
  1224. </if>
  1225. <if test="confirmProductFlag != null">
  1226. #{confirmProductFlag,jdbcType=CHAR},
  1227. </if>
  1228. <if test="payStatus != null">
  1229. #{payStatus,jdbcType=CHAR},
  1230. </if>
  1231. <if test="shopName != null">
  1232. #{shopName,jdbcType=VARCHAR},
  1233. </if>
  1234. <if test="name != null">
  1235. #{name,jdbcType=VARCHAR},
  1236. </if>
  1237. <if test="productUnit != null">
  1238. #{productUnit,jdbcType=VARCHAR},
  1239. </if>
  1240. <if test="productImage != null">
  1241. #{productImage,jdbcType=VARCHAR},
  1242. </if>
  1243. <if test="actType != null">
  1244. #{actType,jdbcType=VARCHAR},
  1245. </if>
  1246. <if test="actPreferential != null">
  1247. #{actPreferential,jdbcType=DECIMAL},
  1248. </if>
  1249. <if test="productType != null">
  1250. #{productType},
  1251. </if>
  1252. <if test="orderPromotionsId != null">
  1253. #{orderPromotionsId},
  1254. </if>
  1255. <if test="preferential != null">
  1256. #{preferential,jdbcType=DECIMAL},
  1257. </if>
  1258. <if test="discountFee != null">
  1259. #{discountFee,jdbcType=DECIMAL},
  1260. </if>
  1261. <if test="cancelNum != null">
  1262. #{cancelNum,jdbcType=INTEGER},
  1263. </if>
  1264. <if test="supplierTaxRate != null">
  1265. #{supplierTaxRate,jdbcType=DECIMAL},
  1266. </if>
  1267. <if test="includedTax != null">
  1268. #{includedTax,jdbcType=VARCHAR},
  1269. </if>
  1270. <if test="invoiceType != null">
  1271. #{invoiceType,jdbcType=VARCHAR},
  1272. </if>
  1273. <if test="ladderPriceFlag != null">
  1274. #{ladderPriceFlag,jdbcType=INTEGER},
  1275. </if>
  1276. <if test="heUserId != null">
  1277. #{heUserId},
  1278. </if>
  1279. </trim>
  1280. </insert>
  1281. <insert id="insertOrderProductLadderPrice" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  1282. parameterType="com.caimei.model.po.OrderProductLadderPricePo">
  1283. insert into order_product_ladder_price (orderProductId, ladderNum, buyNum, buyPrice, createDate)
  1284. values (#{orderProductId}, #{ladderNum}, #{buyNum}, #{buyPrice}, #{createDate})
  1285. </insert>
  1286. <update id="updateOrder" parameterType="com.caimei.model.po.CmOrderPo">
  1287. update cm_order
  1288. <set>
  1289. <if test="orderNo != null">
  1290. orderNo = #{orderNo,jdbcType=VARCHAR},
  1291. </if>
  1292. <if test="userID != null">
  1293. userID = #{userID,jdbcType=BIGINT},
  1294. </if>
  1295. <if test="buyUserID != null">
  1296. buyUserID = #{buyUserID,jdbcType=INTEGER},
  1297. </if>
  1298. <if test="shopOrderIDs != null">
  1299. shopOrderIDs = #{shopOrderIDs,jdbcType=VARCHAR},
  1300. </if>
  1301. <if test="orderSubmitType != null">
  1302. orderSubmitType = #{orderSubmitType,jdbcType=INTEGER},
  1303. </if>
  1304. <if test="orderType != null">
  1305. orderType = #{orderType,jdbcType=INTEGER},
  1306. </if>
  1307. <if test="hasActProduct != null">
  1308. hasActProduct = #{hasActProduct,jdbcType=CHAR},
  1309. </if>
  1310. <if test="status != null">
  1311. `status` = #{status,jdbcType=CHAR},
  1312. </if>
  1313. <if test="receiptStatus != null">
  1314. receiptStatus = #{receiptStatus,jdbcType=CHAR},
  1315. </if>
  1316. <if test="payStatus != null">
  1317. payStatus = #{payStatus,jdbcType=CHAR},
  1318. </if>
  1319. <if test="sendOutStatus != null">
  1320. sendOutStatus = #{sendOutStatus,jdbcType=CHAR},
  1321. </if>
  1322. <if test="refundType != null">
  1323. refundType = #{refundType,jdbcType=CHAR},
  1324. </if>
  1325. <if test="payFlag != null">
  1326. payFlag = #{payFlag,jdbcType=CHAR},
  1327. </if>
  1328. <if test="onlinePayFlag != null">
  1329. onlinePayFlag = #{onlinePayFlag,jdbcType=CHAR},
  1330. </if>
  1331. <if test="productTotalFee != null">
  1332. productTotalFee = #{productTotalFee,jdbcType=DECIMAL},
  1333. </if>
  1334. <if test="orderTotalFee != null">
  1335. orderTotalFee = #{orderTotalFee,jdbcType=DECIMAL},
  1336. </if>
  1337. <if test="payTotalFee != null">
  1338. payTotalFee = #{payTotalFee,jdbcType=DECIMAL},
  1339. </if>
  1340. <if test="payableAmount != null">
  1341. payableAmount = #{payableAmount,jdbcType=DECIMAL},
  1342. </if>
  1343. <if test="balancePayFee != null">
  1344. balancePayFee = #{balancePayFee,jdbcType=DECIMAL},
  1345. </if>
  1346. <if test="preferential != null">
  1347. preferential = #{preferential,jdbcType=DECIMAL},
  1348. </if>
  1349. <if test="discountFee != null">
  1350. discountFee = #{discountFee,jdbcType=DECIMAL},
  1351. </if>
  1352. <if test="spID != null">
  1353. spID = #{spID,jdbcType=BIGINT},
  1354. </if>
  1355. <if test="mainSpID != null">
  1356. mainSpID = #{mainSpID,jdbcType=BIGINT},
  1357. </if>
  1358. <if test="note != null">
  1359. note = #{note,jdbcType=VARCHAR},
  1360. </if>
  1361. <if test="clubID != null">
  1362. clubID = #{clubID,jdbcType=BIGINT},
  1363. </if>
  1364. <if test="clubScanTime != null">
  1365. clubScanTime = #{clubScanTime,jdbcType=VARCHAR},
  1366. </if>
  1367. <if test="orderSource != null">
  1368. orderSource = #{orderSource,jdbcType=CHAR},
  1369. </if>
  1370. <if test="closeTime != null">
  1371. closeTime = #{closeTime,jdbcType=VARCHAR},
  1372. </if>
  1373. <if test="confirmTime != null">
  1374. confirmTime = #{confirmTime,jdbcType=VARCHAR},
  1375. </if>
  1376. <if test="payTime != null">
  1377. payTime = #{payTime,jdbcType=VARCHAR},
  1378. </if>
  1379. <if test="orderTime != null">
  1380. orderTime = #{orderTime,jdbcType=VARCHAR},
  1381. </if>
  1382. <if test="productCount != null">
  1383. productCount = #{productCount,jdbcType=INTEGER},
  1384. </if>
  1385. <if test="presentCount != null">
  1386. presentCount = #{presentCount,jdbcType=INTEGER},
  1387. </if>
  1388. <if test="invoiceFlag != null">
  1389. invoiceFlag = #{invoiceFlag,jdbcType=CHAR},
  1390. </if>
  1391. <if test="confirmFlag != null">
  1392. confirmFlag = #{confirmFlag,jdbcType=CHAR},
  1393. </if>
  1394. <if test="clauseID != null">
  1395. clauseID = #{clauseID,jdbcType=BIGINT},
  1396. </if>
  1397. <if test="clauseContent != null">
  1398. clauseContent = #{clauseContent,jdbcType=VARCHAR},
  1399. </if>
  1400. <if test="clauseName != null">
  1401. clauseName = #{clauseName,jdbcType=VARCHAR},
  1402. </if>
  1403. <if test="updateDate != null">
  1404. updateDate = #{updateDate,jdbcType=VARCHAR},
  1405. </if>
  1406. <if test="freePostFlag != null">
  1407. freePostFlag = #{freePostFlag,jdbcType=CHAR},
  1408. </if>
  1409. <if test="freight != null">
  1410. freight = #{freight,jdbcType=DECIMAL},
  1411. </if>
  1412. <if test="delFlag != null">
  1413. delFlag = #{delFlag,jdbcType=CHAR},
  1414. </if>
  1415. <if test="freePostageTicketID != null">
  1416. freePostageTicketID = #{freePostageTicketID,jdbcType=INTEGER},
  1417. </if>
  1418. <if test="splitFlag != null">
  1419. splitFlag = #{splitFlag,jdbcType=CHAR},
  1420. </if>
  1421. <if test="closeReason != null">
  1422. closeReason = #{closeReason,jdbcType=VARCHAR},
  1423. </if>
  1424. <if test="postageOrderFlag != null">
  1425. postageOrderFlag = #{postageOrderFlag,jdbcType=CHAR},
  1426. </if>
  1427. <if test="affirmPaymentFlag != null">
  1428. affirmPaymentFlag = #{affirmPaymentFlag,jdbcType=CHAR},
  1429. </if>
  1430. <if test="rebateFlag != null">
  1431. rebateFlag = #{rebateFlag,jdbcType=CHAR},
  1432. </if>
  1433. <if test="zeroCostFlag != null">
  1434. zeroCostFlag = #{zeroCostFlag,jdbcType=INTEGER},
  1435. </if>
  1436. </set>
  1437. where orderID = #{orderID,jdbcType=BIGINT}
  1438. </update>
  1439. <update id="updateReceiveCouponStatus">
  1440. update cm_hehe_receive_coupon
  1441. set status = 2,
  1442. useTime = NOW(),
  1443. orderId = #{orderId}
  1444. where id = #{receiveCouponId}
  1445. </update>
  1446. <update id="updateReductionUserId">
  1447. update cm_hehe_reduction_user
  1448. set orderId = #{orderId}
  1449. where id = #{reductionUserId}
  1450. </update>
  1451. <select id="findByAddressId" resultType="com.caimei.model.vo.AddressVo">
  1452. SELECT a.addressID AS addressId,
  1453. a.userID AS userId,
  1454. a.shouHuoRen,
  1455. a.townID AS townId,
  1456. a.address,
  1457. a.postalCode,
  1458. a.phone,
  1459. a.mobile,
  1460. a.defaultFlag,
  1461. c.cityID AS cityId,
  1462. p.provinceID AS provinceId,
  1463. t.name AS townName,
  1464. c.name AS cityName,
  1465. p.name AS provinceName
  1466. FROM address a
  1467. LEFT JOIN town t ON t.townID = a.townID
  1468. LEFT JOIN city c ON c.cityID = t.cityID
  1469. LEFT JOIN province p ON p.provinceID = c.provinceID
  1470. WHERE a.addressID = #{addressId}
  1471. </select>
  1472. <insert id="insertUserInfo" keyColumn="id" keyProperty="id" parameterType="com.caimei.model.po.BpOrderUserInfoPo"
  1473. useGeneratedKeys="true">
  1474. insert into bp_order_userinfo
  1475. <trim prefix="(" suffix=")" suffixOverrides=",">
  1476. <if test="orderId != null">
  1477. orderId,
  1478. </if>
  1479. <if test="clubId != null">
  1480. clubId,
  1481. </if>
  1482. <if test="userId != null">
  1483. userId,
  1484. </if>
  1485. <if test="name != null">
  1486. `name`,
  1487. </if>
  1488. <if test="shouHuoRen != null">
  1489. shouHuoRen,
  1490. </if>
  1491. <if test="mobile != null">
  1492. mobile,
  1493. </if>
  1494. <if test="phone != null">
  1495. phone,
  1496. </if>
  1497. <if test="postalCode != null">
  1498. postalCode,
  1499. </if>
  1500. <if test="townId != null">
  1501. townId,
  1502. </if>
  1503. <if test="province != null">
  1504. province,
  1505. </if>
  1506. <if test="city != null">
  1507. city,
  1508. </if>
  1509. <if test="town != null">
  1510. town,
  1511. </if>
  1512. <if test="address != null">
  1513. address,
  1514. </if>
  1515. </trim>
  1516. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1517. <if test="orderId != null">
  1518. #{orderId,jdbcType=BIGINT},
  1519. </if>
  1520. <if test="clubId != null">
  1521. #{clubId,jdbcType=BIGINT},
  1522. </if>
  1523. <if test="userId != null">
  1524. #{userId,jdbcType=BIGINT},
  1525. </if>
  1526. <if test="name != null">
  1527. #{name,jdbcType=VARCHAR},
  1528. </if>
  1529. <if test="shouHuoRen != null">
  1530. #{shouHuoRen,jdbcType=VARCHAR},
  1531. </if>
  1532. <if test="mobile != null">
  1533. #{mobile,jdbcType=VARCHAR},
  1534. </if>
  1535. <if test="phone != null">
  1536. #{phone,jdbcType=VARCHAR},
  1537. </if>
  1538. <if test="postalCode != null">
  1539. #{postalCode,jdbcType=VARCHAR},
  1540. </if>
  1541. <if test="townId != null">
  1542. #{townId,jdbcType=INTEGER},
  1543. </if>
  1544. <if test="province != null">
  1545. #{province,jdbcType=VARCHAR},
  1546. </if>
  1547. <if test="city != null">
  1548. #{city,jdbcType=VARCHAR},
  1549. </if>
  1550. <if test="town != null">
  1551. #{town,jdbcType=VARCHAR},
  1552. </if>
  1553. <if test="address != null">
  1554. #{address,jdbcType=VARCHAR},
  1555. </if>
  1556. </trim>
  1557. </insert>
  1558. <insert id="insertCouponOrderRecord">
  1559. INSERT INTO cm_hehe_coupon_order_record (orderId, receiveCouponId, couponType, couponAmount, touchPrice,
  1560. createDate)
  1561. VALUES (#{orderId}, #{receiveCouponId}, #{couponType}, #{couponAmount}, #{touchPrice}, #{createDate})
  1562. </insert>
  1563. <insert id="insertReductionUser" keyColumn="id" keyProperty="reductionUserId"
  1564. parameterType="com.caimei.model.po.ReductionUserPo" useGeneratedKeys="true">
  1565. insert into cm_hehe_reduction_user (userId, reductionId, shareType, touchPrice, reductionAmount, shareTime)
  1566. values (#{userId}, #{reductionId}, #{shareType}, #{touchPrice}, #{reducedAmount}, NOW())
  1567. </insert>
  1568. <select id="findShopByProductId" resultType="com.caimei.model.vo.ShopVo">
  1569. SELECT s.shopID AS shopId,
  1570. s.name,
  1571. s.logo,
  1572. p.returnGoodsStutas,
  1573. p.splitCode
  1574. FROM cm_hehe_product chp
  1575. LEFT JOIN product p ON chp.productId = p.productID
  1576. LEFT JOIN shop s ON p.shopID = s.shopID
  1577. WHERE chp.productId = (SELECT productId FROM cm_hehe_sku WHERE skuId=#{skuId})
  1578. AND chp.validFlag = 1
  1579. </select>
  1580. <select id="findProductById" resultType="com.caimei.model.vo.CartProductVo">
  1581. SELECT cs.skuId,
  1582. chp.productId,
  1583. chs.price,
  1584. chs.price as normalPrice,
  1585. chp.includedTax,
  1586. chp.invoiceType,
  1587. chp.clubTaxPoint,
  1588. p.name,
  1589. p.shopID AS shopId,
  1590. p.mainImage as productImage,
  1591. cs.unit as productUnit
  1592. FROM cm_hehe_product chp
  1593. LEFT JOIN product p ON chp.productId = p.productID
  1594. LEFT JOIN cm_sku cs on p.productID=cs.productId
  1595. LEFT JOIN cm_hehe_sku chs on chs.skuId=cs.skuId
  1596. WHERE chp.validFlag = 1
  1597. AND cs.skuId = #{skuId}
  1598. </select>
  1599. <select id="findCartProducts" resultType="com.caimei.model.vo.CartProductVo">
  1600. SELECT
  1601. cc.cm_cartID AS cartId,
  1602. cc.productID AS productId,
  1603. cc.productCount as num,
  1604. cc.heUserId,
  1605. chp.includedTax,
  1606. chp.invoiceType,
  1607. chp.clubTaxPoint,
  1608. p.name,
  1609. p.shopID AS shopId,
  1610. p.mainImage as productImage,
  1611. FROM
  1612. cm_cart cc
  1613. LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId
  1614. LEFT JOIN product p ON cc.productID = p.productID
  1615. WHERE
  1616. chp.validFlag = 1
  1617. AND cc.cm_cartID IN
  1618. <foreach item="cartId" index="index" collection="cartIds" open="(" separator="," close=")">
  1619. #{cartId}
  1620. </foreach>
  1621. </select>
  1622. <select id="findCurrentReduction" resultType="com.caimei.model.vo.ReductionVo">
  1623. select id as reductionId, reducedAmount, touchPrice, shareNum
  1624. from cm_hehe_reduction
  1625. where NOW() <![CDATA[ >= ]]> startTime
  1626. and NOW() <![CDATA[ <= ]]> endTime
  1627. </select>
  1628. <select id="findShareNum" resultType="java.lang.Integer">
  1629. select count(*)
  1630. from cm_hehe_reduction_user
  1631. where userId = #{userId}
  1632. and reductionId = #{reductionId}
  1633. </select>
  1634. <select id="findReduction" resultType="com.caimei.model.vo.ReductionVo">
  1635. select chr.id as reductionId, reducedAmount, chr.touchPrice
  1636. from cm_hehe_reduction chr
  1637. left join cm_hehe_reduction_user chru on chr.id = chru.reductionId
  1638. where chru.id = #{reductionUserId}
  1639. and chru.orderId is null
  1640. </select>
  1641. <select id="getHelpContent" resultType="java.lang.String">
  1642. select content from helppage where helpPageID=#{helpId}
  1643. </select>
  1644. </mapper>