ShopOrderMapper.xml 135 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.caimei.modules.order.dao.NewShopOrderDao">
  4. <sql id="shopOrderColumns">
  5. co.rebateFee as rebateFee,
  6. co.couponAmount as couponAmount,
  7. co.userBeans as userBeans,
  8. a.shopOrderID AS shopOrderID,
  9. a.shopStatus AS status,
  10. a.shopPostFlag AS shopPostFlag,
  11. a.orderID AS orderID,
  12. a.organizeID AS organizeID,
  13. a.shopOrderNo AS shopOrderNo,
  14. a.orderNo AS orderNo,
  15. a.userID AS userID,
  16. a.shopID AS shopID,
  17. a.isColdChina AS isColdChina,
  18. a.itemCount AS itemCount,
  19. a.townID AS townID,
  20. a.productAmount AS productAmount,
  21. a.discountAmount AS discountAmount,
  22. a.accountAmount AS accountAmount,
  23. a.totalAmount AS totalAmount,
  24. a.payFlag AS payFlag,
  25. a.payTime AS payTime,
  26. a.finishTime AS finishTime,
  27. a.refundStatus AS refundStatus,
  28. a.needPayAmount AS needPayAmount,
  29. a.splitCode,
  30. ifnull(a.realPay, a.needPayAmount) AS realPay,
  31. a.eachDiscount AS eachDiscount,
  32. ifnull(a.receiptAmount,0) AS receiptAmount,
  33. (ifnull(a.realPay,0) - ifnull(a.receiptAmount,0)) as restAmount,
  34. a.receiptStatus as shopReceiptStatus,
  35. a.receiptStatus as ReceiptStatus,
  36. a.canRefundAmount AS canRefundAmount,
  37. a.refundAmount AS refundAmount,
  38. a.clubID AS clubID,
  39. a.spID AS spID,
  40. a.mainSpID AS mainSpID,
  41. a.orderBeanAmount AS orderBeanAmount,
  42. a.useBeanAmount AS useBeanAmount,
  43. a.useBeanFlag AS useBeanFlag,
  44. a.canRefundFlag AS canRefundFlag,
  45. a.useBalanceFlag AS useBalanceFlag,
  46. a.canRefundBeans AS canRefundBeans,
  47. a.freePostageFee AS freePostageFee,
  48. a.freePostageTicketID AS freePostageTicketID,
  49. a.brokerage AS brokerage,
  50. a.delFlag AS delFlag,
  51. a.refundsAmount AS refundsAmount,
  52. a.orderStatusFlag AS orderStatusFlag,
  53. a.buyStatus AS buyStatus,
  54. a.orderSubmitType AS orderSubmitType,
  55. a.orderType AS orderType,
  56. a.orderTime AS orderTime,
  57. a.deliveryTimeMills AS deliveryTimeMills,
  58. a.presentNum AS presentNum,
  59. a.preferential AS preferential,
  60. a.outStoreNum AS outStoreNum,
  61. IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
  62. a.splitFlag AS splitFlag,
  63. a.autoReceiveTimeMills AS autoReceiveTimeMills,
  64. a.autoOverTimeMills AS autoOverTimeMills,
  65. a.receiveGoodsTime AS receiveGoodsTime,
  66. a.totalAddedValueTax AS totalAddedValueTax,
  67. a.note AS note,
  68. a.payStatus AS payStatus,
  69. a.sendOutStatus AS sendOutStatus,
  70. a.shopProductAmount AS shopProductAmount,
  71. a.shopPostFee AS shopPostFee,
  72. a.shopTaxFee AS shopTaxFee,
  73. a.shouldPayShopAmount AS shouldPayShopAmount,
  74. a.payedShopAmount AS payedShopAmount,
  75. a.shopOtherFee AS shopOtherFee,
  76. a.paying AS paying,
  77. a.costType AS costType,
  78. a.settleStatus AS settleStatus,
  79. a.modifyShouldPayNote AS modifyShouldPayNote,
  80. a.orderPromotionsId AS orderPromotionsId,
  81. a.differenceType AS differenceType,
  82. a.differencePrice AS differencePrice,
  83. a.proportional AS proportional,
  84. a.promotionFullReduction As promotionFullReduction,
  85. a.zeroCostFlag AS zeroCostFlag
  86. </sql>
  87. <select id="get" resultType="NewShopOrder" useCache="false" flushCache="true">
  88. select
  89. <include refid="shopOrderColumns"/>
  90. from cm_shop_order a
  91. left join cm_order co on co.orderID = a.orderID
  92. where a.shopOrderID = #{shopOrderID}
  93. </select>
  94. <delete id="deleteByOrderID">
  95. DELETE
  96. FROM cm_shop_order
  97. WHERE orderID = #{orderID}
  98. </delete>
  99. <insert id="insert" parameterType="NewShopOrder" keyProperty="shopOrderID" useGeneratedKeys="true">
  100. INSERT INTO cm_shop_order(orderID,
  101. shopOrderNo,
  102. orderNo,
  103. userID,
  104. shopID,
  105. itemCount,
  106. townID,
  107. productAmount,
  108. discountAmount,
  109. accountAmount,
  110. totalAmount,
  111. payFlag,
  112. payTime,
  113. finishTime,
  114. refundStatus,
  115. needPayAmount,
  116. canRefundAmount,
  117. refundAmount,
  118. clubID,
  119. spID,
  120. mainSpID,
  121. orderBeanAmount,
  122. useBeanAmount,
  123. useBeanFlag,
  124. canRefundFlag,
  125. useBalanceFlag,
  126. canRefundBeans,
  127. freePostageFee,
  128. freePostageTicketID,
  129. brokerage,
  130. delFlag,
  131. refundsAmount,
  132. orderStatusFlag,
  133. buyStatus,
  134. orderSubmitType,
  135. orderType,
  136. orderTime,
  137. deliveryTimeMills,
  138. presentNum,
  139. preferential,
  140. splitFlag,
  141. autoReceiveTimeMills,
  142. autoOverTimeMills,
  143. totalAddedValueTax,
  144. receiveGoodsTime,
  145. sendOutStatus,
  146. payStatus,
  147. costType,
  148. orderPromotionsId,
  149. promotionFullReduction,
  150. zeroCostFlag,
  151. svipShopReduction,
  152. realPay,
  153. eachDiscount,
  154. receiptStatus,
  155. receiptAmount,
  156. splitCode)
  157. VALUES (#{orderID},
  158. #{shopOrderNo},
  159. #{orderNo},
  160. #{userID},
  161. #{shopID},
  162. #{itemCount},
  163. #{townID},
  164. #{productAmount},
  165. #{discountAmount},
  166. #{accountAmount},
  167. #{totalAmount},
  168. #{payFlag},
  169. #{payTime},
  170. #{finishTime},
  171. #{refundStatus},
  172. #{needPayAmount},
  173. #{canRefundAmount},
  174. #{refundAmount},
  175. #{clubID},
  176. #{spID},
  177. #{mainSpID},
  178. #{orderBeanAmount},
  179. #{useBeanAmount},
  180. #{useBeanFlag},
  181. #{canRefundFlag},
  182. #{useBalanceFlag},
  183. #{canRefundBeans},
  184. #{freePostageFee},
  185. #{freePostageTicketID},
  186. #{brokerage},
  187. #{delFlag},
  188. #{refundsAmount},
  189. #{orderStatusFlag},
  190. #{buyStatus},
  191. #{orderSubmitType},
  192. #{orderType},
  193. #{orderTime},
  194. #{deliveryTimeMills},
  195. #{presentNum},
  196. #{preferential},
  197. #{splitFlag},
  198. #{autoReceiveTimeMills},
  199. #{autoOverTimeMills},
  200. #{totalAddedValueTax},
  201. #{receiveGoodsTime},
  202. #{sendOutStatus},
  203. #{payStatus},
  204. #{costType},
  205. #{orderPromotionsId},
  206. #{promotionFullReduction},
  207. #{zeroCostFlag},
  208. #{svipShopReduction},
  209. #{realPay},
  210. #{eachDiscount},
  211. #{shopReceiptStatus},
  212. #{receiptAmount},
  213. #{splitCode})
  214. </insert>
  215. <select id="findByShopOrderID" resultType="newShopOrder">
  216. select
  217. <include refid="shopOrderColumns"/>
  218. from cm_shop_order a
  219. left join cm_order co on co.orderID = a.orderID
  220. where a.shopOrderID = #{shopOrderID}
  221. </select>
  222. <select id="findList" resultType="newShopOrder">
  223. SELECT
  224. <include refid="shopOrderColumns"/>
  225. FROM cm_shop_order a
  226. left join cm_order co on co.orderID = a.orderID
  227. <where>
  228. <if test="shopOrderNo != null and itemCount != ''">
  229. AND a.shopOrderNo = #{shopOrderNo}
  230. </if>
  231. <if test="orderNo != null and itemCount != ''">
  232. AND a.orderNo = #{orderNo}
  233. </if>
  234. <if test="orderID != null and itemCount != ''">
  235. AND a.orderID = #{orderID}
  236. </if>
  237. <if test="userID != null and itemCount != ''">
  238. AND a.userID = #{userID}
  239. </if>
  240. <if test="shopID != null and itemCount != ''">
  241. AND a.shopID = #{shopID}
  242. </if>
  243. <if test="payFlag != null and itemCount != ''">
  244. AND a.payFlag = #{payFlag}
  245. </if>
  246. </where>
  247. <choose>
  248. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  249. ORDER BY ${page.orderBy}
  250. </when>
  251. <otherwise>
  252. </otherwise>
  253. </choose>
  254. </select>
  255. <select id="findListByOrderID" resultType="newShopOrder">
  256. SELECT<include refid="shopOrderColumns"/>,
  257. b.name as shopName,
  258. oa.id as orderArchiveId,
  259. co.receiptStatus
  260. FROM cm_shop_order a
  261. left join shop b on a.shopID = b.shopID
  262. left join cm_order_archive oa on a.shopOrderID = oa.shopOrderId
  263. left join cm_order co on co.orderID = a.orderID
  264. WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
  265. </select>
  266. <select id="findCommercialCode" resultType="String">
  267. select commercialCode FROM cm_shop_order a left join cm_shop_splitcode css on a.shopID = css.shopId WHERE a.orderID = #{orderID}
  268. </select>
  269. <update id="update" parameterType="newShopOrder">
  270. update cm_shop_order
  271. <set>
  272. <if test="shopOrderNo != null and shopOrderNo != ''">
  273. shopOrderNo = #{shopOrderNo},
  274. </if>
  275. <if test="status != null and status != ''">
  276. shopStatus = #{status},
  277. </if>
  278. <if test="shopOrderNo != null and shopOrderNo != ''">
  279. orderID = #{orderID},
  280. </if>
  281. <if test="orderNo != null and orderNo != ''">
  282. orderNo = #{orderNo},
  283. </if>
  284. <if test="userID != null and userID != ''">
  285. userID = #{userID},
  286. </if>
  287. <if test="shopID != null and shopID != ''">
  288. shopID = #{shopID},
  289. </if>
  290. <if test="itemCount != null and itemCount != ''">
  291. itemCount = #{itemCount},
  292. </if>
  293. <if test="townID != null and itemCount != ''">
  294. townID = #{townID,jdbcType=INTEGER},
  295. </if>
  296. <if test="productAmount != null and productAmount != ''">
  297. productAmount = #{productAmount},
  298. </if>
  299. <if test="discountAmount != null and discountAmount != ''">
  300. discountAmount = #{discountAmount},
  301. </if>
  302. <if test="accountAmount != null and accountAmount != ''">
  303. accountAmount = #{accountAmount},
  304. </if>
  305. <if test="totalAmount != null and totalAmount != ''">
  306. totalAmount = #{totalAmount},
  307. </if>
  308. <if test="payFlag != null and payFlag != ''">
  309. payFlag = #{payFlag},
  310. </if>
  311. <if test="payTime != null and payTime != ''">
  312. payTime = #{payTime},
  313. </if>
  314. <if test="finishTime != null and finishTime != ''">
  315. finishTime = #{finishTime},
  316. </if>
  317. <if test="refundStatus != null and refundStatus != ''">
  318. refundStatus = #{refundStatus},
  319. </if>
  320. <if test="needPayAmount != null and needPayAmount != ''">
  321. needPayAmount = #{needPayAmount},
  322. </if>
  323. <if test="canRefundAmount != null and canRefundAmount != ''">
  324. canRefundAmount = #{canRefundAmount},
  325. </if>
  326. <if test="refundAmount != null and refundAmount != ''">
  327. refundAmount = #{refundAmount},
  328. </if>
  329. <if test="clubID != null and clubID != ''">
  330. clubID = #{clubID},
  331. </if>
  332. <if test="spID != null and itemCount != ''">
  333. spID = #{spID,jdbcType=INTEGER},
  334. </if>
  335. <if test="mainSpID != null and mainSpID != ''">
  336. mainSpID = #{mainSpID},
  337. </if>
  338. <if test="orderBeanAmount != null and orderBeanAmount != ''">
  339. orderBeanAmount = #{orderBeanAmount},
  340. </if>
  341. <if test="useBeanAmount != null and useBeanAmount != ''">
  342. useBeanAmount = #{useBeanAmount},
  343. </if>
  344. <if test="useBeanFlag != null and useBeanFlag != ''">
  345. useBeanFlag = #{useBeanFlag},
  346. </if>
  347. <if test="canRefundFlag != null and canRefundFlag != ''">
  348. canRefundFlag = #{canRefundFlag},
  349. </if>
  350. <if test="useBalanceFlag != null and useBalanceFlag != ''">
  351. useBalanceFlag = #{useBalanceFlag},
  352. </if>
  353. <if test="canRefundBeans != null and canRefundBeans != ''">
  354. canRefundBeans = #{canRefundBeans},
  355. </if>
  356. <if test="freePostageFee != null and freePostageFee != ''">
  357. freePostageFee = #{freePostageFee},
  358. </if>
  359. <if test="freePostageTicketID != null and freePostageTicketID != ''">
  360. freePostageTicketID = #{freePostageTicketID},
  361. </if>
  362. <if test="brokerage != null and brokerage != ''">
  363. brokerage = #{brokerage},
  364. </if>
  365. <if test="delFlag != null and delFlag != ''">
  366. delFlag = #{delFlag},
  367. </if>
  368. <if test="refundsAmount != null and refundsAmount != ''">
  369. refundsAmount = #{refundsAmount},
  370. </if>
  371. <if test="orderStatusFlag != null and orderStatusFlag != ''">
  372. orderStatusFlag = #{orderStatusFlag},
  373. </if>
  374. <if test="buyStatus != null and buyStatus != ''">
  375. buyStatus = #{buyStatus},
  376. </if>
  377. <if test="deliveryTimeMills != null and deliveryTimeMills != ''">
  378. deliveryTimeMills = #{deliveryTimeMills},
  379. </if>
  380. <if test="orderSubmitType != null and orderSubmitType != ''">
  381. orderSubmitType = #{orderSubmitType},
  382. </if>
  383. <if test="orderType != null and orderType != ''">
  384. orderType = #{orderType},
  385. </if>
  386. <if test="orderTime != null and orderTime != ''">
  387. orderTime = #{orderTime},
  388. </if>
  389. <if test="presentNum != null and presentNum != ''">
  390. presentNum = #{presentNum},
  391. </if>
  392. <if test="preferential != null and preferential != ''">
  393. preferential = #{preferential},
  394. </if>
  395. <if test="outStoreNum != null and outStoreNum != ''">
  396. outStoreNum = #{outStoreNum},
  397. </if>
  398. <if test="outStoreTimes != null and outStoreTimes != ''">
  399. outStoreTimes = #{outStoreTimes},
  400. </if>
  401. <if test="splitFlag != null and splitFlag != ''">
  402. splitFlag = #{splitFlag},
  403. </if>
  404. <if test="autoReceiveTimeMills != null and autoReceiveTimeMills != ''">
  405. autoReceiveTimeMills = #{autoReceiveTimeMills},
  406. </if>
  407. <if test="autoOverTimeMills != null and autoOverTimeMills != ''">
  408. autoOverTimeMills = #{autoOverTimeMills},
  409. </if>
  410. <if test="receiveGoodsTime != null and receiveGoodsTime != ''">
  411. receiveGoodsTime = #{receiveGoodsTime},
  412. </if>
  413. <if test="totalAddedValueTax != null and totalAddedValueTax != ''">
  414. totalAddedValueTax = #{totalAddedValueTax},
  415. </if>
  416. <if test="note != null and note != ''">
  417. note = #{note},
  418. </if>
  419. <if test="sendOutStatus != null and sendOutStatus != ''">
  420. sendOutStatus = #{sendOutStatus},
  421. </if>
  422. <if test="paying != null and paying != ''">
  423. paying = #{paying},
  424. </if>
  425. <if test="shopProductAmount != null">
  426. shopProductAmount = #{shopProductAmount},
  427. </if>
  428. <if test="shopPostFee != null">
  429. shopPostFee = #{shopPostFee},
  430. </if>
  431. <if test="shopTaxFee != null">
  432. shopTaxFee = #{shopTaxFee},
  433. </if>
  434. <if test="shouldPayShopAmount != null">
  435. shouldPayShopAmount = #{shouldPayShopAmount},
  436. </if>
  437. <if test="payedShopAmount != null">
  438. payedShopAmount = #{payedShopAmount},
  439. </if>
  440. <if test="shopOtherFee != null">
  441. shopOtherFee = #{shopOtherFee},
  442. </if>
  443. <if test="payStatus != null">
  444. payStatus = #{payStatus},
  445. </if>
  446. <if test="costType != null">
  447. costType = #{costType},
  448. </if>
  449. <if test="proportional != null">
  450. proportional = #{proportional},
  451. </if>
  452. <if test="modifyShouldPayNote != null">
  453. modifyShouldPayNote = #{modifyShouldPayNote},
  454. </if>
  455. <if test="modifyShouldPayUserID != null">
  456. modifyShouldPayUserID = #{modifyShouldPayUserID},
  457. </if>
  458. <if test="modifyShouldPayDate != null">
  459. modifyShouldPayDate = #{modifyShouldPayDate},
  460. </if>
  461. <if test="orderPromotionsId != null">
  462. orderPromotionsId = #{orderPromotionsId},
  463. </if>
  464. <if test="promotionFullReduction != null">
  465. promotionFullReduction = #{promotionFullReduction},
  466. </if>
  467. <if test="zeroCostFlag != null">
  468. zeroCostFlag = #{zeroCostFlag},
  469. </if>
  470. <if test="svipShopReduction != null">
  471. svipShopReduction = #{svipShopReduction},
  472. </if>
  473. <if test="realPay != null">
  474. realPay = #{realPay},
  475. </if>
  476. <if test="eachDiscount != null">
  477. eachDiscount = #{eachDiscount},
  478. </if>
  479. <if test="receiptStatus != null">
  480. receiptStatus = #{receiptStatus},
  481. </if>
  482. <if test="receiptAmount != null">
  483. receiptAmount = #{receiptAmount},
  484. </if>
  485. <if test="splitCode != null">
  486. splitCode = #{splitCode},
  487. </if>
  488. </set>
  489. <where>
  490. <if test="shopOrderID != null and shopOrderID != ''">
  491. AND shopOrderID = #{shopOrderID}
  492. </if>
  493. <if test="orderID != null and orderID != ''">
  494. AND orderID = #{orderID}
  495. </if>
  496. </where>
  497. </update>
  498. <delete id="delete">
  499. DELETE
  500. FROM cm_shop_order
  501. WHERE shopOrderID = #{shopOrderID}
  502. </delete>
  503. <select id="findIDsByOrderID" resultType="int">
  504. select shopOrderID
  505. from cm_shop_order
  506. where orderID = #{orderID}
  507. </select>
  508. <update id="updateNote">
  509. UPDATE cm_shop_order
  510. SET note = #{note}
  511. WHERE shopOrderID = #{shopOrderID}
  512. </update>
  513. <select id="findShopOrderNum" resultType="int">
  514. select count(1)
  515. from cm_shop_order
  516. where orderID = #{orderID}
  517. </select>
  518. <update id="updateByShopOrderID" parameterType="newShopOrder">
  519. update cm_shop_order
  520. <set>
  521. <if test="status != null and status != ''">
  522. shopStatus = #{status},
  523. </if>
  524. <if test="shopOrderNo != null and shopOrderNo != ''">
  525. shopOrderNo = #{shopOrderNo},
  526. </if>
  527. <if test="orderID != null and orderID != ''">
  528. orderID = #{orderID},
  529. </if>
  530. <if test="orderNo != null and orderNo != ''">
  531. orderNo = #{orderNo},
  532. </if>
  533. <if test="userID != null and userID != ''">
  534. userID = #{userID},
  535. </if>
  536. <if test="shopID != null and shopID != ''">
  537. shopID = #{shopID},
  538. </if>
  539. <if test="itemCount != null and itemCount != ''">
  540. itemCount = #{itemCount},
  541. </if>
  542. <if test="townID != null and itemCount != ''">
  543. townID = #{townID,jdbcType=INTEGER},
  544. </if>
  545. <if test="productAmount != null and productAmount != ''">
  546. productAmount = #{productAmount},
  547. </if>
  548. <if test="discountAmount != null and discountAmount != ''">
  549. discountAmount = #{discountAmount},
  550. </if>
  551. <if test="accountAmount != null and accountAmount != ''">
  552. accountAmount = #{accountAmount},
  553. </if>
  554. <if test="totalAmount != null and totalAmount != ''">
  555. totalAmount = #{totalAmount},
  556. </if>
  557. <if test="payFlag != null and payFlag != ''">
  558. payFlag = #{payFlag},
  559. </if>
  560. <if test="payTime != null and payTime != ''">
  561. payTime = #{payTime},
  562. </if>
  563. <if test="finishTime != null and finishTime != ''">
  564. finishTime = #{finishTime},
  565. </if>
  566. <if test="refundStatus != null and refundStatus != ''">
  567. refundStatus = #{refundStatus},
  568. </if>
  569. <if test="needPayAmount != null and needPayAmount != ''">
  570. needPayAmount = #{needPayAmount},
  571. </if>
  572. <if test="canRefundAmount != null and canRefundAmount != ''">
  573. canRefundAmount = #{canRefundAmount},
  574. </if>
  575. <if test="refundAmount != null and refundAmount != ''">
  576. refundAmount = #{refundAmount},
  577. </if>
  578. <if test="clubID != null and clubID != ''">
  579. clubID = #{clubID},
  580. </if>
  581. <if test="spID != null and itemCount != ''">
  582. spID = #{spID,jdbcType=INTEGER},
  583. </if>
  584. <if test="mainSpID != null and mainSpID != ''">
  585. mainSpID = #{mainSpID},
  586. </if>
  587. <if test="orderBeanAmount != null and orderBeanAmount != ''">
  588. orderBeanAmount = #{orderBeanAmount},
  589. </if>
  590. <if test="useBeanAmount != null and useBeanAmount != ''">
  591. useBeanAmount = #{useBeanAmount},
  592. </if>
  593. <if test="useBeanFlag != null and useBeanFlag != ''">
  594. useBeanFlag = #{useBeanFlag},
  595. </if>
  596. <if test="canRefundFlag != null and canRefundFlag != ''">
  597. canRefundFlag = #{canRefundFlag},
  598. </if>
  599. <if test="useBalanceFlag != null and useBalanceFlag != ''">
  600. useBalanceFlag = #{useBalanceFlag},
  601. </if>
  602. <if test="canRefundBeans != null and canRefundBeans != ''">
  603. canRefundBeans = #{canRefundBeans},
  604. </if>
  605. <if test="freePostageFee != null and freePostageFee != ''">
  606. freePostageFee = #{freePostageFee},
  607. </if>
  608. <if test="freePostageTicketID != null and freePostageTicketID != ''">
  609. freePostageTicketID = #{freePostageTicketID},
  610. </if>
  611. <if test="brokerage != null and brokerage != ''">
  612. brokerage = #{brokerage},
  613. </if>
  614. <if test="delFlag != null and delFlag != ''">
  615. delFlag = #{delFlag},
  616. </if>
  617. <if test="refundsAmount != null and refundsAmount != ''">
  618. refundsAmount = #{refundsAmount},
  619. </if>
  620. <if test="orderStatusFlag != null and orderStatusFlag != ''">
  621. orderStatusFlag = #{orderStatusFlag},
  622. </if>
  623. <if test="buyStatus != null and buyStatus != ''">
  624. buyStatus = #{buyStatus},
  625. </if>
  626. <if test="deliveryTimeMills != null and deliveryTimeMills != ''">
  627. deliveryTimeMills = #{deliveryTimeMills},
  628. </if>
  629. <if test="orderSubmitType != null and orderSubmitType != ''">
  630. orderSubmitType = #{orderSubmitType},
  631. </if>
  632. <if test="orderType != null and orderType != ''">
  633. orderType = #{orderType},
  634. </if>
  635. <if test="orderTime != null and orderTime != ''">
  636. orderTime = #{orderTime},
  637. </if>
  638. <if test="presentNum != null and presentNum != ''">
  639. presentNum = #{presentNum},
  640. </if>
  641. <if test="preferential != null and preferential != ''">
  642. preferential = #{preferential},
  643. </if>
  644. <if test="outStoreNum != null and outStoreNum != ''">
  645. outStoreNum = #{outStoreNum},
  646. </if>
  647. <if test="outStoreTimes != null and outStoreTimes != ''">
  648. outStoreTimes = #{outStoreTimes},
  649. </if>
  650. <if test="splitFlag != null and splitFlag != ''">
  651. splitFlag = #{splitFlag},
  652. </if>
  653. <if test="autoReceiveTimeMills != null and autoReceiveTimeMills != ''">
  654. autoReceiveTimeMills = #{autoReceiveTimeMills},
  655. </if>
  656. <if test="autoOverTimeMills != null and autoOverTimeMills != ''">
  657. autoOverTimeMills = #{autoOverTimeMills},
  658. </if>
  659. <if test="receiveGoodsTime != null and receiveGoodsTime != ''">
  660. receiveGoodsTime = #{receiveGoodsTime},
  661. </if>
  662. <if test="totalAddedValueTax != null and totalAddedValueTax != ''">
  663. totalAddedValueTax = #{totalAddedValueTax},
  664. </if>
  665. <if test="note != null and note != ''">
  666. note = #{note},
  667. </if>
  668. <if test="sendOutStatus != null and sendOutStatus != ''">
  669. sendOutStatus = #{sendOutStatus}
  670. </if>
  671. </set>
  672. where shopOrderID = #{shopOrderID}
  673. </update>
  674. <select id="findPayOrderList" resultType="newShopOrder">
  675. select<include refid="shopOrderColumns"/>,
  676. co.payTotalFee AS payTotalFee,
  677. bou.name AS buyer,
  678. s.name AS shopName,
  679. c.name AS clubName,
  680. cdr.payWay AS payWay
  681. from cm_shop_order a
  682. left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
  683. left join bp_order_userinfo bou on bou.orderId = a.orderID
  684. left join cm_order co on co.orderID = a.orderID
  685. LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
  686. LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
  687. left join shop s on s.shopID = a.shopID
  688. LEFT JOIN club c ON c.userID = a.userID
  689. <where>
  690. <if test="startTime != null and startTime != ''">
  691. AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
  692. </if>
  693. <if test="endTime != null and endTime != ''">
  694. AND (a.orderTime &lt; #{endTime} OR a.orderTime = #{endTime})
  695. </if>
  696. <if test="orderID != null and orderID != ''">
  697. AND a.orderID = #{orderID}
  698. </if>
  699. <if test="organizeID != null and organizeID != 9999">
  700. AND co.organizeID = #{organizeID}
  701. </if>
  702. <if test="organizeID == 9999 ">
  703. AND co.orderType = 2
  704. </if>
  705. <if test="orderNo != null and orderNo != ''">
  706. AND a.orderNo like concat('%', #{orderNo} ,'%')
  707. </if>
  708. <if test="ps != null and ps.length>0 ">
  709. AND a.payStatus in
  710. <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
  711. #{item}
  712. </foreach>
  713. </if>
  714. <if test="shopName != null and shopName != ''">
  715. AND s.name like concat('%', #{shopName} ,'%')
  716. </if>
  717. <if test="buyer != null and buyer != ''">
  718. AND bou.name like concat('%', #{buyer} ,'%')
  719. </if>
  720. <if test="clubName != null and clubName != ''">
  721. AND c.name like concat('%', #{clubName} ,'%')
  722. </if>
  723. <if test="shopOrderID != null and shopOrderID != ''">
  724. AND a.shopOrderID = #{shopOrderID}
  725. </if>
  726. <if test="shopOrderNo != null and shopOrderNo != ''">
  727. AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
  728. </if>
  729. and (co.confirmFlag = '1' or co.confirmFlag = '2')
  730. <if test="operatingMode != null and operatingMode == '1'.toString()">
  731. and a.payStatus != 3 and co.status NOT IN (6,7)
  732. </if>
  733. <if test="operatingMode != null and operatingMode == '2'.toString()">
  734. and a.payStatus != 1 and co.status != 6
  735. </if>
  736. <if test="operatingMode != null and operatingMode == '3'.toString()">
  737. and a.payStatus = 3 and co.status NOT IN (6,7)
  738. </if>
  739. and co.delFlag = 0
  740. -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
  741. and a.delFlag = 0
  742. and (a.organizeID!=4 or a.organizeID is null)
  743. and a.shopID != 998
  744. and co.orderID not in (
  745. SELECT orderID FROM cm_order_product WHERE productID IN
  746. (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069) GROUP BY orderID
  747. )
  748. </where>
  749. group by a.shopOrderID
  750. ORDER BY a.shopOrderID DESC
  751. </select>
  752. <select id="findPayOrderListByIDs" resultType="newShopOrder">
  753. select distinct<include refid="shopOrderColumns"/>,
  754. co.payTotalFee AS payTotalFee,
  755. co.promotionFullReduction,
  756. bou.name AS buyer,
  757. s.name AS shopName
  758. from cm_shop_order a
  759. left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
  760. left join bp_order_userinfo bou on bou.orderId = a.orderID
  761. left join cm_order co on co.orderID = a.orderID
  762. left join shop s on s.shopID = a.shopID
  763. <where>
  764. <if test="ids != null and ids != ''">
  765. and a.shopOrderID in
  766. <foreach collection="ids" open="(" close=")" item="id" separator=",">
  767. #{id}
  768. </foreach>
  769. </if>
  770. </where>
  771. ORDER BY a.shopOrderID DESC
  772. </select>
  773. <select id="findByRefundID" resultType="newShopOrder">
  774. select distinct<include refid="shopOrderColumns"/>,
  775. co.payTotalFee AS payTotalFee,
  776. bou.name AS buyer,
  777. s.name AS shopName
  778. from cm_shop_order a
  779. left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
  780. left join bp_order_userinfo bou on bou.orderId = a.orderID
  781. left join cm_order co on co.orderID = a.orderID
  782. left join shop s on s.shopID = a.shopID
  783. where a.shopOrderID in
  784. (select crsr.shopOrderID
  785. from cm_refund_shop_record crsr
  786. left join cm_refund_shop crs on crsr.refundShopID = crs.id
  787. where crs.id = #{refundShopID} and crsr.shopOrderID is not null)
  788. ORDER BY a.shopOrderID DESC
  789. </select>
  790. <select id="updatePayShopAmount">
  791. UPDATE cm_shop_order
  792. <set>
  793. <if test="shopProductAmount != null">
  794. shopProductAmount = #{shopProductAmount},
  795. </if>
  796. <if test="shopPostFee != null">
  797. shopPostFee = #{shopPostFee},
  798. </if>
  799. <if test="shopTaxFee != null">
  800. shopTaxFee = #{shopTaxFee},
  801. </if>
  802. <if test="shouldPayShopAmount != null">
  803. shouldPayShopAmount = #{shouldPayShopAmount},
  804. </if>
  805. <if test="shopOtherFee != null">
  806. shopOtherFee = #{shopOtherFee},
  807. </if>
  808. <if test="payStatus != null">
  809. payStatus = #{payStatus},
  810. </if>
  811. <if test="payedShopAmount != null">
  812. payedShopAmount = #{payedShopAmount}
  813. </if>
  814. <if test="status != null and status != ''">
  815. shopStatus = #{status},
  816. </if>
  817. </set>
  818. WHERE shopOrderID = #{shopOrderID}
  819. </select>
  820. <select id="findByShopOrderIDs" resultType="newShopOrder">
  821. select distinct<include refid="shopOrderColumns"/>,
  822. co.payTotalFee AS payTotalFee,
  823. co.promotionFullReduction AS promotionFullReduction,
  824. bou.name AS buyer,
  825. s.name AS shopName,
  826. c.name AS clubName
  827. from cm_shop_order a
  828. left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
  829. left join bp_order_userinfo bou on bou.orderId = a.orderID
  830. left join cm_order co on co.orderID = a.orderID
  831. left join shop s on s.shopID = a.shopID
  832. left join club c on c.userID = a.userID
  833. <if test="shopOrderIDs != null and shopOrderIDs.size() > 0">
  834. where a.shopOrderID in
  835. <foreach collection="shopOrderIDs" separator="," item="shopOrderID" open="(" close=")">
  836. #{shopOrderID}
  837. </foreach>
  838. </if>
  839. </select>
  840. <update id="updatePaying">
  841. update cm_shop_order
  842. set paying = #{paying}
  843. where shopOrderID = #{shopOrderID}
  844. </update>
  845. <update id="outPaying">
  846. update cm_shop_order
  847. set paying = '0'
  848. where shopOrderID in
  849. (select cpsr.shopOrderID
  850. from cm_pay_shop_record cpsr
  851. left join cm_pay_shop cps on cps.id = cpsr.payShopID
  852. where cps.id = #{payShopID}
  853. and cps.delFlag = '0'
  854. and cpsr.delFlag = '0'
  855. and cpsr.shopOrderID is not null)
  856. </update>
  857. <update id="inPaying">
  858. update cm_shop_order
  859. set paying = '1'
  860. where shopOrderID in
  861. (select cpsr.shopOrderID
  862. from cm_pay_shop_record cpsr
  863. left join cm_pay_shop cps on cps.id = cpsr.payShopID
  864. where cps.id = #{payShopID}
  865. and cps.delFlag = '0'
  866. and cpsr.delFlag = '0'
  867. and cpsr.shopOrderID is not null)
  868. </update>
  869. <update id="updatePayStatus">
  870. update cm_shop_order
  871. set payStatus = #{payStatus}
  872. where shopOrderID = #{shopOrderID}
  873. </update>
  874. <select id="findPayStatusByOrderID" resultType="string">
  875. select payStatus
  876. from cm_shop_order
  877. where orderID = #{orderID}
  878. AND shopID != 998
  879. </select>
  880. <select id="getPayingStatus" resultType="string">
  881. select ifnull(paying, '0')
  882. from cm_shop_order
  883. where shopOrderID in
  884. (select cpsr.shopOrderID
  885. from cm_pay_shop_record cpsr
  886. left join cm_pay_shop cps on cps.id = cpsr.payShopID
  887. where cps.id = #{payShopID}
  888. and cps.delFlag = '0'
  889. and cpsr.delFlag = '0'
  890. and cpsr.shopOrderID is not null)
  891. </select>
  892. <select id="findSiblingPostFeeOrder" resultType="newShopOrder">
  893. select
  894. <include refid="shopOrderColumns"/>
  895. from cm_shop_order a
  896. left join cm_order co on co.orderID = a.orderID
  897. where a.orderID = #{orderID} and a.shopID = 998
  898. </select>
  899. <select id="findShopOrderNos" resultType="java.lang.String">
  900. SELECT CONCAT(shopOrderNo, '(', shopOrderID, ')') AS result
  901. FROM cm_shop_order
  902. WHERE orderID = #{orderID}
  903. and shopId != 998
  904. </select>
  905. <select id="findIncome" resultType="java.lang.Double">
  906. SELECT ROUND(IFNULL((
  907. co.payTotalFee - (IFNULL((
  908. SELECT ROUND(SUM((IFNULL(op.costPrice, 0) *
  909. (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0))) +
  910. IFNULL(op.shouldPayTotalTax, 0)),
  911. 2)
  912. FROM cm_order_product op
  913. LEFT JOIN cm_shop_order cso ON cso.shopOrderID = op.shopOrderID
  914. WHERE cso.orderID = co.orderID
  915. AND op.productID != 999
  916. GROUP BY cso.orderID
  917. ), 0))
  918. - (SELECT IFNULL(SUM(cso.shopOtherFee), 0)
  919. FROM cm_shop_order cso
  920. WHERE cso.orderID = co.orderID)
  921. - IFNULL((SELECT SUM(shopPostFee + IF(differenceType = 1, differencePrice, 0) -
  922. IF(differenceType = 2, differencePrice, 0))
  923. FROM cm_shop_order
  924. WHERE orderID = co.orderID), 0)
  925. + IFNULL((SELECT SUM(cpsr.wipePayment)
  926. FROM cm_pay_shop_record cpsr
  927. WHERE cpsr.shopOrderID IN (SELECT cso.shopOrderID
  928. FROM cm_shop_order cso
  929. WHERE cso.orderID = co.orderID)
  930. AND cpsr.delFlag = 0
  931. AND (cpsr.`status` = 1 OR cpsr.`status` = 0)), 0)
  932. +IFNULL(co.rebateFee,0)
  933. ), 0), 2) AS "采美总佣金"
  934. FROM cm_order co
  935. WHERE co.orderID = #{orderID}
  936. </select>
  937. <update id="updateByShopOtherFee">
  938. UPDATE cm_shop_order
  939. SET shopOtherFee = #{shopOtherFee}
  940. WHERE shopOrderID = #{shopOrderId}
  941. </update>
  942. <update id="updateByDifferencePrice">
  943. UPDATE cm_shop_order
  944. SET differenceType = #{type},
  945. differencePrice = #{differencePrice}
  946. WHERE shopOrderID = #{shopOrderId}
  947. </update>
  948. <select id="findSplitList" resultType="newShopOrder">
  949. SELECT co.couponAmount AS couponAmount,
  950. co.userBeans AS userBeans,
  951. a.shopOrderID AS shopOrderID,
  952. a.orderID AS orderID,
  953. a.organizeID AS organizeID,
  954. a.shopOrderNo AS shopOrderNo,
  955. a.orderNo AS orderNo,
  956. a.userID AS userID,
  957. a.shopID AS shopID,
  958. a.itemCount AS itemCount,
  959. a.townID AS townID,
  960. a.productAmount AS productAmount,
  961. a.discountAmount AS discountAmount,
  962. a.accountAmount AS accountAmount,
  963. a.totalAmount AS totalAmount,
  964. a.payFlag AS payFlag,
  965. a.payTime AS payTime,
  966. a.finishTime AS finishTime,
  967. a.refundStatus AS refundStatus,
  968. a.needPayAmount AS needPayAmount,
  969. a.canRefundAmount AS canRefundAmount,
  970. a.refundAmount AS refundAmount,
  971. a.clubID AS clubID,
  972. a.spID AS spID,
  973. a.mainSpID AS mainSpID,
  974. a.orderBeanAmount AS orderBeanAmount,
  975. a.useBeanAmount AS useBeanAmount,
  976. a.useBeanFlag AS useBeanFlag,
  977. a.canRefundFlag AS canRefundFlag,
  978. a.useBalanceFlag AS useBalanceFlag,
  979. a.canRefundBeans AS canRefundBeans,
  980. a.freePostageFee AS freePostageFee,
  981. a.freePostageTicketID AS freePostageTicketID,
  982. a.brokerage AS brokerage,
  983. a.delFlag AS delFlag,
  984. a.refundsAmount AS refundsAmount,
  985. a.orderStatusFlag AS orderStatusFlag,
  986. a.buyStatus AS buyStatus,
  987. a.orderSubmitType AS orderSubmitType,
  988. a.orderType AS orderType,
  989. a.orderTime AS orderTime,
  990. a.deliveryTimeMills AS deliveryTimeMills,
  991. a.presentNum AS presentNum,
  992. a.preferential AS preferential,
  993. a.outStoreNum AS outStoreNum,
  994. IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
  995. a.splitFlag AS splitFlag,
  996. a.autoReceiveTimeMills AS autoReceiveTimeMills,
  997. a.autoOverTimeMills AS autoOverTimeMills,
  998. a.receiveGoodsTime AS receiveGoodsTime,
  999. a.totalAddedValueTax AS totalAddedValueTax,
  1000. a.note AS note,
  1001. a.payStatus AS payStatus,
  1002. a.sendOutStatus AS sendOutStatus,
  1003. a.shopProductAmount AS shopProductAmount,
  1004. a.shopPostFee AS shopPostFee,
  1005. a.shopTaxFee AS shopTaxFee,
  1006. a.shouldPayShopAmount AS shouldPayShopAmount,
  1007. a.payedShopAmount AS payedShopAmount,
  1008. a.shopOtherFee AS shopOtherFee,
  1009. a.paying AS paying,
  1010. a.costType AS costType,
  1011. a.modifyShouldPayNote AS modifyShouldPayNote,
  1012. a.orderPromotionsId AS orderPromotionsId,
  1013. a.differenceType AS differenceType,
  1014. a.differencePrice AS differencePrice,
  1015. a.proportional AS proportional,
  1016. a.promotionFullReduction AS promotionFullReduction,
  1017. a.zeroCostFlag AS zeroCostFlag,
  1018. co.payTotalFee AS payTotalFee,
  1019. co.status AS STATUS,
  1020. bou.name AS buyer,
  1021. s.name AS shopName,
  1022. c.name AS clubName
  1023. FROM cm_shop_order a
  1024. LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
  1025. LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
  1026. LEFT JOIN cm_order co ON co.orderID = a.orderID
  1027. LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
  1028. LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
  1029. LEFT JOIN shop s ON s.shopID = a.shopID
  1030. LEFT JOIN club c ON c.userID = a.userID
  1031. LEFT JOIN cm_order_product cop ON a.shopOrderID = cop.shopOrderID
  1032. LEFT JOIN product p ON cop.productID = p.productID
  1033. WHERE co.organizeID = 0
  1034. AND a.refundStatus = 1
  1035. AND co.delFlag = 0
  1036. AND co.orderType != 2
  1037. AND a.delFlag = 0
  1038. AND a.shopID != 998
  1039. AND (a.organizeID!=4 or a.organizeID is null)
  1040. AND cdr.payWay = 1
  1041. AND cdr.receiptDate <![CDATA[ <= ]]> NOW()
  1042. AND cror.relationType = 2
  1043. AND cror.delFlag = 0
  1044. AND cror.mbOrderId IS NOT NULL
  1045. AND cror.splitStatus = 0
  1046. AND a.receiptStatus=3
  1047. -- AND p.splitCode != 'E1807059160'
  1048. AND co.orderID NOT IN (SELECT orderID FROM cm_order_product cops LEFT JOIN product ps ON cops.productID = ps.productID WHERE ps.splitCode = 'E1807059160' AND cops.orderID = cop.orderID)
  1049. AND co.orderID NOT IN (
  1050. SELECT orderID
  1051. FROM cm_order_product
  1052. WHERE productID IN
  1053. (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069)
  1054. GROUP BY orderID
  1055. )
  1056. GROUP BY a.shopOrderID
  1057. ORDER BY a.shopOrderID DESC
  1058. </select>
  1059. <select id="getOpenidListByPermission" resultType="java.lang.String">
  1060. SELECT openid
  1061. FROM `wechat_user`
  1062. WHERE unionid = #{unionid}
  1063. </select>
  1064. <select id="FromUnionId" resultType="java.lang.String">
  1065. SELECT unionID FROM `cm_order` WHERE orderID=#{orderId}
  1066. </select>
  1067. <select id="UnionId" resultType="java.lang.String">
  1068. SELECT unionID FROM `cm_order` WHERE userID=#{userID}
  1069. ORDER BY orderID DESC
  1070. LIMIT 1
  1071. </select>
  1072. <select id="getProductOrder" resultType="java.lang.String">
  1073. SELECT productID
  1074. FROM `cm_order_product`
  1075. WHERE orderID = #{orderid}
  1076. </select>
  1077. <select id="payWay" resultType="java.lang.Integer">
  1078. SELECT cdr.payWay
  1079. FROM cm_shop_order a
  1080. LEFT JOIN cm_order co ON co.orderID = a.orderID
  1081. LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
  1082. LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
  1083. WHERE a.shopOrderID = #{shopOrderID}
  1084. </select>
  1085. <select id="findSettlementList" resultType="com.caimei.modules.order.entity.NewShopOrder">
  1086. SELECT co.couponAmount AS couponAmount,
  1087. co.userBeans AS userBeans,
  1088. a.shopOrderID AS shopOrderID,
  1089. a.orderID AS orderID,
  1090. a.organizeID AS organizeID,
  1091. a.shopOrderNo AS shopOrderNo,
  1092. a.orderNo AS orderNo,
  1093. a.userID AS userID,
  1094. a.shopID AS shopID,
  1095. a.itemCount AS itemCount,
  1096. a.townID AS townID,
  1097. a.productAmount AS productAmount,
  1098. a.discountAmount AS discountAmount,
  1099. a.accountAmount AS accountAmount,
  1100. a.totalAmount AS totalAmount,
  1101. a.payFlag AS payFlag,
  1102. a.payTime AS payTime,
  1103. a.finishTime AS finishTime,
  1104. a.refundStatus AS refundStatus,
  1105. a.needPayAmount AS needPayAmount,
  1106. a.canRefundAmount AS canRefundAmount,
  1107. a.refundAmount AS refundAmount,
  1108. a.clubID AS clubID,
  1109. a.spID AS spID,
  1110. a.mainSpID AS mainSpID,
  1111. a.orderBeanAmount AS orderBeanAmount,
  1112. a.useBeanAmount AS useBeanAmount,
  1113. a.useBeanFlag AS useBeanFlag,
  1114. a.canRefundFlag AS canRefundFlag,
  1115. a.useBalanceFlag AS useBalanceFlag,
  1116. a.canRefundBeans AS canRefundBeans,
  1117. a.freePostageFee AS freePostageFee,
  1118. a.freePostageTicketID AS freePostageTicketID,
  1119. a.brokerage AS brokerage,
  1120. a.delFlag AS delFlag,
  1121. a.refundsAmount AS refundsAmount,
  1122. a.orderStatusFlag AS orderStatusFlag,
  1123. a.buyStatus AS buyStatus,
  1124. a.orderSubmitType AS orderSubmitType,
  1125. a.orderType AS orderType,
  1126. a.orderTime AS orderTime,
  1127. a.deliveryTimeMills AS deliveryTimeMills,
  1128. a.presentNum AS presentNum,
  1129. a.preferential AS preferential,
  1130. a.outStoreNum AS outStoreNum,
  1131. IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
  1132. a.splitFlag AS splitFlag,
  1133. a.autoReceiveTimeMills AS autoReceiveTimeMills,
  1134. a.autoOverTimeMills AS autoOverTimeMills,
  1135. a.receiveGoodsTime AS receiveGoodsTime,
  1136. a.totalAddedValueTax AS totalAddedValueTax,
  1137. a.note AS note,
  1138. a.payStatus AS payStatus,
  1139. a.sendOutStatus AS sendOutStatus,
  1140. a.shopProductAmount AS shopProductAmount,
  1141. a.shopPostFee AS shopPostFee,
  1142. a.shopTaxFee AS shopTaxFee,
  1143. a.shouldPayShopAmount AS shouldPayShopAmount,
  1144. a.payedShopAmount AS payedShopAmount,
  1145. a.shopOtherFee AS shopOtherFee,
  1146. a.paying AS paying,
  1147. a.costType AS costType,
  1148. a.modifyShouldPayNote AS modifyShouldPayNote,
  1149. a.orderPromotionsId AS orderPromotionsId,
  1150. a.differenceType AS differenceType,
  1151. a.differencePrice AS differencePrice,
  1152. a.proportional AS proportional,
  1153. a.promotionFullReduction AS promotionFullReduction,
  1154. a.zeroCostFlag AS zeroCostFlag,
  1155. a.settleStatus AS settleStatus,
  1156. co.payTotalFee AS payTotalFee,
  1157. co.status AS STATUS,
  1158. bou.name AS buyer,
  1159. s.name AS shopName,
  1160. c.name AS clubName
  1161. FROM cm_shop_order a
  1162. LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
  1163. LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
  1164. LEFT JOIN cm_order co ON co.orderID = a.orderID
  1165. LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
  1166. LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
  1167. LEFT JOIN cm_split_account csa on csa.shopOrderId = a.shopOrderID
  1168. LEFT JOIN shop s ON s.shopID = a.shopID
  1169. LEFT JOIN club c ON c.userID = a.userID
  1170. LEFT JOIN cm_order_product cop ON a.shopOrderID = cop.shopOrderID
  1171. LEFT JOIN product p ON cop.productID = p.productID
  1172. WHERE co.organizeID = 0
  1173. AND co.refundType != 2
  1174. AND co.delFlag = 0
  1175. AND co.orderType != 2
  1176. AND co.receiptStatus = 3
  1177. AND a.delFlag = 0
  1178. AND a.shopID != 998
  1179. AND (a.organizeID!=4 or a.organizeID is null)
  1180. AND cdr.payWay = 1
  1181. AND cror.relationType = 2
  1182. AND a.settleStatus in (1,2)
  1183. AND csa.settleStatus = 0
  1184. AND cror.delFlag = 0
  1185. AND cror.mbOrderId IS NOT NULL
  1186. AND cror.splitStatus = 1
  1187. -- AND p.splitCode != 'E1807059160'
  1188. AND co.orderID NOT IN (SELECT orderID FROM cm_order_product cops LEFT JOIN product ps ON cops.productID = ps.productID WHERE ps.splitCode = 'E1807059160' AND cops.orderID = cop.orderID)
  1189. <if test="startTime != null and startTime != ''">
  1190. AND (a.orderTime &gt; #{startTime} OR a.orderTime = #{startTime})
  1191. </if>
  1192. <if test="endTime != null and endTime != ''">
  1193. AND (a.orderTime &lt; #{endTime} OR a.orderTime = #{endTime})
  1194. </if>
  1195. <if test="orderID != null and orderID != ''">
  1196. AND a.orderID = #{orderID}
  1197. </if>
  1198. <if test="orderNo != null and orderNo != ''">
  1199. AND a.orderNo like concat('%', #{orderNo} ,'%')
  1200. </if>
  1201. <if test="ps != null and ps.length>0 ">
  1202. AND a.settleStatus in
  1203. <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
  1204. #{item}
  1205. </foreach>
  1206. </if>
  1207. <if test="shopName != null and shopName != ''">
  1208. AND s.name like concat('%', #{shopName} ,'%')
  1209. </if>
  1210. <if test="clubName != null and clubName != ''">
  1211. AND c.name like concat('%', #{clubName} ,'%')
  1212. </if>
  1213. <if test="shopOrderID != null and shopOrderID != ''">
  1214. AND a.shopOrderID = #{shopOrderID}
  1215. </if>
  1216. <if test="shopOrderNo != null and shopOrderNo != ''">
  1217. AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
  1218. </if>
  1219. GROUP BY a.shopOrderID
  1220. ORDER BY a.shopOrderID DESC
  1221. </select>
  1222. <select id="findSettleRecord" resultType="com.caimei.modules.order.entity.SettleRecord">
  1223. select settleAmount,settleType,settleTime
  1224. from cm_settle_record
  1225. where shopOrderId = #{shopOrderID}
  1226. </select>
  1227. <select id="findListByShopOrderId" resultType="com.caimei.modules.order.entity.NewShopOrder">
  1228. SELECT<include refid="shopOrderColumns"/>,
  1229. b.name as shopName,
  1230. oa.id as orderArchiveId,
  1231. co.receiptStatus
  1232. FROM cm_shop_order a
  1233. left join shop b on a.shopID = b.shopID
  1234. left join cm_order_archive oa on a.shopOrderID = oa.shopOrderId
  1235. left join cm_order co on co.orderID = a.orderID
  1236. WHERE a.shopOrderId = #{onlineShopOrderId}
  1237. ORDER BY a.shopOrderNo DESC
  1238. </select>
  1239. <resultMap type="com.caimei.modules.order.entity.NewShopOrder" id="CmShopOrderResult">
  1240. <result property="shopOrderID" column="shopOrderID" />
  1241. <result property="shopOrderNo" column="shopOrderNo" />
  1242. <result property="orderNo" column="orderNo" />
  1243. <result property="orderID" column="orderID" />
  1244. <result property="organizeID" column="organizeID" />
  1245. <result property="isColdChina" column="isColdChina" />
  1246. <result property="userID" column="userID" />
  1247. <result property="shopID" column="shopID" />
  1248. <result property="orderPromotionsId" column="orderPromotionsId" />
  1249. <result property="orderType" column="orderType" />
  1250. <result property="orderSubmitType" column="orderSubmitType" />
  1251. <result property="presentNum" column="presentNum" />
  1252. <result property="itemCount" column="itemCount" />
  1253. <result property="outStoreNum" column="outStoreNum" />
  1254. <result property="outStoreTimes" column="outStoreTimes" />
  1255. <result property="townID" column="townID" />
  1256. <result property="note" column="note" />
  1257. <result property="eachDiscount" column="eachDiscount" />
  1258. <result property="realPay" column="realPay" />
  1259. <result property="receiptAmount" column="receiptAmount" />
  1260. <result property="accountAmount" column="accountAmount" />
  1261. <result property="productAmount" column="productAmount" />
  1262. <result property="totalAmount" column="totalAmount" />
  1263. <result property="needPayAmount" column="needPayAmount" />
  1264. <result property="discountAmount" column="discountAmount" />
  1265. <result property="preferential" column="preferential" />
  1266. <result property="promotionFullReduction" column="promotionFullReduction" />
  1267. <result property="payFlag" column="payFlag" />
  1268. <result property="orderTime" column="orderTime" />
  1269. <result property="payTime" column="payTime" />
  1270. <result property="finishTime" column="finishTime" />
  1271. <result property="autoOverTimeMills" column="autoOverTimeMills" />
  1272. <result property="settleStatus" column="settleStatus" />
  1273. <result property="payStatus" column="payStatus" />
  1274. <result property="receiptStatus" column="receiptStatus" />
  1275. <result property="sendOutStatus" column="sendOutStatus" />
  1276. <result property="refundStatus" column="refundStatus" />
  1277. <result property="returnGoodsStatus" column="returnGoodsStatus" />
  1278. <result property="receiveGoodsTime" column="receiveGoodsTime" />
  1279. <result property="autoReceiveTimeMills" column="autoReceiveTimeMills" />
  1280. <result property="totalAddedValueTax" column="totalAddedValueTax" />
  1281. <result property="canRefundAmount" column="canRefundAmount" />
  1282. <result property="refundAmount" column="refundAmount" />
  1283. <result property="clubID" column="clubID" />
  1284. <result property="spID" column="spID" />
  1285. <result property="mainSpID" column="mainSpID" />
  1286. <result property="orderBeanAmount" column="orderBeanAmount" />
  1287. <result property="useBeanAmount" column="useBeanAmount" />
  1288. <result property="useBeanFlag" column="useBeanFlag" />
  1289. <result property="canRefundFlag" column="canRefundFlag" />
  1290. <result property="useBalanceFlag" column="useBalanceFlag" />
  1291. <result property="canRefundBeans" column="canRefundBeans" />
  1292. <result property="freePostageFee" column="freePostageFee" />
  1293. <result property="freePostageTicketID" column="freePostageTicketID" />
  1294. <result property="brokerage" column="brokerage" />
  1295. <result property="delFlag" column="delFlag" />
  1296. <result property="refundsAmount" column="refundsAmount" />
  1297. <result property="orderStatusFlag" column="orderStatusFlag" />
  1298. <result property="buyStatus" column="buyStatus" />
  1299. <result property="deliveryTimeMills" column="deliveryTimeMills" />
  1300. <result property="orderDeliveryID" column="orderDeliveryID" />
  1301. <result property="splitFlag" column="splitFlag" />
  1302. <result property="paying" column="paying" />
  1303. <result property="shopProductAmount" column="shopProductAmount" />
  1304. <result property="shopPostFee" column="shopPostFee" />
  1305. <result property="shopPostFlag" column="shopPostFlag" />
  1306. <result property="shopTaxFee" column="shopTaxFee" />
  1307. <result property="payCmAmount" column="payCmAmount" />
  1308. <result property="shouldPayShopAmount" column="shouldPayShopAmount" />
  1309. <result property="payedShopAmount" column="payedShopAmount" />
  1310. <result property="shopOtherFee" column="shopOtherFee" />
  1311. <result property="receiptedFlag" column="receiptedFlag" />
  1312. <result property="receiptedType" column="receiptedType" />
  1313. <result property="costType" column="costType" />
  1314. <result property="proportional" column="proportional" />
  1315. <result property="modifyShouldPayNote" column="modifyShouldPayNote" />
  1316. <result property="modifyShouldPayUserID" column="modifyShouldPayUserID" />
  1317. <result property="modifyShouldPayDate" column="modifyShouldPayDate" />
  1318. <result property="zeroCostFlag" column="zeroCostFlag" />
  1319. <result property="differenceType" column="differenceType" />
  1320. <result property="differencePrice" column="differencePrice" />
  1321. <result property="svipShopReduction" column="svipShopReduction" />
  1322. <result property="splitCode" column="splitCode" />
  1323. <result property="paySuccessCounter" column="paySuccessCounter" />
  1324. <result property="onlinePayWays" column="onlinePayWays" />
  1325. <result property="status" column="shopStatus" />
  1326. </resultMap>
  1327. <sql id="selectCmShopOrderVo">
  1328. select
  1329. cm_shop_order.shopOrderID,
  1330. cm_shop_order.shopOrderNo,
  1331. cm_shop_order.orderNo,
  1332. cm_shop_order.orderID,
  1333. cm_shop_order.organizeID,
  1334. cm_shop_order.isColdChina,
  1335. cm_shop_order.userID,
  1336. cm_shop_order.shopID,
  1337. cm_shop_order.orderPromotionsId,
  1338. cm_shop_order.orderType,
  1339. cm_shop_order.orderSubmitType,
  1340. cm_shop_order.presentNum,
  1341. cm_shop_order.itemCount,
  1342. cm_shop_order.outStoreNum,
  1343. cm_shop_order.outStoreTimes,
  1344. cm_shop_order.townID,
  1345. cm_shop_order.note,
  1346. ifnull(cm_shop_order.accountAmount,0) AS accountAmount,
  1347. ifnull(cm_shop_order.productAmount,0) AS productAmount,
  1348. ifnull(cm_shop_order.totalAmount,0) AS totalAmount,
  1349. ifnull(cm_shop_order.needPayAmount,0) AS needPayAmount,
  1350. ifnull(cm_shop_order.discountAmount,0) AS discountAmount,
  1351. ifnull(cm_shop_order.preferential,0) AS preferential,
  1352. ifnull(cm_shop_order.promotionFullReduction,0) AS promotionFullReduction,
  1353. cm_shop_order.payFlag,
  1354. cm_shop_order.orderTime,
  1355. cm_shop_order.payTime,
  1356. cm_shop_order.finishTime,
  1357. cm_shop_order.autoOverTimeMills,
  1358. cm_shop_order.settleStatus,
  1359. cm_shop_order.payStatus,
  1360. cm_shop_order.sendOutStatus,
  1361. cm_shop_order.refundStatus,
  1362. cm_shop_order.shopStatus,
  1363. cm_shop_order.returnGoodsStatus,
  1364. cm_shop_order.receiveGoodsTime,
  1365. cm_shop_order.autoReceiveTimeMills,
  1366. ifnull(cm_shop_order.totalAddedValueTax,0) AS totalAddedValueTax,
  1367. cm_shop_order.canRefundAmount,
  1368. cm_shop_order.refundAmount,
  1369. cm_shop_order.clubID,
  1370. cm_shop_order.spID,
  1371. cm_shop_order.mainSpID,
  1372. cm_shop_order.orderBeanAmount,
  1373. cm_shop_order.useBeanAmount,
  1374. cm_shop_order.useBeanFlag,
  1375. cm_shop_order.canRefundFlag,
  1376. cm_shop_order.useBalanceFlag,
  1377. cm_shop_order.canRefundBeans,
  1378. ifnull(cm_shop_order.freePostageFee,0) AS freePostageFee,
  1379. cm_shop_order.freePostageTicketID,
  1380. ifnull(cm_shop_order.brokerage,0) AS brokerage,
  1381. cm_shop_order.delFlag,
  1382. ifnull(cm_shop_order.refundsAmount,0) AS refundsAmount,
  1383. cm_shop_order.orderStatusFlag,
  1384. cm_shop_order.buyStatus,
  1385. cm_shop_order.deliveryTimeMills,
  1386. cm_shop_order.confirmTime,
  1387. cm_shop_order.updateTime,
  1388. cm_shop_order.orderDeliveryID,
  1389. cm_shop_order.splitFlag,
  1390. cm_shop_order.receiptedFlag,
  1391. cm_shop_order.receiptedType,
  1392. cm_shop_order.paying,
  1393. ifnull(cm_shop_order.shopProductAmount,0) AS shopProductAmount,
  1394. ifnull(cm_shop_order.shopPostFee,0) AS shopPostFee,
  1395. cm_shop_order.shopPostFlag,
  1396. ifnull(cm_shop_order.shopTaxFee,0) AS shopTaxFee,
  1397. ifnull(cm_shop_order.payCmAmount,0) AS payCmAmount,
  1398. ifnull(cm_shop_order.shouldPayShopAmount,0) AS shouldPayShopAmount,
  1399. ifnull(cm_shop_order.payedShopAmount,0) AS payedShopAmount,
  1400. ifnull(cm_shop_order.shopOtherFee,0) AS shopOtherFee,
  1401. cm_shop_order.costType,
  1402. ifnull(cm_shop_order.proportional,0) AS proportional,
  1403. cm_shop_order.modifyShouldPayNote,
  1404. cm_shop_order.modifyShouldPayUserID,
  1405. cm_shop_order.modifyShouldPayDate,
  1406. cm_shop_order.zeroCostFlag,
  1407. cm_shop_order.differenceType,
  1408. ifnull(cm_shop_order.differencePrice,0) AS differencePrice,
  1409. ifnull(cm_shop_order.svipShopReduction,0) AS svipShopReduction,
  1410. ifnull(cm_shop_order.shopRefundAmount,0) AS shopRefundAmount,
  1411. cm_shop_order.splitCode,
  1412. cm_shop_order.paySuccessCounter,
  1413. cm_shop_order.onlinePayWays,
  1414. cm_shop_order.receiptStatus,
  1415. ifnull(cm_shop_order.receiptAmount,0) AS receiptAmount,
  1416. ifnull(cm_shop_order.eachDiscount,0) AS eachDiscount,
  1417. ifnull(cm_shop_order.realPay,0) AS realPay,
  1418. cm_shop_order.discountFee,
  1419. cm_shop_order.fee
  1420. </sql>
  1421. <select id="getByCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultMap="CmShopOrderResult">
  1422. <include refid="selectCmShopOrderVo"/>
  1423. from cm_shop_order AS cm_shop_order
  1424. <where> cm_shop_order.delFlag = 0
  1425. <if test="shopOrderID != null and shopOrderID != ''">
  1426. and cm_shop_order.shopOrderID
  1427. = #{shopOrderID}
  1428. </if>
  1429. <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
  1430. <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  1431. <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  1432. <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
  1433. #{shopOrderIDIn}
  1434. </foreach>
  1435. </if>
  1436. <if test="shopOrderNo != null and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
  1437. <if test="orderNo != null and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
  1438. <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
  1439. <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
  1440. <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
  1441. <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
  1442. <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
  1443. <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
  1444. <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
  1445. <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
  1446. <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
  1447. <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
  1448. <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
  1449. <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
  1450. <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
  1451. <if test="note != null and note != ''"> and cm_shop_order.note = #{note}</if>
  1452. <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
  1453. <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
  1454. <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
  1455. <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
  1456. <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
  1457. <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
  1458. <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
  1459. <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
  1460. <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
  1461. <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
  1462. <if test="payFlag != null and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
  1463. <if test="orderTime != null and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
  1464. <if test="payTime != null and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
  1465. <if test="finishTime != null and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
  1466. <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
  1467. <if test="settleStatus != null and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
  1468. <if test="payStatus != null and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
  1469. <if test="receiptStatus != null and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
  1470. <if test="sendOutStatus != null and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
  1471. <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
  1472. <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
  1473. <if test="receiveGoodsTime != null and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
  1474. <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
  1475. <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
  1476. <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
  1477. <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
  1478. <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
  1479. <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
  1480. <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
  1481. <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
  1482. <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
  1483. <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
  1484. <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
  1485. <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
  1486. <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
  1487. <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
  1488. <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
  1489. <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
  1490. <if test="delFlag != null and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
  1491. <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
  1492. <if test="orderStatusFlag != null and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
  1493. <if test="buyStatus != null and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
  1494. <if test="deliveryTimeMills != null and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
  1495. <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
  1496. <if test="splitFlag != null and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
  1497. <if test="paying != null and paying != ''"> and cm_shop_order.paying = #{paying}</if>
  1498. <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
  1499. <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
  1500. <if test="shopPostFlag != null and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
  1501. <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
  1502. <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
  1503. <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
  1504. <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
  1505. <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
  1506. <if test="receiptedFlag != null and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
  1507. <if test="receiptedType != null and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
  1508. <if test="costType != null and costType != ''"> and cm_shop_order.costType = #{costType}</if>
  1509. <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
  1510. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
  1511. <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
  1512. <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
  1513. <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
  1514. <if test="differenceType != null and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
  1515. <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
  1516. <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
  1517. <if test="splitCode != null and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
  1518. <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
  1519. <if test="onlinePayWays != null and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
  1520. <if test="status != null and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
  1521. </where>
  1522. group by cm_shop_order.shopOrderID
  1523. order by cm_shop_order.orderTime desc
  1524. limit 0,1
  1525. </select>
  1526. <select id="getCmShopOrderList" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultMap="CmShopOrderResult">
  1527. <include refid="selectCmShopOrderVo"/>
  1528. from cm_shop_order AS cm_shop_order
  1529. <where> cm_shop_order.delFlag = 0
  1530. <if test="shopOrderID != null and shopOrderID != ''">
  1531. and cm_shop_order.shopOrderID
  1532. = #{shopOrderID}
  1533. </if>
  1534. <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
  1535. <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  1536. <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  1537. <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
  1538. #{shopOrderIDIn}
  1539. </foreach>
  1540. </if>
  1541. <if test="shopOrderNo != null and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
  1542. <if test="orderNo != null and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
  1543. <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
  1544. <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
  1545. <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
  1546. <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
  1547. <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
  1548. <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
  1549. <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
  1550. <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
  1551. <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
  1552. <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
  1553. <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
  1554. <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
  1555. <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
  1556. <if test="note != null and note != ''"> and cm_shop_order.note = #{note}</if>
  1557. <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
  1558. <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
  1559. <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
  1560. <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
  1561. <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
  1562. <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
  1563. <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
  1564. <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
  1565. <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
  1566. <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
  1567. <if test="payFlag != null and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
  1568. <if test="orderTime != null and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
  1569. <if test="payTime != null and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
  1570. <if test="finishTime != null and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
  1571. <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
  1572. <if test="settleStatus != null and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
  1573. <if test="payStatus != null and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
  1574. <if test="receiptStatus != null and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
  1575. <if test="sendOutStatus != null and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
  1576. <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
  1577. <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
  1578. <if test="receiveGoodsTime != null and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
  1579. <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
  1580. <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
  1581. <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
  1582. <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
  1583. <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
  1584. <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
  1585. <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
  1586. <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
  1587. <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
  1588. <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
  1589. <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
  1590. <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
  1591. <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
  1592. <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
  1593. <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
  1594. <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
  1595. <if test="delFlag != null and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
  1596. <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
  1597. <if test="orderStatusFlag != null and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
  1598. <if test="buyStatus != null and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
  1599. <if test="deliveryTimeMills != null and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
  1600. <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
  1601. <if test="splitFlag != null and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
  1602. <if test="paying != null and paying != ''"> and cm_shop_order.paying = #{paying}</if>
  1603. <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
  1604. <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
  1605. <if test="shopPostFlag != null and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
  1606. <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
  1607. <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
  1608. <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
  1609. <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
  1610. <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
  1611. <if test="receiptedFlag != null and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
  1612. <if test="receiptedType != null and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
  1613. <if test="costType != null and costType != ''"> and cm_shop_order.costType = #{costType}</if>
  1614. <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
  1615. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
  1616. <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
  1617. <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
  1618. <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
  1619. <if test="differenceType != null and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
  1620. <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
  1621. <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
  1622. <if test="splitCode != null and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
  1623. <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
  1624. <if test="onlinePayWays != null and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
  1625. <if test="status != null and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
  1626. </where>
  1627. group by cm_shop_order.shopOrderID
  1628. order by cm_shop_order.orderTime desc
  1629. </select>
  1630. <select id="getCmShopOrderCount" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
  1631. select count(1)
  1632. from cm_shop_order AS cm_shop_order
  1633. <where> cm_shop_order.delFlag = 0
  1634. <if test="shopOrderID != null and shopOrderID != ''">
  1635. and cm_shop_order.shopOrderID
  1636. = #{shopOrderID}
  1637. </if>
  1638. <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
  1639. <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  1640. <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  1641. <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
  1642. #{shopOrderIDIn}
  1643. </foreach>
  1644. </if>
  1645. <if test="shopOrderNo != null and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
  1646. <if test="orderNo != null and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
  1647. <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
  1648. <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
  1649. <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
  1650. <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
  1651. <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
  1652. <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
  1653. <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
  1654. <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
  1655. <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
  1656. <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
  1657. <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
  1658. <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
  1659. <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
  1660. <if test="note != null and note != ''"> and cm_shop_order.note = #{note}</if>
  1661. <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
  1662. <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
  1663. <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
  1664. <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
  1665. <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
  1666. <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
  1667. <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
  1668. <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
  1669. <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
  1670. <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
  1671. <if test="payFlag != null and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
  1672. <if test="orderTime != null and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
  1673. <if test="payTime != null and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
  1674. <if test="finishTime != null and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
  1675. <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
  1676. <if test="settleStatus != null and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
  1677. <if test="payStatus != null and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
  1678. <if test="receiptStatus != null and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
  1679. <if test="sendOutStatus != null and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
  1680. <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
  1681. <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
  1682. <if test="receiveGoodsTime != null and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
  1683. <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
  1684. <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
  1685. <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
  1686. <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
  1687. <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
  1688. <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
  1689. <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
  1690. <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
  1691. <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
  1692. <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
  1693. <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
  1694. <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
  1695. <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
  1696. <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
  1697. <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
  1698. <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
  1699. <if test="delFlag != null and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
  1700. <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
  1701. <if test="orderStatusFlag != null and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
  1702. <if test="buyStatus != null and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
  1703. <if test="deliveryTimeMills != null and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
  1704. <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
  1705. <if test="splitFlag != null and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
  1706. <if test="paying != null and paying != ''"> and cm_shop_order.paying = #{paying}</if>
  1707. <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
  1708. <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
  1709. <if test="shopPostFlag != null and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
  1710. <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
  1711. <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
  1712. <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
  1713. <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
  1714. <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
  1715. <if test="receiptedFlag != null and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
  1716. <if test="receiptedType != null and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
  1717. <if test="costType != null and costType != ''"> and cm_shop_order.costType = #{costType}</if>
  1718. <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
  1719. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
  1720. <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
  1721. <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
  1722. <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
  1723. <if test="differenceType != null and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
  1724. <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
  1725. <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
  1726. <if test="splitCode != null and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
  1727. <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
  1728. <if test="onlinePayWays != null and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
  1729. <if test="status != null and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
  1730. </where>
  1731. group by cm_shop_order.shopOrderID
  1732. </select>
  1733. <select id="getCmShopOrderByShopOrderID" parameterType="String" resultMap="CmShopOrderResult">
  1734. <include refid="selectCmShopOrderVo"/>
  1735. from cm_shop_order AS cm_shop_order
  1736. where cm_shop_order.delFlag = 0 and cm_shop_order.shopOrderID = #{shopOrderID}
  1737. </select>
  1738. <select id="getByIds" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
  1739. select shopOrderID
  1740. from cm_shop_order AS cm_shop_order
  1741. <where> cm_shop_order.delFlag = 0
  1742. <if test="shopOrderID != null and shopOrderID != ''">
  1743. and cm_shop_order.shopOrderID
  1744. = #{shopOrderID}
  1745. </if>
  1746. <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
  1747. <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  1748. <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  1749. <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
  1750. #{shopOrderIDIn}
  1751. </foreach>
  1752. </if>
  1753. <if test="shopOrderNo != null and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
  1754. <if test="orderNo != null and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
  1755. <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
  1756. <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
  1757. <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
  1758. <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
  1759. <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
  1760. <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
  1761. <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
  1762. <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
  1763. <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
  1764. <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
  1765. <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
  1766. <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
  1767. <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
  1768. <if test="note != null and note != ''"> and cm_shop_order.note = #{note}</if>
  1769. <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
  1770. <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
  1771. <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
  1772. <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
  1773. <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
  1774. <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
  1775. <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
  1776. <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
  1777. <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
  1778. <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
  1779. <if test="payFlag != null and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
  1780. <if test="orderTime != null and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
  1781. <if test="payTime != null and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
  1782. <if test="finishTime != null and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
  1783. <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
  1784. <if test="settleStatus != null and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
  1785. <if test="payStatus != null and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
  1786. <if test="receiptStatus != null and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
  1787. <if test="sendOutStatus != null and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
  1788. <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
  1789. <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
  1790. <if test="receiveGoodsTime != null and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
  1791. <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
  1792. <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
  1793. <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
  1794. <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
  1795. <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
  1796. <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
  1797. <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
  1798. <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
  1799. <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
  1800. <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
  1801. <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
  1802. <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
  1803. <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
  1804. <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
  1805. <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
  1806. <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
  1807. <if test="delFlag != null and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
  1808. <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
  1809. <if test="orderStatusFlag != null and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
  1810. <if test="buyStatus != null and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
  1811. <if test="deliveryTimeMills != null and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
  1812. <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
  1813. <if test="splitFlag != null and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
  1814. <if test="paying != null and paying != ''"> and cm_shop_order.paying = #{paying}</if>
  1815. <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
  1816. <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
  1817. <if test="shopPostFlag != null and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
  1818. <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
  1819. <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
  1820. <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
  1821. <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
  1822. <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
  1823. <if test="receiptedFlag != null and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
  1824. <if test="receiptedType != null and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
  1825. <if test="costType != null and costType != ''"> and cm_shop_order.costType = #{costType}</if>
  1826. <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
  1827. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
  1828. <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
  1829. <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
  1830. <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
  1831. <if test="differenceType != null and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
  1832. <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
  1833. <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
  1834. <if test="splitCode != null and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
  1835. <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
  1836. <if test="onlinePayWays != null and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
  1837. <if test="status != null and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
  1838. </where>
  1839. group by cm_shop_order.shopOrderID
  1840. </select>
  1841. <select id="getById" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
  1842. select shopOrderID
  1843. from cm_shop_order AS cm_shop_order
  1844. <where> cm_shop_order.delFlag = 0
  1845. <if test="shopOrderID != null and shopOrderID != ''">
  1846. and cm_shop_order.shopOrderID
  1847. = #{shopOrderID}
  1848. </if>
  1849. <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
  1850. <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  1851. <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  1852. <foreach item="shopOrderIDIn" collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')" open="(" separator="," close=")">
  1853. #{shopOrderIDIn}
  1854. </foreach>
  1855. </if>
  1856. <if test="shopOrderNo != null and shopOrderNo != ''"> and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
  1857. <if test="orderNo != null and orderNo != ''"> and cm_shop_order.orderNo = #{orderNo}</if>
  1858. <if test="orderID != null "> and cm_shop_order.orderID = #{orderID}</if>
  1859. <if test="organizeID != null "> and cm_shop_order.organizeID = #{organizeID}</if>
  1860. <if test="isColdChina != null "> and cm_shop_order.isColdChina = #{isColdChina}</if>
  1861. <if test="userID != null "> and cm_shop_order.userID = #{userID}</if>
  1862. <if test="shopID != null "> and cm_shop_order.shopID = #{shopID}</if>
  1863. <if test="orderPromotionsId != null "> and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
  1864. <if test="orderType != null "> and cm_shop_order.orderType = #{orderType}</if>
  1865. <if test="orderSubmitType != null "> and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
  1866. <if test="presentNum != null "> and cm_shop_order.presentNum = #{presentNum}</if>
  1867. <if test="itemCount != null "> and cm_shop_order.itemCount = #{itemCount}</if>
  1868. <if test="outStoreNum != null "> and cm_shop_order.outStoreNum = #{outStoreNum}</if>
  1869. <if test="outStoreTimes != null "> and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
  1870. <if test="townID != null "> and cm_shop_order.townID = #{townID}</if>
  1871. <if test="note != null and note != ''"> and cm_shop_order.note = #{note}</if>
  1872. <if test="eachDiscount != null "> and cm_shop_order.eachDiscount = #{eachDiscount}</if>
  1873. <if test="realPay != null "> and cm_shop_order.realPay = #{realPay}</if>
  1874. <if test="receiptAmount != null "> and cm_shop_order.receiptAmount = #{receiptAmount}</if>
  1875. <if test="accountAmount != null "> and cm_shop_order.accountAmount = #{accountAmount}</if>
  1876. <if test="productAmount != null "> and cm_shop_order.productAmount = #{productAmount}</if>
  1877. <if test="totalAmount != null "> and cm_shop_order.totalAmount = #{totalAmount}</if>
  1878. <if test="needPayAmount != null "> and cm_shop_order.needPayAmount = #{needPayAmount}</if>
  1879. <if test="discountAmount != null "> and cm_shop_order.discountAmount = #{discountAmount}</if>
  1880. <if test="preferential != null "> and cm_shop_order.preferential = #{preferential}</if>
  1881. <if test="promotionFullReduction != null "> and cm_shop_order.promotionFullReduction = #{promotionFullReduction}</if>
  1882. <if test="payFlag != null and payFlag != ''"> and cm_shop_order.payFlag = #{payFlag}</if>
  1883. <if test="orderTime != null and orderTime != ''"> and cm_shop_order.orderTime = #{orderTime}</if>
  1884. <if test="payTime != null and payTime != ''"> and cm_shop_order.payTime = #{payTime}</if>
  1885. <if test="finishTime != null and finishTime != ''"> and cm_shop_order.finishTime = #{finishTime}</if>
  1886. <if test="autoOverTimeMills != null "> and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
  1887. <if test="settleStatus != null and settleStatus != ''"> and cm_shop_order.settleStatus = #{settleStatus}</if>
  1888. <if test="payStatus != null and payStatus != ''"> and cm_shop_order.payStatus = #{payStatus}</if>
  1889. <if test="receiptStatus != null and receiptStatus != ''"> and cm_shop_order.receiptStatus = #{receiptStatus}</if>
  1890. <if test="sendOutStatus != null and sendOutStatus != ''"> and cm_shop_order.sendOutStatus = #{sendOutStatus}</if>
  1891. <if test="refundStatus != null "> and cm_shop_order.refundStatus = #{refundStatus}</if>
  1892. <if test="returnGoodsStatus != null "> and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
  1893. <if test="receiveGoodsTime != null and receiveGoodsTime != ''"> and cm_shop_order.receiveGoodsTime = #{receiveGoodsTime}</if>
  1894. <if test="autoReceiveTimeMills != null "> and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}</if>
  1895. <if test="totalAddedValueTax != null "> and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
  1896. <if test="canRefundAmount != null "> and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
  1897. <if test="refundAmount != null "> and cm_shop_order.refundAmount = #{refundAmount}</if>
  1898. <if test="clubID != null "> and cm_shop_order.clubID = #{clubID}</if>
  1899. <if test="spID != null "> and cm_shop_order.spID = #{spID}</if>
  1900. <if test="mainSpID != null "> and cm_shop_order.mainSpID = #{mainSpID}</if>
  1901. <if test="orderBeanAmount != null "> and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
  1902. <if test="useBeanAmount != null "> and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
  1903. <if test="useBeanFlag != null "> and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
  1904. <if test="canRefundFlag != null "> and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
  1905. <if test="useBalanceFlag != null "> and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
  1906. <if test="canRefundBeans != null "> and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
  1907. <if test="freePostageFee != null "> and cm_shop_order.freePostageFee = #{freePostageFee}</if>
  1908. <if test="freePostageTicketID != null "> and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
  1909. <if test="brokerage != null "> and cm_shop_order.brokerage = #{brokerage}</if>
  1910. <if test="delFlag != null and delFlag != ''"> and cm_shop_order.delFlag = #{delFlag}</if>
  1911. <if test="refundsAmount != null "> and cm_shop_order.refundsAmount = #{refundsAmount}</if>
  1912. <if test="orderStatusFlag != null and orderStatusFlag != ''"> and cm_shop_order.orderStatusFlag = #{orderStatusFlag}</if>
  1913. <if test="buyStatus != null and buyStatus != ''"> and cm_shop_order.buyStatus = #{buyStatus}</if>
  1914. <if test="deliveryTimeMills != null and deliveryTimeMills != ''"> and cm_shop_order.deliveryTimeMills = #{deliveryTimeMills}</if>
  1915. <if test="orderDeliveryID != null "> and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
  1916. <if test="splitFlag != null and splitFlag != ''"> and cm_shop_order.splitFlag = #{splitFlag}</if>
  1917. <if test="paying != null and paying != ''"> and cm_shop_order.paying = #{paying}</if>
  1918. <if test="shopProductAmount != null "> and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
  1919. <if test="shopPostFee != null "> and cm_shop_order.shopPostFee = #{shopPostFee}</if>
  1920. <if test="shopPostFlag != null and shopPostFlag != ''"> and cm_shop_order.shopPostFlag = #{shopPostFlag}</if>
  1921. <if test="shopTaxFee != null "> and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
  1922. <if test="payCmAmount != null "> and cm_shop_order.payCmAmount = #{payCmAmount}</if>
  1923. <if test="shouldPayShopAmount != null "> and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
  1924. <if test="payedShopAmount != null "> and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
  1925. <if test="shopOtherFee != null "> and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
  1926. <if test="receiptedFlag != null and receiptedFlag != ''"> and cm_shop_order.receiptedFlag = #{receiptedFlag}</if>
  1927. <if test="receiptedType != null and receiptedType != ''"> and cm_shop_order.receiptedType = #{receiptedType}</if>
  1928. <if test="costType != null and costType != ''"> and cm_shop_order.costType = #{costType}</if>
  1929. <if test="proportional != null "> and cm_shop_order.proportional = #{proportional}</if>
  1930. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''"> and cm_shop_order.modifyShouldPayNote = #{modifyShouldPayNote}</if>
  1931. <if test="modifyShouldPayUserID != null "> and cm_shop_order.modifyShouldPayUserID = #{modifyShouldPayUserID}</if>
  1932. <if test="modifyShouldPayDate != null "> and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
  1933. <if test="zeroCostFlag != null "> and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
  1934. <if test="differenceType != null and differenceType != ''"> and cm_shop_order.differenceType = #{differenceType}</if>
  1935. <if test="differencePrice != null "> and cm_shop_order.differencePrice = #{differencePrice}</if>
  1936. <if test="svipShopReduction != null "> and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
  1937. <if test="splitCode != null and splitCode != ''"> and cm_shop_order.splitCode = #{splitCode}</if>
  1938. <if test="paySuccessCounter != null "> and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
  1939. <if test="onlinePayWays != null and onlinePayWays != ''"> and cm_shop_order.onlinePayWays = #{onlinePayWays}</if>
  1940. <if test="status != null and status != ''"> and cm_shop_order.shopStatus = #{status}</if>
  1941. </where>
  1942. group by cm_shop_order.shopOrderID
  1943. limit 0,1
  1944. </select>
  1945. <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true" keyProperty="shopOrderID">
  1946. insert into cm_shop_order
  1947. <trim prefix="(" suffix=")" suffixOverrides=",">
  1948. <if test="shopOrderID != null and shopOrderID != ''">shopOrderID,</if>
  1949. <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo,</if>
  1950. <if test="orderNo != null and orderNo != ''">orderNo,</if>
  1951. <if test="orderID != null">orderID,</if>
  1952. <if test="organizeID != null">organizeID,</if>
  1953. <if test="isColdChina != null">isColdChina,</if>
  1954. <if test="userID != null">userID,</if>
  1955. <if test="shopID != null">shopID,</if>
  1956. <if test="orderPromotionsId != null">orderPromotionsId,</if>
  1957. <if test="orderType != null">orderType,</if>
  1958. <if test="orderSubmitType != null">orderSubmitType,</if>
  1959. <if test="presentNum != null">presentNum,</if>
  1960. <if test="itemCount != null">itemCount,</if>
  1961. <if test="outStoreNum != null">outStoreNum,</if>
  1962. <if test="outStoreTimes != null">outStoreTimes,</if>
  1963. <if test="townID != null">townID,</if>
  1964. <if test="note != null and note != ''">note,</if>
  1965. <if test="eachDiscount != null">eachDiscount,</if>
  1966. <if test="realPay != null">realPay,</if>
  1967. <if test="receiptAmount != null">receiptAmount,</if>
  1968. <if test="accountAmount != null">accountAmount,</if>
  1969. <if test="productAmount != null">productAmount,</if>
  1970. <if test="totalAmount != null">totalAmount,</if>
  1971. <if test="needPayAmount != null">needPayAmount,</if>
  1972. <if test="discountAmount != null">discountAmount,</if>
  1973. <if test="preferential != null">preferential,</if>
  1974. <if test="promotionFullReduction != null">promotionFullReduction,</if>
  1975. <if test="payFlag != null and payFlag != ''">payFlag,</if>
  1976. <if test="orderTime != null and orderTime != ''">orderTime,</if>
  1977. <if test="payTime != null and payTime != ''">payTime,</if>
  1978. <if test="finishTime != null and finishTime != ''">finishTime,</if>
  1979. <if test="autoOverTimeMills != null">autoOverTimeMills,</if>
  1980. <if test="settleStatus != null and settleStatus != ''">settleStatus,</if>
  1981. <if test="payStatus != null and payStatus != ''">payStatus,</if>
  1982. <if test="receiptStatus != null and receiptStatus != ''">receiptStatus,</if>
  1983. <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus,</if>
  1984. <if test="refundStatus != null">refundStatus,</if>
  1985. <if test="returnGoodsStatus != null">returnGoodsStatus,</if>
  1986. <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime,</if>
  1987. <if test="autoReceiveTimeMills != null">autoReceiveTimeMills,</if>
  1988. <if test="totalAddedValueTax != null">totalAddedValueTax,</if>
  1989. <if test="canRefundAmount != null">canRefundAmount,</if>
  1990. <if test="refundAmount != null">refundAmount,</if>
  1991. <if test="clubID != null">clubID,</if>
  1992. <if test="spID != null">spID,</if>
  1993. <if test="mainSpID != null">mainSpID,</if>
  1994. <if test="orderBeanAmount != null">orderBeanAmount,</if>
  1995. <if test="useBeanAmount != null">useBeanAmount,</if>
  1996. <if test="useBeanFlag != null">useBeanFlag,</if>
  1997. <if test="canRefundFlag != null">canRefundFlag,</if>
  1998. <if test="useBalanceFlag != null">useBalanceFlag,</if>
  1999. <if test="canRefundBeans != null">canRefundBeans,</if>
  2000. <if test="freePostageFee != null">freePostageFee,</if>
  2001. <if test="freePostageTicketID != null">freePostageTicketID,</if>
  2002. <if test="brokerage != null">brokerage,</if>
  2003. <if test="delFlag != null and delFlag != ''">delFlag,</if>
  2004. <if test="refundsAmount != null">refundsAmount,</if>
  2005. <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag,</if>
  2006. <if test="buyStatus != null and buyStatus != ''">buyStatus,</if>
  2007. <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills,</if>
  2008. <if test="orderDeliveryID != null">orderDeliveryID,</if>
  2009. <if test="splitFlag != null and splitFlag != ''">splitFlag,</if>
  2010. <if test="paying != null and paying != ''">paying,</if>
  2011. <if test="shopProductAmount != null">shopProductAmount,</if>
  2012. <if test="shopPostFee != null">shopPostFee,</if>
  2013. <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag,</if>
  2014. <if test="shopTaxFee != null">shopTaxFee,</if>
  2015. <if test="payCmAmount != null">payCmAmount,</if>
  2016. <if test="shouldPayShopAmount != null">shouldPayShopAmount,</if>
  2017. <if test="payedShopAmount != null">payedShopAmount,</if>
  2018. <if test="shopOtherFee != null">shopOtherFee,</if>
  2019. <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag,</if>
  2020. <if test="receiptedType != null and receiptedType != ''">receiptedType,</if>
  2021. <if test="costType != null and costType != ''">costType,</if>
  2022. <if test="proportional != null">proportional,</if>
  2023. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote,</if>
  2024. <if test="modifyShouldPayUserID != null">modifyShouldPayUserID,</if>
  2025. <if test="modifyShouldPayDate != null">modifyShouldPayDate,</if>
  2026. <if test="zeroCostFlag != null">zeroCostFlag,</if>
  2027. <if test="differenceType != null and differenceType != ''">differenceType,</if>
  2028. <if test="differencePrice != null">differencePrice,</if>
  2029. <if test="svipShopReduction != null">svipShopReduction,</if>
  2030. <if test="splitCode != null and splitCode != ''">splitCode,</if>
  2031. <if test="paySuccessCounter != null">paySuccessCounter,</if>
  2032. <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays,</if>
  2033. <if test="status != null and status != ''">shopStatus,</if>
  2034. </trim>
  2035. <trim prefix="values (" suffix=")" suffixOverrides=",">
  2036. <if test="shopOrderID != null and shopOrderID != ''">#{shopOrderID},</if>
  2037. <if test="shopOrderNo != null and shopOrderNo != ''">#{shopOrderNo},</if>
  2038. <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
  2039. <if test="orderID != null">#{orderID},</if>
  2040. <if test="organizeID != null">#{organizeID},</if>
  2041. <if test="isColdChina != null">#{isColdChina},</if>
  2042. <if test="userID != null">#{userID},</if>
  2043. <if test="shopID != null">#{shopID},</if>
  2044. <if test="orderPromotionsId != null">#{orderPromotionsId},</if>
  2045. <if test="orderType != null">#{orderType},</if>
  2046. <if test="orderSubmitType != null">#{orderSubmitType},</if>
  2047. <if test="presentNum != null">#{presentNum},</if>
  2048. <if test="itemCount != null">#{itemCount},</if>
  2049. <if test="outStoreNum != null">#{outStoreNum},</if>
  2050. <if test="outStoreTimes != null">#{outStoreTimes},</if>
  2051. <if test="townID != null">#{townID},</if>
  2052. <if test="note != null and note != ''">#{note},</if>
  2053. <if test="eachDiscount != null">#{eachDiscount},</if>
  2054. <if test="realPay != null">#{realPay},</if>
  2055. <if test="receiptAmount != null">#{receiptAmount},</if>
  2056. <if test="accountAmount != null">#{accountAmount},</if>
  2057. <if test="productAmount != null">#{productAmount},</if>
  2058. <if test="totalAmount != null">#{totalAmount},</if>
  2059. <if test="needPayAmount != null">#{needPayAmount},</if>
  2060. <if test="discountAmount != null">#{discountAmount},</if>
  2061. <if test="preferential != null">#{preferential},</if>
  2062. <if test="promotionFullReduction != null">#{promotionFullReduction},</if>
  2063. <if test="payFlag != null and payFlag != ''">#{payFlag},</if>
  2064. <if test="orderTime != null and orderTime != ''">#{orderTime},</if>
  2065. <if test="payTime != null and payTime != ''">#{payTime},</if>
  2066. <if test="finishTime != null and finishTime != ''">#{finishTime},</if>
  2067. <if test="autoOverTimeMills != null">#{autoOverTimeMills},</if>
  2068. <if test="settleStatus != null and settleStatus != ''">#{settleStatus},</if>
  2069. <if test="payStatus != null and payStatus != ''">#{payStatus},</if>
  2070. <if test="receiptStatus != null and receiptStatus != ''">#{receiptStatus},</if>
  2071. <if test="sendOutStatus != null and sendOutStatus != ''">#{sendOutStatus},</if>
  2072. <if test="refundStatus != null">#{refundStatus},</if>
  2073. <if test="returnGoodsStatus != null">#{returnGoodsStatus},</if>
  2074. <if test="receiveGoodsTime != null and receiveGoodsTime != ''">#{receiveGoodsTime},</if>
  2075. <if test="autoReceiveTimeMills != null">#{autoReceiveTimeMills},</if>
  2076. <if test="totalAddedValueTax != null">#{totalAddedValueTax},</if>
  2077. <if test="canRefundAmount != null">#{canRefundAmount},</if>
  2078. <if test="refundAmount != null">#{refundAmount},</if>
  2079. <if test="clubID != null">#{clubID},</if>
  2080. <if test="spID != null">#{spID},</if>
  2081. <if test="mainSpID != null">#{mainSpID},</if>
  2082. <if test="orderBeanAmount != null">#{orderBeanAmount},</if>
  2083. <if test="useBeanAmount != null">#{useBeanAmount},</if>
  2084. <if test="useBeanFlag != null">#{useBeanFlag},</if>
  2085. <if test="canRefundFlag != null">#{canRefundFlag},</if>
  2086. <if test="useBalanceFlag != null">#{useBalanceFlag},</if>
  2087. <if test="canRefundBeans != null">#{canRefundBeans},</if>
  2088. <if test="freePostageFee != null">#{freePostageFee},</if>
  2089. <if test="freePostageTicketID != null">#{freePostageTicketID},</if>
  2090. <if test="brokerage != null">#{brokerage},</if>
  2091. <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
  2092. <if test="refundsAmount != null">#{refundsAmount},</if>
  2093. <if test="orderStatusFlag != null and orderStatusFlag != ''">#{orderStatusFlag},</if>
  2094. <if test="buyStatus != null and buyStatus != ''">#{buyStatus},</if>
  2095. <if test="deliveryTimeMills != null and deliveryTimeMills != ''">#{deliveryTimeMills},</if>
  2096. <if test="orderDeliveryID != null">#{orderDeliveryID},</if>
  2097. <if test="splitFlag != null and splitFlag != ''">#{splitFlag},</if>
  2098. <if test="paying != null and paying != ''">#{paying},</if>
  2099. <if test="shopProductAmount != null">#{shopProductAmount},</if>
  2100. <if test="shopPostFee != null">#{shopPostFee},</if>
  2101. <if test="shopPostFlag != null and shopPostFlag != ''">#{shopPostFlag},</if>
  2102. <if test="shopTaxFee != null">#{shopTaxFee},</if>
  2103. <if test="payCmAmount != null">#{payCmAmount},</if>
  2104. <if test="shouldPayShopAmount != null">#{shouldPayShopAmount},</if>
  2105. <if test="payedShopAmount != null">#{payedShopAmount},</if>
  2106. <if test="shopOtherFee != null">#{shopOtherFee},</if>
  2107. <if test="receiptedFlag != null and receiptedFlag != ''">#{receiptedFlag},</if>
  2108. <if test="receiptedType != null and receiptedType != ''">#{receiptedType},</if>
  2109. <if test="costType != null and costType != ''">#{costType},</if>
  2110. <if test="proportional != null">#{proportional},</if>
  2111. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">#{modifyShouldPayNote},</if>
  2112. <if test="modifyShouldPayUserID != null">#{modifyShouldPayUserID},</if>
  2113. <if test="modifyShouldPayDate != null">#{modifyShouldPayDate},</if>
  2114. <if test="zeroCostFlag != null">#{zeroCostFlag},</if>
  2115. <if test="differenceType != null and differenceType != ''">#{differenceType},</if>
  2116. <if test="differencePrice != null">#{differencePrice},</if>
  2117. <if test="svipShopReduction != null">#{svipShopReduction},</if>
  2118. <if test="splitCode != null and splitCode != ''">#{splitCode},</if>
  2119. <if test="paySuccessCounter != null">#{paySuccessCounter},</if>
  2120. <if test="onlinePayWays != null and onlinePayWays != ''">#{onlinePayWays},</if>
  2121. <if test="status != null and status != ''">#{status},</if>
  2122. </trim>
  2123. </insert>
  2124. <update id="updateCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder">
  2125. update cm_shop_order
  2126. <trim prefix="SET" suffixOverrides=",">
  2127. <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo = #{shopOrderNo},</if>
  2128. <if test="orderNo != null and orderNo != ''">orderNo = #{orderNo},</if>
  2129. <if test="orderID != null">orderID = #{orderID},</if>
  2130. <if test="organizeID != null">organizeID = #{organizeID},</if>
  2131. <if test="isColdChina != null">isColdChina = #{isColdChina},</if>
  2132. <if test="userID != null">userID = #{userID},</if>
  2133. <if test="shopID != null">shopID = #{shopID},</if>
  2134. <if test="orderPromotionsId != null">orderPromotionsId = #{orderPromotionsId},</if>
  2135. <if test="orderType != null">orderType = #{orderType},</if>
  2136. <if test="orderSubmitType != null">orderSubmitType = #{orderSubmitType},</if>
  2137. <if test="presentNum != null">presentNum = #{presentNum},</if>
  2138. <if test="itemCount != null">itemCount = #{itemCount},</if>
  2139. <if test="outStoreNum != null">outStoreNum = #{outStoreNum},</if>
  2140. <if test="outStoreTimes != null">outStoreTimes = #{outStoreTimes},</if>
  2141. <if test="townID != null">townID = #{townID},</if>
  2142. <if test="note != null and note != ''">note = #{note},</if>
  2143. <if test="eachDiscount != null">eachDiscount = #{eachDiscount},</if>
  2144. <if test="realPay != null">realPay = #{realPay},</if>
  2145. <if test="receiptAmount != null">receiptAmount = #{receiptAmount},</if>
  2146. <if test="accountAmount != null">accountAmount = #{accountAmount},</if>
  2147. <if test="productAmount != null">productAmount = #{productAmount},</if>
  2148. <if test="totalAmount != null">totalAmount = #{totalAmount},</if>
  2149. <if test="needPayAmount != null">needPayAmount = #{needPayAmount},</if>
  2150. <if test="discountAmount != null">discountAmount = #{discountAmount},</if>
  2151. <if test="preferential != null">preferential = #{preferential},</if>
  2152. <if test="promotionFullReduction != null">promotionFullReduction = #{promotionFullReduction},</if>
  2153. <if test="payFlag != null and payFlag != ''">payFlag = #{payFlag},</if>
  2154. <if test="orderTime != null and orderTime != ''">orderTime = #{orderTime},</if>
  2155. <if test="payTime != null and payTime != ''">payTime = #{payTime},</if>
  2156. <if test="finishTime != null and finishTime != ''">finishTime = #{finishTime},</if>
  2157. <if test="autoOverTimeMills != null">autoOverTimeMills = #{autoOverTimeMills},</if>
  2158. <if test="settleStatus != null and settleStatus != ''">settleStatus = #{settleStatus},</if>
  2159. <if test="payStatus != null and payStatus != ''">payStatus = #{payStatus},</if>
  2160. <if test="receiptStatus != null and receiptStatus != ''">receiptStatus = #{receiptStatus},</if>
  2161. <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus = #{sendOutStatus},</if>
  2162. <if test="refundStatus != null">refundStatus = #{refundStatus},</if>
  2163. <if test="returnGoodsStatus != null">returnGoodsStatus = #{returnGoodsStatus},</if>
  2164. <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime = #{receiveGoodsTime},</if>
  2165. <if test="autoReceiveTimeMills != null">autoReceiveTimeMills = #{autoReceiveTimeMills},</if>
  2166. <if test="totalAddedValueTax != null">totalAddedValueTax = #{totalAddedValueTax},</if>
  2167. <if test="canRefundAmount != null">canRefundAmount = #{canRefundAmount},</if>
  2168. <if test="refundAmount != null">refundAmount = #{refundAmount},</if>
  2169. <if test="clubID != null">clubID = #{clubID},</if>
  2170. <if test="spID != null">spID = #{spID},</if>
  2171. <if test="mainSpID != null">mainSpID = #{mainSpID},</if>
  2172. <if test="orderBeanAmount != null">orderBeanAmount = #{orderBeanAmount},</if>
  2173. <if test="useBeanAmount != null">useBeanAmount = #{useBeanAmount},</if>
  2174. <if test="useBeanFlag != null">useBeanFlag = #{useBeanFlag},</if>
  2175. <if test="canRefundFlag != null">canRefundFlag = #{canRefundFlag},</if>
  2176. <if test="useBalanceFlag != null">useBalanceFlag = #{useBalanceFlag},</if>
  2177. <if test="canRefundBeans != null">canRefundBeans = #{canRefundBeans},</if>
  2178. <if test="freePostageFee != null">freePostageFee = #{freePostageFee},</if>
  2179. <if test="freePostageTicketID != null">freePostageTicketID = #{freePostageTicketID},</if>
  2180. <if test="brokerage != null">brokerage = #{brokerage},</if>
  2181. <if test="delFlag != null and delFlag != ''">delFlag = #{delFlag},</if>
  2182. <if test="refundsAmount != null">refundsAmount = #{refundsAmount},</if>
  2183. <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag = #{orderStatusFlag},</if>
  2184. <if test="buyStatus != null and buyStatus != ''">buyStatus = #{buyStatus},</if>
  2185. <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills = #{deliveryTimeMills},</if>
  2186. <if test="orderDeliveryID != null">orderDeliveryID = #{orderDeliveryID},</if>
  2187. <if test="splitFlag != null and splitFlag != ''">splitFlag = #{splitFlag},</if>
  2188. <if test="paying != null and paying != ''">paying = #{paying},</if>
  2189. <if test="shopProductAmount != null">shopProductAmount = #{shopProductAmount},</if>
  2190. <if test="shopPostFee != null">shopPostFee = #{shopPostFee},</if>
  2191. <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag = #{shopPostFlag},</if>
  2192. <if test="shopTaxFee != null">shopTaxFee = #{shopTaxFee},</if>
  2193. <if test="payCmAmount != null">payCmAmount = #{payCmAmount},</if>
  2194. <if test="shouldPayShopAmount != null">shouldPayShopAmount = #{shouldPayShopAmount},</if>
  2195. <if test="payedShopAmount != null">payedShopAmount = #{payedShopAmount},</if>
  2196. <if test="shopOtherFee != null">shopOtherFee = #{shopOtherFee},</if>
  2197. <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag = #{receiptedFlag},</if>
  2198. <if test="receiptedType != null and receiptedType != ''">receiptedType = #{receiptedType},</if>
  2199. <if test="costType != null and costType != ''">costType = #{costType},</if>
  2200. <if test="proportional != null">proportional = #{proportional},</if>
  2201. <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote = #{modifyShouldPayNote},</if>
  2202. <if test="modifyShouldPayUserID != null">modifyShouldPayUserID = #{modifyShouldPayUserID},</if>
  2203. <if test="modifyShouldPayDate != null">modifyShouldPayDate = #{modifyShouldPayDate},</if>
  2204. <if test="zeroCostFlag != null">zeroCostFlag = #{zeroCostFlag},</if>
  2205. <if test="differenceType != null and differenceType != ''">differenceType = #{differenceType},</if>
  2206. <if test="differencePrice != null">differencePrice = #{differencePrice},</if>
  2207. <if test="svipShopReduction != null">svipShopReduction = #{svipShopReduction},</if>
  2208. <if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
  2209. <if test="paySuccessCounter != null">paySuccessCounter = #{paySuccessCounter},</if>
  2210. <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays = #{onlinePayWays},</if>
  2211. <if test="status != null and status != ''">shopStatus = #{status},</if>
  2212. </trim>
  2213. where shopOrderID = #{shopOrderID}
  2214. </update>
  2215. <update id="updateDelCmShopOrderByShopOrderIDs" parameterType="String">
  2216. update cm_shop_order set delFlag=#{delFlag} where shopOrderID in
  2217. <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
  2218. #{shopOrderID}
  2219. </foreach>
  2220. </update>
  2221. <delete id="delCmShopOrderByShopOrderID" parameterType="String">
  2222. delete
  2223. from cm_shop_order where shopOrderID = #{shopOrderID}
  2224. </delete>
  2225. <delete id="delCmShopOrderByShopOrderIDs" parameterType="String">
  2226. delete from cm_shop_order where shopOrderID in
  2227. <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
  2228. #{shopOrderID}
  2229. </foreach>
  2230. </delete>
  2231. </mapper>