OrderSubmitMapper.xml 55 KB

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