UserOrderMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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.izouma.awesomeadmin.dao.UserOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.UserOrder">
  5. <id column="id" property="id" jdbcType="INTEGER"/>
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
  7. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  8. <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
  10. <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
  11. <result column="user_id" property="userId" jdbcType="INTEGER"/>
  12. <result column="order_code" property="orderCode" jdbcType="VARCHAR"/>
  13. <result column="store_id" property="storeId" jdbcType="INTEGER"/>
  14. <result column="product_type" property="productType" jdbcType="VARCHAR"/>
  15. <result column="product_id" property="productId" jdbcType="INTEGER"/>
  16. <result column="product_name" property="productName" jdbcType="VARCHAR"/>
  17. <result column="specification" property="specification" jdbcType="VARCHAR"/>
  18. <result column="unit_price" property="unitPrice" jdbcType="DECIMAL"/>
  19. <result column="quantity" property="quantity" jdbcType="INTEGER"/>
  20. <result column="user_coupon_id" property="userCouponId" jdbcType="INTEGER"/>
  21. <result column="off_price" property="offPrice" jdbcType="DECIMAL"/>
  22. <result column="totle_price" property="totlePrice" jdbcType="DECIMAL"/>
  23. <result column="deal_price" property="dealPrice" jdbcType="DECIMAL"/>
  24. <result column="pay_mode" property="payMode" jdbcType="INTEGER"/>
  25. <result column="pay_time" property="payTime" jdbcType="TIMESTAMP"/>
  26. <result column="remark" property="remark" jdbcType="VARCHAR"/>
  27. <result column="show_flag" property="showFlag" jdbcType="CHAR"/>
  28. <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
  29. <result column="fee" property="fee" jdbcType="DECIMAL"/>
  30. <result column="coin" property="coin" jdbcType="DECIMAL"/>
  31. <result column="point" property="point" jdbcType="DECIMAL"/>
  32. <result column="cash" property="cash" jdbcType="DECIMAL"/>
  33. <result column="cancel_reason" property="cancelReason" jdbcType="VARCHAR"/>
  34. <result column="confirm_time" property="confirmTime" jdbcType="TIMESTAMP"/>
  35. </resultMap>
  36. <sql id="Base_Column_List">
  37. <trim suffixOverrides=",">
  38. id,
  39. del_flag,
  40. update_time,
  41. update_user,
  42. create_time,
  43. create_user,
  44. user_id,
  45. order_code,
  46. store_id,
  47. product_type,
  48. product_id,
  49. product_name,
  50. specification,
  51. unit_price,
  52. quantity,
  53. user_coupon_id,
  54. off_price,
  55. totle_price,
  56. deal_price,
  57. pay_mode,
  58. pay_time,
  59. remark,
  60. show_flag,
  61. status_flag,
  62. fee,
  63. coin,
  64. point,
  65. cash,
  66. cancel_reason,
  67. confirm_time,
  68. </trim>
  69. </sql>
  70. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  71. select
  72. <include refid="Base_Column_List"/>
  73. from user_order
  74. where id = #{id,jdbcType=INTEGER}
  75. </select>
  76. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  77. delete from user_order
  78. where id = #{id,jdbcType=INTEGER}
  79. </delete>
  80. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.UserOrder" useGeneratedKeys="true"
  81. keyProperty="id">
  82. insert into user_order
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="id!= null">
  85. id,
  86. </if>
  87. <if test="delFlag!= null">
  88. del_flag,
  89. </if>
  90. <if test="updateTime!= null">
  91. update_time,
  92. </if>
  93. <if test="updateUser!= null">
  94. update_user,
  95. </if>
  96. <if test="createTime!= null">
  97. create_time,
  98. </if>
  99. <if test="createUser!= null">
  100. create_user,
  101. </if>
  102. <if test="userId!= null">
  103. user_id,
  104. </if>
  105. <if test="orderCode!= null">
  106. order_code,
  107. </if>
  108. <if test="storeId!= null">
  109. store_id,
  110. </if>
  111. <if test="productType!= null">
  112. product_type,
  113. </if>
  114. <if test="productId!= null">
  115. product_id,
  116. </if>
  117. <if test="productName!= null">
  118. product_name,
  119. </if>
  120. <if test="specification!= null">
  121. specification,
  122. </if>
  123. <if test="unitPrice!= null">
  124. unit_price,
  125. </if>
  126. <if test="quantity!= null">
  127. quantity,
  128. </if>
  129. <if test="userCouponId!= null">
  130. user_coupon_id,
  131. </if>
  132. <if test="offPrice!= null">
  133. off_price,
  134. </if>
  135. <if test="totlePrice!= null">
  136. totle_price,
  137. </if>
  138. <if test="dealPrice!= null">
  139. deal_price,
  140. </if>
  141. <if test="payMode!= null">
  142. pay_mode,
  143. </if>
  144. <if test="payTime!= null">
  145. pay_time,
  146. </if>
  147. <if test="remark!= null">
  148. remark,
  149. </if>
  150. <if test="showFlag!= null">
  151. show_flag,
  152. </if>
  153. <if test="statusFlag!= null">
  154. status_flag,
  155. </if>
  156. <if test="fee!= null">
  157. fee,
  158. </if>
  159. <if test="coin!= null">
  160. coin,
  161. </if>
  162. <if test="point!= null">
  163. point,
  164. </if>
  165. <if test="cash!= null">
  166. cash,
  167. </if>
  168. </trim>
  169. <trim prefix="values (" suffix=")" suffixOverrides=",">
  170. <if test="id != null">
  171. #{id,jdbcType=INTEGER},
  172. </if>
  173. <if test="delFlag != null">
  174. #{delFlag,jdbcType=CHAR},
  175. </if>
  176. <if test="updateTime != null">
  177. #{updateTime,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="updateUser != null">
  180. #{updateUser,jdbcType=VARCHAR},
  181. </if>
  182. <if test="createTime != null">
  183. #{createTime,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="createUser != null">
  186. #{createUser,jdbcType=VARCHAR},
  187. </if>
  188. <if test="userId != null">
  189. #{userId,jdbcType=INTEGER},
  190. </if>
  191. <if test="orderCode != null">
  192. #{orderCode,jdbcType=VARCHAR},
  193. </if>
  194. <if test="storeId != null">
  195. #{storeId,jdbcType=INTEGER},
  196. </if>
  197. <if test="productType != null">
  198. #{productType,jdbcType=VARCHAR},
  199. </if>
  200. <if test="productId != null">
  201. #{productId,jdbcType=INTEGER},
  202. </if>
  203. <if test="productName != null">
  204. #{productName,jdbcType=VARCHAR},
  205. </if>
  206. <if test="specification != null">
  207. #{specification,jdbcType=VARCHAR},
  208. </if>
  209. <if test="unitPrice != null">
  210. #{unitPrice,jdbcType=DECIMAL},
  211. </if>
  212. <if test="quantity != null">
  213. #{quantity,jdbcType=INTEGER},
  214. </if>
  215. <if test="userCouponId != null">
  216. #{userCouponId,jdbcType=INTEGER},
  217. </if>
  218. <if test="offPrice != null">
  219. #{offPrice,jdbcType=DECIMAL},
  220. </if>
  221. <if test="totlePrice != null">
  222. #{totlePrice,jdbcType=DECIMAL},
  223. </if>
  224. <if test="dealPrice != null">
  225. #{dealPrice,jdbcType=DECIMAL},
  226. </if>
  227. <if test="payMode != null">
  228. #{payMode,jdbcType=INTEGER},
  229. </if>
  230. <if test="payTime != null">
  231. #{payTime,jdbcType=TIMESTAMP},
  232. </if>
  233. <if test="remark != null">
  234. #{remark,jdbcType=VARCHAR},
  235. </if>
  236. <if test="showFlag != null">
  237. #{showFlag,jdbcType=CHAR},
  238. </if>
  239. <if test="statusFlag != null">
  240. #{statusFlag,jdbcType=INTEGER},
  241. </if>
  242. <if test="fee != null">
  243. #{fee,jdbcType=DECIMAL},
  244. </if>
  245. <if test="coin != null">
  246. #{coin,jdbcType=DECIMAL},
  247. </if>
  248. <if test="point != null">
  249. #{point,jdbcType=DECIMAL},
  250. </if>
  251. <if test="cash != null">
  252. #{cash,jdbcType=DECIMAL},
  253. </if>
  254. </trim>
  255. </insert>
  256. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserOrder">
  257. update user_order
  258. <set>
  259. <if test="id != null">
  260. id= #{id,jdbcType=INTEGER},
  261. </if>
  262. <if test="delFlag != null">
  263. del_flag= #{delFlag,jdbcType=CHAR},
  264. </if>
  265. <if test="updateTime != null">
  266. update_time= #{updateTime,jdbcType=TIMESTAMP},
  267. </if>
  268. <if test="updateUser != null">
  269. update_user= #{updateUser,jdbcType=VARCHAR},
  270. </if>
  271. <if test="createTime != null">
  272. create_time= #{createTime,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="createUser != null">
  275. create_user= #{createUser,jdbcType=VARCHAR},
  276. </if>
  277. <if test="userId != null">
  278. user_id= #{userId,jdbcType=INTEGER},
  279. </if>
  280. <if test="orderCode != null">
  281. order_code= #{orderCode,jdbcType=VARCHAR},
  282. </if>
  283. <if test="storeId != null">
  284. store_id= #{storeId,jdbcType=INTEGER},
  285. </if>
  286. <if test="productType != null">
  287. product_type= #{productType,jdbcType=VARCHAR},
  288. </if>
  289. <if test="productId != null">
  290. product_id= #{productId,jdbcType=INTEGER},
  291. </if>
  292. <if test="productName != null">
  293. product_name= #{productName,jdbcType=VARCHAR},
  294. </if>
  295. <if test="specification != null">
  296. specification= #{specification,jdbcType=VARCHAR},
  297. </if>
  298. <if test="unitPrice != null">
  299. unit_price= #{unitPrice,jdbcType=DECIMAL},
  300. </if>
  301. <if test="quantity != null">
  302. quantity= #{quantity,jdbcType=INTEGER},
  303. </if>
  304. <if test="userCouponId != null">
  305. user_coupon_id= #{userCouponId,jdbcType=INTEGER},
  306. </if>
  307. <if test="offPrice != null">
  308. off_price= #{offPrice,jdbcType=DECIMAL},
  309. </if>
  310. <if test="totlePrice != null">
  311. totle_price= #{totlePrice,jdbcType=DECIMAL},
  312. </if>
  313. <if test="dealPrice != null">
  314. deal_price= #{dealPrice,jdbcType=DECIMAL},
  315. </if>
  316. <if test="payMode != null">
  317. pay_mode= #{payMode,jdbcType=INTEGER},
  318. </if>
  319. <if test="payTime != null">
  320. pay_time= #{payTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="remark != null">
  323. remark= #{remark,jdbcType=VARCHAR},
  324. </if>
  325. <if test="showFlag != null">
  326. show_flag= #{showFlag,jdbcType=CHAR},
  327. </if>
  328. <if test="statusFlag != null">
  329. status_flag= #{statusFlag,jdbcType=INTEGER},
  330. </if>
  331. <if test="fee != null">
  332. fee= #{fee,jdbcType=DECIMAL},
  333. </if>
  334. <if test="coin != null">
  335. coin= #{coin,jdbcType=DECIMAL},
  336. </if>
  337. <if test="point != null">
  338. point= #{point,jdbcType=DECIMAL},
  339. </if>
  340. <if test="cash != null">
  341. cash= #{cash,jdbcType=DECIMAL},
  342. </if>
  343. <if test="cancelReason != null">
  344. cancel_reason= #{cancelReason},
  345. </if>
  346. <if test="confirmTime != null">
  347. confirm_time= #{confirmTime,jdbcType=TIMESTAMP},
  348. </if>
  349. </set>
  350. where id = #{id,jdbcType=INTEGER}
  351. </update>
  352. <select id="queryUserOrderByPage" parameterType="java.util.Map" resultMap="AllInfoForGetOne">
  353. select
  354. <include refid="Base_Column_List"/>
  355. from user_order
  356. <where>
  357. and del_flag = 'N'
  358. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  359. and id = #{record.id}
  360. </if>
  361. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  362. and del_flag = #{record.delFlag}
  363. </if>
  364. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  365. and update_time = #{record.updateTime}
  366. </if>
  367. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  368. and update_user = #{record.updateUser}
  369. </if>
  370. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  371. and create_time = #{record.createTime}
  372. </if>
  373. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  374. and create_user = #{record.createUser}
  375. </if>
  376. <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
  377. and user_id = #{record.userId}
  378. </if>
  379. <if test="record.orderCode != null and !&quot;&quot;.equals(record.orderCode)">
  380. and order_code = #{record.orderCode}
  381. </if>
  382. <if test="record.storeId != null and !&quot;&quot;.equals(record.storeId)">
  383. and store_id = #{record.storeId}
  384. </if>
  385. <if test="record.productType != null and !&quot;&quot;.equals(record.productType)">
  386. and product_type = #{record.productType}
  387. </if>
  388. <if test="record.productId != null and !&quot;&quot;.equals(record.productId)">
  389. and product_id = #{record.productId}
  390. </if>
  391. <if test="record.productName != null and !&quot;&quot;.equals(record.productName)">
  392. and product_name = #{record.productName}
  393. </if>
  394. <if test="record.specification != null and !&quot;&quot;.equals(record.specification)">
  395. and specification = #{record.specification}
  396. </if>
  397. <if test="record.unitPrice != null and !&quot;&quot;.equals(record.unitPrice)">
  398. and unit_price = #{record.unitPrice}
  399. </if>
  400. <if test="record.quantity != null and !&quot;&quot;.equals(record.quantity)">
  401. and quantity = #{record.quantity}
  402. </if>
  403. <if test="record.userCouponId != null and !&quot;&quot;.equals(record.userCouponId)">
  404. and user_coupon_id = #{record.userCouponId}
  405. </if>
  406. <if test="record.offPrice != null and !&quot;&quot;.equals(record.offPrice)">
  407. and off_price = #{record.offPrice}
  408. </if>
  409. <if test="record.totlePrice != null and !&quot;&quot;.equals(record.totlePrice)">
  410. and totle_price = #{record.totlePrice}
  411. </if>
  412. <if test="record.dealPrice != null and !&quot;&quot;.equals(record.dealPrice)">
  413. and deal_price = #{record.dealPrice}
  414. </if>
  415. <if test="record.payMode != null and !&quot;&quot;.equals(record.payMode)">
  416. and pay_mode = #{record.payMode}
  417. </if>
  418. <if test="record.payTime != null and !&quot;&quot;.equals(record.payTime)">
  419. and pay_time = #{record.payTime}
  420. </if>
  421. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  422. and remark = #{record.remark}
  423. </if>
  424. <if test="record.showFlag != null and !&quot;&quot;.equals(record.showFlag)">
  425. and show_flag = #{record.showFlag}
  426. </if>
  427. <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
  428. and status_flag = #{record.statusFlag}
  429. </if>
  430. <if test="record.fee != null and !&quot;&quot;.equals(record.fee)">
  431. and fee = #{record.fee}
  432. </if>
  433. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  434. <trim prefix="and (" suffix=")" prefixOverrides="OR">
  435. OR user_id LIKE concat('%',#{record.searchKey},'%')
  436. OR order_code LIKE concat('%',#{record.searchKey},'%')
  437. OR store_id LIKE concat('%',#{record.searchKey},'%')
  438. OR product_type LIKE concat('%',#{record.searchKey},'%')
  439. OR product_id LIKE concat('%',#{record.searchKey},'%')
  440. OR product_name LIKE concat('%',#{record.searchKey},'%')
  441. OR specification LIKE concat('%',#{record.searchKey},'%')
  442. OR unit_price LIKE concat('%',#{record.searchKey},'%')
  443. OR quantity LIKE concat('%',#{record.searchKey},'%')
  444. OR user_coupon_id LIKE concat('%',#{record.searchKey},'%')
  445. OR off_price LIKE concat('%',#{record.searchKey},'%')
  446. OR totle_price LIKE concat('%',#{record.searchKey},'%')
  447. OR deal_price LIKE concat('%',#{record.searchKey},'%')
  448. OR pay_mode LIKE concat('%',#{record.searchKey},'%')
  449. OR pay_time LIKE concat('%',#{record.searchKey},'%')
  450. OR remark LIKE concat('%',#{record.searchKey},'%')
  451. OR show_flag LIKE concat('%',#{record.searchKey},'%')
  452. OR status_flag LIKE concat('%',#{record.searchKey},'%')
  453. OR fee LIKE concat('%',#{record.searchKey},'%')
  454. </trim>
  455. </if>
  456. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  457. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  458. <choose>
  459. <when test="item.indexOf('like') != -1">
  460. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  461. <if test="detailIndex == 3">
  462. concat('%',#{itemDetail},'%')
  463. </if>
  464. <if test="detailIndex &lt; 3">
  465. ${itemDetail}
  466. </if>
  467. </foreach>
  468. </when>
  469. <otherwise>
  470. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  471. <if test="detailIndex == 3">
  472. #{itemDetail}
  473. </if>
  474. <if test="detailIndex &lt; 3">
  475. ${itemDetail}
  476. </if>
  477. </foreach>
  478. </otherwise>
  479. </choose>
  480. </foreach>
  481. </if>
  482. </where>
  483. order by
  484. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  485. <trim suffixOverrides=",">
  486. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  487. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  488. ${itemDetail}
  489. </foreach>
  490. </foreach>
  491. </trim>
  492. ,
  493. </if>
  494. id desc
  495. </select>
  496. <select id="queryAllUserOrder" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserOrder">
  497. select
  498. <include refid="Base_Column_List"/>
  499. from user_order
  500. <where>
  501. and del_flag = 'N'
  502. <if test="id != null and !&quot;&quot;.equals(id)">
  503. and id = #{id}
  504. </if>
  505. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  506. and del_flag = #{delFlag}
  507. </if>
  508. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  509. and update_time = #{updateTime}
  510. </if>
  511. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  512. and update_user = #{updateUser}
  513. </if>
  514. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  515. and create_time = #{createTime}
  516. </if>
  517. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  518. and create_user = #{createUser}
  519. </if>
  520. <if test="userId != null and !&quot;&quot;.equals(userId)">
  521. and user_id = #{userId}
  522. </if>
  523. <if test="orderCode != null and !&quot;&quot;.equals(orderCode)">
  524. and order_code = #{orderCode}
  525. </if>
  526. <if test="storeId != null and !&quot;&quot;.equals(storeId)">
  527. and store_id = #{storeId}
  528. </if>
  529. <if test="productType != null and !&quot;&quot;.equals(productType)">
  530. and product_type = #{productType}
  531. </if>
  532. <if test="productId != null and !&quot;&quot;.equals(productId)">
  533. and product_id = #{productId}
  534. </if>
  535. <if test="productName != null and !&quot;&quot;.equals(productName)">
  536. and product_name = #{productName}
  537. </if>
  538. <if test="specification != null and !&quot;&quot;.equals(specification)">
  539. and specification = #{specification}
  540. </if>
  541. <if test="unitPrice != null and !&quot;&quot;.equals(unitPrice)">
  542. and unit_price = #{unitPrice}
  543. </if>
  544. <if test="quantity != null and !&quot;&quot;.equals(quantity)">
  545. and quantity = #{quantity}
  546. </if>
  547. <if test="userCouponId != null and !&quot;&quot;.equals(userCouponId)">
  548. and user_coupon_id = #{userCouponId}
  549. </if>
  550. <if test="offPrice != null and !&quot;&quot;.equals(offPrice)">
  551. and off_price = #{offPrice}
  552. </if>
  553. <if test="totlePrice != null and !&quot;&quot;.equals(totlePrice)">
  554. and totle_price = #{totlePrice}
  555. </if>
  556. <if test="dealPrice != null and !&quot;&quot;.equals(dealPrice)">
  557. and deal_price = #{dealPrice}
  558. </if>
  559. <if test="payMode != null and !&quot;&quot;.equals(payMode)">
  560. and pay_mode = #{payMode}
  561. </if>
  562. <if test="payTime != null and !&quot;&quot;.equals(payTime)">
  563. and pay_time = #{payTime}
  564. </if>
  565. <if test="remark != null and !&quot;&quot;.equals(remark)">
  566. and remark = #{remark}
  567. </if>
  568. <if test="showFlag != null and !&quot;&quot;.equals(showFlag)">
  569. and show_flag = #{showFlag}
  570. </if>
  571. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  572. and status_flag = #{statusFlag}
  573. </if>
  574. <if test="fee != null and !&quot;&quot;.equals(fee)">
  575. and fee = #{fee}
  576. </if>
  577. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  578. <trim prefix="and (" suffix=")" prefixOverrides="OR">
  579. OR user_id LIKE concat('%',#{searchKey},'%')
  580. OR order_code LIKE concat('%',#{searchKey},'%')
  581. OR store_id LIKE concat('%',#{searchKey},'%')
  582. OR product_type LIKE concat('%',#{searchKey},'%')
  583. OR product_id LIKE concat('%',#{searchKey},'%')
  584. OR product_name LIKE concat('%',#{searchKey},'%')
  585. OR specification LIKE concat('%',#{searchKey},'%')
  586. OR unit_price LIKE concat('%',#{searchKey},'%')
  587. OR quantity LIKE concat('%',#{searchKey},'%')
  588. OR user_coupon_id LIKE concat('%',#{searchKey},'%')
  589. OR off_price LIKE concat('%',#{searchKey},'%')
  590. OR totle_price LIKE concat('%',#{searchKey},'%')
  591. OR deal_price LIKE concat('%',#{searchKey},'%')
  592. OR pay_mode LIKE concat('%',#{searchKey},'%')
  593. OR pay_time LIKE concat('%',#{searchKey},'%')
  594. OR remark LIKE concat('%',#{searchKey},'%')
  595. OR show_flag LIKE concat('%',#{searchKey},'%')
  596. OR status_flag LIKE concat('%',#{searchKey},'%')
  597. OR fee LIKE concat('%',#{searchKey},'%')
  598. </trim>
  599. </if>
  600. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  601. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  602. <choose>
  603. <when test="item.indexOf('like') != -1">
  604. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  605. <if test="detailIndex == 3">
  606. concat('%',#{itemDetail},'%')
  607. </if>
  608. <if test="detailIndex &lt; 3">
  609. ${itemDetail}
  610. </if>
  611. </foreach>
  612. </when>
  613. <otherwise>
  614. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  615. <if test="detailIndex == 3">
  616. #{itemDetail}
  617. </if>
  618. <if test="detailIndex &lt; 3">
  619. ${itemDetail}
  620. </if>
  621. </foreach>
  622. </otherwise>
  623. </choose>
  624. </foreach>
  625. </if>
  626. </where>
  627. order by
  628. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  629. <trim suffixOverrides=",">
  630. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  631. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  632. ${itemDetail}
  633. </foreach>
  634. </foreach>
  635. </trim>
  636. ,
  637. </if>
  638. id desc
  639. </select>
  640. <select id="queryUserOrder" parameterType="java.util.Map" resultMap="AllInfoForGetOne">
  641. select
  642. <include refid="Base_Column_List"/>
  643. from user_order
  644. <where>
  645. and del_flag = 'N'
  646. <if test="id != null and !&quot;&quot;.equals(id)">
  647. and id = #{id}
  648. </if>
  649. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  650. and del_flag = #{delFlag}
  651. </if>
  652. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  653. and update_time = #{updateTime}
  654. </if>
  655. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  656. and update_user = #{updateUser}
  657. </if>
  658. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  659. and create_time = #{createTime}
  660. </if>
  661. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  662. and create_user = #{createUser}
  663. </if>
  664. <if test="userId != null and !&quot;&quot;.equals(userId)">
  665. and user_id = #{userId}
  666. </if>
  667. <if test="orderCode != null and !&quot;&quot;.equals(orderCode)">
  668. and order_code = #{orderCode}
  669. </if>
  670. <if test="storeId != null and !&quot;&quot;.equals(storeId)">
  671. and store_id = #{storeId}
  672. </if>
  673. <if test="productType != null and !&quot;&quot;.equals(productType)">
  674. and product_type = #{productType}
  675. </if>
  676. <if test="productId != null and !&quot;&quot;.equals(productId)">
  677. and product_id = #{productId}
  678. </if>
  679. <if test="productName != null and !&quot;&quot;.equals(productName)">
  680. and product_name = #{productName}
  681. </if>
  682. <if test="specification != null and !&quot;&quot;.equals(specification)">
  683. and specification = #{specification}
  684. </if>
  685. <if test="unitPrice != null and !&quot;&quot;.equals(unitPrice)">
  686. and unit_price = #{unitPrice}
  687. </if>
  688. <if test="quantity != null and !&quot;&quot;.equals(quantity)">
  689. and quantity = #{quantity}
  690. </if>
  691. <if test="userCouponId != null and !&quot;&quot;.equals(userCouponId)">
  692. and user_coupon_id = #{userCouponId}
  693. </if>
  694. <if test="offPrice != null and !&quot;&quot;.equals(offPrice)">
  695. and off_price = #{offPrice}
  696. </if>
  697. <if test="totlePrice != null and !&quot;&quot;.equals(totlePrice)">
  698. and totle_price = #{totlePrice}
  699. </if>
  700. <if test="dealPrice != null and !&quot;&quot;.equals(dealPrice)">
  701. and deal_price = #{dealPrice}
  702. </if>
  703. <if test="payMode != null and !&quot;&quot;.equals(payMode)">
  704. and pay_mode = #{payMode}
  705. </if>
  706. <if test="payTime != null and !&quot;&quot;.equals(payTime)">
  707. and pay_time = #{payTime}
  708. </if>
  709. <if test="remark != null and !&quot;&quot;.equals(remark)">
  710. and remark = #{remark}
  711. </if>
  712. <if test="showFlag != null and !&quot;&quot;.equals(showFlag)">
  713. and show_flag = #{showFlag}
  714. </if>
  715. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  716. and status_flag = #{statusFlag}
  717. </if>
  718. <if test="fee != null and !&quot;&quot;.equals(fee)">
  719. and fee = #{fee}
  720. </if>
  721. </where>
  722. LIMIT 1
  723. </select>
  724. <update id="delete">
  725. UPDATE user_order SET del_flag = 'Y'
  726. <where>
  727. AND id = #{id}
  728. </where>
  729. </update>
  730. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserOrder">
  731. select
  732. <include refid="Base_Column_List"/>
  733. from user_order
  734. <where>
  735. and del_flag = 'N'
  736. </where>
  737. order by id desc
  738. </select>
  739. <select id="getAutoCancel" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserOrder">
  740. select
  741. <include refid="Base_Column_List"/>
  742. from user_order
  743. <where>
  744. and del_flag = 'N'
  745. and status_flag = 0
  746. <![CDATA[AND create_time < DATE_ADD(NOW(),INTERVAL -30 MINUTE)]]>
  747. </where>
  748. order by id desc
  749. </select>
  750. <resultMap id="AllInfoForGetOne" type="com.izouma.awesomeadmin.model.UserOrder" extends="BaseResultMap">
  751. <association property="userInfo"
  752. javaType="com.izouma.awesomeadmin.model.UserInfo"
  753. select="com.izouma.awesomeadmin.dao.UserInfoMapper.queryUserInfo"
  754. column="{ id = user_id }"/>
  755. <association property="productInfo"
  756. javaType="com.izouma.awesomeadmin.model.ProductInfo"
  757. select="com.izouma.awesomeadmin.dao.ProductInfoMapper.queryProductInfo"
  758. column="{ id = product_id }"/>
  759. <association property="orderAddress"
  760. javaType="com.izouma.awesomeadmin.model.OrderAddress"
  761. select="com.izouma.awesomeadmin.dao.OrderAddressMapper.queryOrderAddress"
  762. column="{ orderId = id }"/>
  763. <collection property="orderRepairList"
  764. ofType="com.izouma.awesomeadmin.model.OrderRepair"
  765. select="com.izouma.awesomeadmin.dao.OrderRepairMapper.queryAllOrderRepair"
  766. column="{ orderId = id }"/>
  767. </resultMap>
  768. </mapper>