OrderSubmitMapper.xml 54 KB

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