PayCodeOrderMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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.PayCodeOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.PayCodeOrder">
  5. <!--generatedStart-->
  6. <id column="id" property="id" jdbcType="INTEGER"/>
  7. <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
  8. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  9. <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
  10. <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
  11. <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
  12. <result column="order_code" property="orderCode" jdbcType="VARCHAR"/>
  13. <result column="type_flag" property="typeFlag" jdbcType="INTEGER"/>
  14. <result column="code_id" property="codeId" jdbcType="INTEGER"/>
  15. <result column="stock_id" property="stockId" jdbcType="INTEGER"/>
  16. <result column="pay_type" property="payType" jdbcType="VARCHAR"/>
  17. <result column="money" property="money" jdbcType="DECIMAL"/>
  18. <result column="pay_money" property="payMoney" jdbcType="DECIMAL"/>
  19. <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
  20. <result column="pay_time" property="payTime" jdbcType="TIMESTAMP"/>
  21. <result column="user_id" property="userId" jdbcType="INTEGER"/>
  22. <result column="remark" property="remark" jdbcType="VARCHAR"/>
  23. <result column="product_id" property="productId" jdbcType="INTEGER"/>
  24. <!--generatedEnd-->
  25. </resultMap>
  26. <sql id="Base_Column_List">
  27. <!--generatedStart-->
  28. id, del_flag, update_time, update_user, create_time, create_user, order_code, type_flag,
  29. code_id, stock_id, pay_type, money, pay_money, status_flag, pay_time, user_id, remark,
  30. product_id <!--generatedEnd-->
  31. </sql>
  32. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
  33. SELECT
  34. <include refid="Base_Column_List"/>
  35. FROM pay_code_order
  36. WHERE id = #{id,jdbcType=INTEGER}
  37. </select>
  38. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  39. DELETE
  40. FROM pay_code_order
  41. WHERE id = #{id,jdbcType=INTEGER}
  42. </delete>
  43. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.PayCodeOrder" useGeneratedKeys="true"
  44. keyProperty="id">
  45. INSERT INTO pay_code_order
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <!--generatedStart-->
  48. <if test="id!= null">
  49. id,
  50. </if>
  51. <if test="delFlag!= null">
  52. del_flag,
  53. </if>
  54. <if test="updateTime!= null">
  55. update_time,
  56. </if>
  57. <if test="updateUser!= null">
  58. update_user,
  59. </if>
  60. <if test="createTime!= null">
  61. create_time,
  62. </if>
  63. <if test="createUser!= null">
  64. create_user,
  65. </if>
  66. <if test="orderCode!= null">
  67. order_code,
  68. </if>
  69. <if test="typeFlag!= null">
  70. type_flag,
  71. </if>
  72. <if test="codeId!= null">
  73. code_id,
  74. </if>
  75. <if test="stockId!= null">
  76. stock_id,
  77. </if>
  78. <if test="payType!= null">
  79. pay_type,
  80. </if>
  81. <if test="money!= null">
  82. money,
  83. </if>
  84. <if test="payMoney!= null">
  85. pay_money,
  86. </if>
  87. <if test="statusFlag!= null">
  88. status_flag,
  89. </if>
  90. <if test="payTime!= null">
  91. pay_time,
  92. </if>
  93. <if test="userId!= null">
  94. user_id,
  95. </if>
  96. <if test="remark!= null">
  97. remark,
  98. </if>
  99. <if test="productId!= null">
  100. product_id,
  101. </if>
  102. <!--generatedEnd-->
  103. </trim>
  104. <trim prefix="values (" suffix=")" suffixOverrides=",">
  105. <!--generatedStart-->
  106. <if test="id != null">
  107. #{id,jdbcType=INTEGER},
  108. </if>
  109. <if test="delFlag != null">
  110. #{delFlag,jdbcType=CHAR},
  111. </if>
  112. <if test="updateTime != null">
  113. #{updateTime,jdbcType=TIMESTAMP},
  114. </if>
  115. <if test="updateUser != null">
  116. #{updateUser,jdbcType=VARCHAR},
  117. </if>
  118. <if test="createTime != null">
  119. #{createTime,jdbcType=TIMESTAMP},
  120. </if>
  121. <if test="createUser != null">
  122. #{createUser,jdbcType=VARCHAR},
  123. </if>
  124. <if test="orderCode != null">
  125. #{orderCode,jdbcType=VARCHAR},
  126. </if>
  127. <if test="typeFlag != null">
  128. #{typeFlag,jdbcType=INTEGER},
  129. </if>
  130. <if test="codeId != null">
  131. #{codeId,jdbcType=INTEGER},
  132. </if>
  133. <if test="stockId != null">
  134. #{stockId,jdbcType=INTEGER},
  135. </if>
  136. <if test="payType != null">
  137. #{payType,jdbcType=VARCHAR},
  138. </if>
  139. <if test="money != null">
  140. #{money,jdbcType=DECIMAL},
  141. </if>
  142. <if test="payMoney != null">
  143. #{payMoney,jdbcType=DECIMAL},
  144. </if>
  145. <if test="statusFlag != null">
  146. #{statusFlag,jdbcType=INTEGER},
  147. </if>
  148. <if test="payTime != null">
  149. #{payTime,jdbcType=TIMESTAMP},
  150. </if>
  151. <if test="userId != null">
  152. #{userId,jdbcType=INTEGER},
  153. </if>
  154. <if test="remark != null">
  155. #{remark,jdbcType=VARCHAR},
  156. </if>
  157. <if test="productId != null">
  158. #{productId,jdbcType=INTEGER},
  159. </if>
  160. <!--generatedEnd-->
  161. </trim>
  162. </insert>
  163. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.PayCodeOrder">
  164. UPDATE pay_code_order
  165. <set>
  166. <!--generatedStart-->
  167. <if test="id != null">
  168. id= #{id,jdbcType=INTEGER},
  169. </if>
  170. <if test="delFlag != null">
  171. del_flag= #{delFlag,jdbcType=CHAR},
  172. </if>
  173. <if test="updateTime != null">
  174. update_time= #{updateTime,jdbcType=TIMESTAMP},
  175. </if>
  176. <if test="updateUser != null">
  177. update_user= #{updateUser,jdbcType=VARCHAR},
  178. </if>
  179. <if test="createTime != null">
  180. create_time= #{createTime,jdbcType=TIMESTAMP},
  181. </if>
  182. <if test="createUser != null">
  183. create_user= #{createUser,jdbcType=VARCHAR},
  184. </if>
  185. <if test="orderCode != null">
  186. order_code= #{orderCode,jdbcType=VARCHAR},
  187. </if>
  188. <if test="typeFlag != null">
  189. type_flag= #{typeFlag,jdbcType=INTEGER},
  190. </if>
  191. <if test="codeId != null">
  192. code_id= #{codeId,jdbcType=INTEGER},
  193. </if>
  194. <if test="stockId != null">
  195. stock_id= #{stockId,jdbcType=INTEGER},
  196. </if>
  197. <if test="payType != null">
  198. pay_type= #{payType,jdbcType=VARCHAR},
  199. </if>
  200. <if test="money != null">
  201. money= #{money,jdbcType=DECIMAL},
  202. </if>
  203. <if test="payMoney != null">
  204. pay_money= #{payMoney,jdbcType=DECIMAL},
  205. </if>
  206. <if test="statusFlag != null">
  207. status_flag= #{statusFlag,jdbcType=INTEGER},
  208. </if>
  209. <if test="payTime != null">
  210. pay_time= #{payTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="userId != null">
  213. user_id= #{userId,jdbcType=INTEGER},
  214. </if>
  215. <if test="remark != null">
  216. remark= #{remark,jdbcType=VARCHAR},
  217. </if>
  218. <if test="productId != null">
  219. product_id= #{productId,jdbcType=INTEGER},
  220. </if>
  221. <!--generatedEnd-->
  222. </set>
  223. WHERE
  224. <if test="id != null and !&quot;&quot;.equals(id)">
  225. id = #{id,jdbcType=INTEGER}
  226. </if>
  227. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  228. id IN (${idStr})
  229. </if>
  230. </update>
  231. <select id="queryPayCodeOrderByPage" parameterType="java.util.Map"
  232. resultMap="PagePayCodeOrderResult">
  233. SELECT
  234. <include refid="Base_Column_List"/>
  235. FROM pay_code_order
  236. <where>
  237. AND del_flag = 'N'
  238. <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
  239. AND id IN (${record.idStr})
  240. </if>
  241. <!--generatedStart-->
  242. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  243. AND id = #{record.id}
  244. </if>
  245. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  246. AND del_flag = #{record.delFlag}
  247. </if>
  248. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  249. AND update_time = #{record.updateTime}
  250. </if>
  251. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  252. AND update_user = #{record.updateUser}
  253. </if>
  254. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  255. AND create_time = #{record.createTime}
  256. </if>
  257. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  258. AND create_user = #{record.createUser}
  259. </if>
  260. <if test="record.orderCode != null and !&quot;&quot;.equals(record.orderCode)">
  261. AND order_code = #{record.orderCode}
  262. </if>
  263. <if test="record.typeFlag != null and !&quot;&quot;.equals(record.typeFlag)">
  264. AND type_flag = #{record.typeFlag}
  265. </if>
  266. <if test="record.codeId != null and !&quot;&quot;.equals(record.codeId)">
  267. AND code_id = #{record.codeId}
  268. </if>
  269. <if test="record.stockId != null and !&quot;&quot;.equals(record.stockId)">
  270. AND stock_id = #{record.stockId}
  271. </if>
  272. <if test="record.payType != null and !&quot;&quot;.equals(record.payType)">
  273. AND pay_type = #{record.payType}
  274. </if>
  275. <if test="record.money != null and !&quot;&quot;.equals(record.money)">
  276. AND money = #{record.money}
  277. </if>
  278. <if test="record.payMoney != null and !&quot;&quot;.equals(record.payMoney)">
  279. AND pay_money = #{record.payMoney}
  280. </if>
  281. <if test="record.statusFlag != null and !&quot;&quot;.equals(record.statusFlag)">
  282. AND status_flag = #{record.statusFlag}
  283. </if>
  284. <if test="record.payTime != null and !&quot;&quot;.equals(record.payTime)">
  285. AND pay_time = #{record.payTime}
  286. </if>
  287. <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
  288. AND user_id = #{record.userId}
  289. </if>
  290. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  291. AND remark = #{record.remark}
  292. </if>
  293. <if test="record.productId != null and !&quot;&quot;.equals(record.productId)">
  294. AND product_id = #{record.productId}
  295. </if>
  296. <!--generatedEnd-->
  297. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  298. <trim prefix="and (" suffix=")" prefixOverrides="OR">
  299. <!--generatedStart-->
  300. OR order_code LIKE concat('%',#{record.searchKey},'%')
  301. OR type_flag LIKE concat('%',#{record.searchKey},'%')
  302. OR code_id LIKE concat('%',#{record.searchKey},'%')
  303. OR stock_id LIKE concat('%',#{record.searchKey},'%')
  304. OR pay_type LIKE concat('%',#{record.searchKey},'%')
  305. OR money LIKE concat('%',#{record.searchKey},'%')
  306. OR pay_money LIKE concat('%',#{record.searchKey},'%')
  307. OR status_flag LIKE concat('%',#{record.searchKey},'%')
  308. OR pay_time LIKE concat('%',#{record.searchKey},'%')
  309. OR user_id LIKE concat('%',#{record.searchKey},'%')
  310. OR remark LIKE concat('%',#{record.searchKey},'%')
  311. <!--generatedEnd-->
  312. </trim>
  313. </if>
  314. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  315. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  316. <choose>
  317. <when test="item.indexOf('like') != -1">
  318. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  319. <if test="detailIndex == 3">
  320. concat('%',#{itemDetail},'%')
  321. </if>
  322. <if test="detailIndex &lt; 3">
  323. ${itemDetail}
  324. </if>
  325. </foreach>
  326. </when>
  327. <otherwise>
  328. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  329. <if test="detailIndex == 3">
  330. #{itemDetail}
  331. </if>
  332. <if test="detailIndex &lt; 3">
  333. ${itemDetail}
  334. </if>
  335. </foreach>
  336. </otherwise>
  337. </choose>
  338. </foreach>
  339. </if>
  340. </where>
  341. ORDER BY
  342. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  343. <trim suffixOverrides=",">
  344. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  345. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  346. ${itemDetail}
  347. </foreach>
  348. </foreach>
  349. </trim>
  350. ,
  351. </if>
  352. id DESC
  353. </select>
  354. <select id="queryAllPayCodeOrder" parameterType="java.util.Map"
  355. resultType="com.izouma.awesomeadmin.model.PayCodeOrder">
  356. SELECT
  357. <include refid="Base_Column_List"/>
  358. FROM pay_code_order
  359. <where>
  360. AND del_flag = 'N'
  361. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  362. AND id IN (${idStr})
  363. </if>
  364. <!--generatedStart-->
  365. <if test="id != null and !&quot;&quot;.equals(id)">
  366. AND id = #{id}
  367. </if>
  368. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  369. AND del_flag = #{delFlag}
  370. </if>
  371. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  372. AND update_time = #{updateTime}
  373. </if>
  374. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  375. AND update_user = #{updateUser}
  376. </if>
  377. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  378. AND create_time = #{createTime}
  379. </if>
  380. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  381. AND create_user = #{createUser}
  382. </if>
  383. <if test="orderCode != null and !&quot;&quot;.equals(orderCode)">
  384. AND order_code = #{orderCode}
  385. </if>
  386. <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
  387. AND type_flag = #{typeFlag}
  388. </if>
  389. <if test="codeId != null and !&quot;&quot;.equals(codeId)">
  390. AND code_id = #{codeId}
  391. </if>
  392. <if test="stockId != null and !&quot;&quot;.equals(stockId)">
  393. AND stock_id = #{stockId}
  394. </if>
  395. <if test="payType != null and !&quot;&quot;.equals(payType)">
  396. AND pay_type = #{payType}
  397. </if>
  398. <if test="money != null and !&quot;&quot;.equals(money)">
  399. AND money = #{money}
  400. </if>
  401. <if test="payMoney != null and !&quot;&quot;.equals(payMoney)">
  402. AND pay_money = #{payMoney}
  403. </if>
  404. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  405. AND status_flag = #{statusFlag}
  406. </if>
  407. <if test="payTime != null and !&quot;&quot;.equals(payTime)">
  408. AND pay_time = #{payTime}
  409. </if>
  410. <if test="userId != null and !&quot;&quot;.equals(userId)">
  411. AND user_id = #{userId}
  412. </if>
  413. <if test="remark != null and !&quot;&quot;.equals(remark)">
  414. AND remark = #{remark}
  415. </if>
  416. <if test="productId != null and !&quot;&quot;.equals(productId)">
  417. AND product_id = #{productId}
  418. </if>
  419. <!--generatedEnd-->
  420. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  421. <trim prefix="and (" suffix=")" prefixOverrides="OR">
  422. <!--generatedStart-->
  423. OR order_code LIKE concat('%',#{searchKey},'%')
  424. OR type_flag LIKE concat('%',#{searchKey},'%')
  425. OR code_id LIKE concat('%',#{searchKey},'%')
  426. OR stock_id LIKE concat('%',#{searchKey},'%')
  427. OR pay_type LIKE concat('%',#{searchKey},'%')
  428. OR money LIKE concat('%',#{searchKey},'%')
  429. OR pay_money LIKE concat('%',#{searchKey},'%')
  430. OR status_flag LIKE concat('%',#{searchKey},'%')
  431. OR pay_time LIKE concat('%',#{searchKey},'%')
  432. OR user_id LIKE concat('%',#{searchKey},'%')
  433. OR remark LIKE concat('%',#{searchKey},'%')
  434. <!--generatedEnd-->
  435. </trim>
  436. </if>
  437. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  438. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  439. <choose>
  440. <when test="item.indexOf('like') != -1">
  441. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  442. <if test="detailIndex == 3">
  443. concat('%',#{itemDetail},'%')
  444. </if>
  445. <if test="detailIndex &lt; 3">
  446. ${itemDetail}
  447. </if>
  448. </foreach>
  449. </when>
  450. <otherwise>
  451. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  452. <if test="detailIndex == 3">
  453. #{itemDetail}
  454. </if>
  455. <if test="detailIndex &lt; 3">
  456. ${itemDetail}
  457. </if>
  458. </foreach>
  459. </otherwise>
  460. </choose>
  461. </foreach>
  462. </if>
  463. </where>
  464. ORDER BY
  465. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  466. <trim suffixOverrides=",">
  467. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  468. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  469. ${itemDetail}
  470. </foreach>
  471. </foreach>
  472. </trim>
  473. ,
  474. </if>
  475. id DESC
  476. </select>
  477. <select id="queryAutoCancelPayCodeOrderList" parameterType="java.util.Map"
  478. resultType="com.izouma.awesomeadmin.model.PayCodeOrder">
  479. SELECT
  480. *
  481. FROM pay_code_order
  482. <where>
  483. AND del_flag = 'N'
  484. AND status_flag = 0
  485. AND DATE_SUB(
  486. CURRENT_TIMESTAMP (),
  487. INTERVAL 30 MINUTE
  488. ) <![CDATA[ >= ]]> create_time
  489. </where>
  490. </select>
  491. <select id="queryPayCodeOrder" parameterType="java.util.Map"
  492. resultMap="OnePayCodeOrderResult">
  493. SELECT
  494. <include refid="Base_Column_List"/>
  495. FROM pay_code_order
  496. <where>
  497. AND del_flag = 'N'
  498. <!--generatedStart-->
  499. <if test="id != null and !&quot;&quot;.equals(id)">
  500. AND id = #{id}
  501. </if>
  502. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  503. AND del_flag = #{delFlag}
  504. </if>
  505. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  506. AND update_time = #{updateTime}
  507. </if>
  508. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  509. AND update_user = #{updateUser}
  510. </if>
  511. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  512. AND create_time = #{createTime}
  513. </if>
  514. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  515. AND create_user = #{createUser}
  516. </if>
  517. <if test="orderCode != null and !&quot;&quot;.equals(orderCode)">
  518. AND order_code = #{orderCode}
  519. </if>
  520. <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
  521. AND type_flag = #{typeFlag}
  522. </if>
  523. <if test="codeId != null and !&quot;&quot;.equals(codeId)">
  524. AND code_id = #{codeId}
  525. </if>
  526. <if test="stockId != null and !&quot;&quot;.equals(stockId)">
  527. AND stock_id = #{stockId}
  528. </if>
  529. <if test="payType != null and !&quot;&quot;.equals(payType)">
  530. AND pay_type = #{payType}
  531. </if>
  532. <if test="money != null and !&quot;&quot;.equals(money)">
  533. AND money = #{money}
  534. </if>
  535. <if test="payMoney != null and !&quot;&quot;.equals(payMoney)">
  536. AND pay_money = #{payMoney}
  537. </if>
  538. <if test="statusFlag != null and !&quot;&quot;.equals(statusFlag)">
  539. AND status_flag = #{statusFlag}
  540. </if>
  541. <if test="payTime != null and !&quot;&quot;.equals(payTime)">
  542. AND pay_time = #{payTime}
  543. </if>
  544. <if test="userId != null and !&quot;&quot;.equals(userId)">
  545. AND user_id = #{userId}
  546. </if>
  547. <if test="remark != null and !&quot;&quot;.equals(remark)">
  548. AND remark = #{remark}
  549. </if>
  550. <if test="productId != null and !&quot;&quot;.equals(productId)">
  551. AND product_id = #{productId}
  552. </if>
  553. <!--generatedEnd-->
  554. </where>
  555. LIMIT 1
  556. </select>
  557. <update id="delete">
  558. UPDATE pay_code_order SET del_flag = 'Y'
  559. WHERE
  560. <if test="id != null and !&quot;&quot;.equals(id)">
  561. id = #{id,jdbcType=INTEGER}
  562. </if>
  563. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  564. id IN (${idStr})
  565. </if>
  566. </update>
  567. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PayCodeOrder">
  568. SELECT
  569. <include refid="Base_Column_List"/>
  570. FROM pay_code_order
  571. <where>
  572. AND del_flag = 'N'
  573. <!--generatedStart-->
  574. <!--generatedEnd-->
  575. </where>
  576. ORDER BY id DESC
  577. </select>
  578. <resultMap id="PagePayCodeOrderResult" type="com.izouma.awesomeadmin.model.PayCodeOrder" extends="BaseResultMap">
  579. <association property="productInfo"
  580. javaType="com.izouma.awesomeadmin.model.ProductInfo"
  581. select="com.izouma.awesomeadmin.dao.ProductInfoMapper.queryProductInfo"
  582. column="{ id = product_id }"/>
  583. </resultMap>
  584. <resultMap id="OnePayCodeOrderResult" type="com.izouma.awesomeadmin.model.PayCodeOrder" extends="BaseResultMap">
  585. <association property="productInfo"
  586. javaType="com.izouma.awesomeadmin.model.ProductInfo"
  587. select="com.izouma.awesomeadmin.dao.ProductInfoMapper.queryProductInfo"
  588. column="{ id = product_id }"/>
  589. <association property="payCodeInfo"
  590. javaType="com.izouma.awesomeadmin.model.PayCodeInfo"
  591. select="com.izouma.awesomeadmin.dao.PayCodeInfoMapper.queryPayCodeInfo"
  592. column="{ id = code_id }"/>
  593. <association property="payCodeStock"
  594. javaType="com.izouma.awesomeadmin.model.PayCodeStock"
  595. select="com.izouma.awesomeadmin.dao.PayCodeStockMapper.queryPayCodeStock"
  596. column="{ id = stock_id }"/>
  597. </resultMap>
  598. </mapper>