OrderFormDOMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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.cdu.lys.graduation.repository.dao.OrderFormDOMapper" >
  4. <resultMap id="BaseResultMap" type="com.cdu.lys.graduation.repository.entity.OrderFormDO" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  8. <arg column="user_coupon_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  9. <arg column="order_num" jdbcType="VARCHAR" javaType="java.lang.String" />
  10. <arg column="trade_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
  11. <arg column="pay_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
  12. <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  13. <arg column="expire_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  14. <arg column="close_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  15. <arg column="remark" jdbcType="VARCHAR" javaType="java.lang.String" />
  16. <arg column="order_amount" jdbcType="DOUBLE" javaType="java.lang.Double" />
  17. <arg column="pay_amount" jdbcType="DOUBLE" javaType="java.lang.Double" />
  18. <arg column="coupon_amount" jdbcType="DOUBLE" javaType="java.lang.Double" />
  19. <arg column="pay_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  20. <arg column="outer_trade_no" jdbcType="VARCHAR" javaType="java.lang.String" />
  21. <arg column="queue_num" jdbcType="VARCHAR" javaType="java.lang.String" />
  22. <arg column="delivery_status" jdbcType="INTEGER" javaType="java.lang.Integer" />
  23. <arg column="is_comment" jdbcType="CHAR" javaType="java.lang.String" />
  24. <arg column="comment_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
  25. </constructor>
  26. </resultMap>
  27. <sql id="Example_Where_Clause" >
  28. <where >
  29. <foreach collection="oredCriteria" item="criteria" separator="or" >
  30. <if test="criteria.valid" >
  31. <trim prefix="(" suffix=")" prefixOverrides="and" >
  32. <foreach collection="criteria.criteria" item="criterion" >
  33. <choose >
  34. <when test="criterion.noValue" >
  35. and ${criterion.condition}
  36. </when>
  37. <when test="criterion.singleValue" >
  38. and ${criterion.condition} #{criterion.value}
  39. </when>
  40. <when test="criterion.betweenValue" >
  41. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  42. </when>
  43. <when test="criterion.listValue" >
  44. and ${criterion.condition}
  45. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  46. #{listItem}
  47. </foreach>
  48. </when>
  49. </choose>
  50. </foreach>
  51. </trim>
  52. </if>
  53. </foreach>
  54. </where>
  55. </sql>
  56. <sql id="Update_By_Example_Where_Clause" >
  57. <where >
  58. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  59. <if test="criteria.valid" >
  60. <trim prefix="(" suffix=")" prefixOverrides="and" >
  61. <foreach collection="criteria.criteria" item="criterion" >
  62. <choose >
  63. <when test="criterion.noValue" >
  64. and ${criterion.condition}
  65. </when>
  66. <when test="criterion.singleValue" >
  67. and ${criterion.condition} #{criterion.value}
  68. </when>
  69. <when test="criterion.betweenValue" >
  70. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  71. </when>
  72. <when test="criterion.listValue" >
  73. and ${criterion.condition}
  74. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  75. #{listItem}
  76. </foreach>
  77. </when>
  78. </choose>
  79. </foreach>
  80. </trim>
  81. </if>
  82. </foreach>
  83. </where>
  84. </sql>
  85. <sql id="Base_Column_List" >
  86. id, user_id, user_coupon_id, order_num, trade_status, pay_status, create_time, expire_time,
  87. close_time, remark, order_amount, pay_amount, coupon_amount, pay_time, outer_trade_no,
  88. queue_num, delivery_status, is_comment, comment_time
  89. </sql>
  90. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDOExample" >
  91. select
  92. <if test="distinct" >
  93. distinct
  94. </if>
  95. 'true' as QUERYID,
  96. <include refid="Base_Column_List" />
  97. from tb_order_form
  98. <if test="_parameter != null" >
  99. <include refid="Example_Where_Clause" />
  100. </if>
  101. <if test="orderByClause != null" >
  102. order by ${orderByClause}
  103. </if>
  104. </select>
  105. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  106. select
  107. <include refid="Base_Column_List" />
  108. from tb_order_form
  109. where id = #{id,jdbcType=INTEGER}
  110. </select>
  111. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  112. delete from tb_order_form
  113. where id = #{id,jdbcType=INTEGER}
  114. </delete>
  115. <delete id="deleteByExample" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDOExample" >
  116. delete from tb_order_form
  117. <if test="_parameter != null" >
  118. <include refid="Example_Where_Clause" />
  119. </if>
  120. </delete>
  121. <insert id="insert" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDO" >
  122. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  123. SELECT LAST_INSERT_ID()
  124. </selectKey>
  125. insert into tb_order_form (user_id, user_coupon_id, order_num,
  126. trade_status, pay_status, create_time,
  127. expire_time, close_time, remark,
  128. order_amount, pay_amount, coupon_amount,
  129. pay_time, outer_trade_no, queue_num,
  130. delivery_status, is_comment, comment_time
  131. )
  132. values (#{userId,jdbcType=INTEGER}, #{userCouponId,jdbcType=INTEGER}, #{orderNum,jdbcType=VARCHAR},
  133. #{tradeStatus,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  134. #{expireTime,jdbcType=TIMESTAMP}, #{closeTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR},
  135. #{orderAmount,jdbcType=DOUBLE}, #{payAmount,jdbcType=DOUBLE}, #{couponAmount,jdbcType=DOUBLE},
  136. #{payTime,jdbcType=TIMESTAMP}, #{outerTradeNo,jdbcType=VARCHAR}, #{queueNum,jdbcType=VARCHAR},
  137. #{deliveryStatus,jdbcType=INTEGER}, #{isComment,jdbcType=CHAR}, #{commentTime,jdbcType=TIMESTAMP}
  138. )
  139. </insert>
  140. <insert id="insertSelective" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDO" >
  141. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  142. SELECT LAST_INSERT_ID()
  143. </selectKey>
  144. insert into tb_order_form
  145. <trim prefix="(" suffix=")" suffixOverrides="," >
  146. <if test="userId != null" >
  147. user_id,
  148. </if>
  149. <if test="userCouponId != null" >
  150. user_coupon_id,
  151. </if>
  152. <if test="orderNum != null" >
  153. order_num,
  154. </if>
  155. <if test="tradeStatus != null" >
  156. trade_status,
  157. </if>
  158. <if test="payStatus != null" >
  159. pay_status,
  160. </if>
  161. <if test="createTime != null" >
  162. create_time,
  163. </if>
  164. <if test="expireTime != null" >
  165. expire_time,
  166. </if>
  167. <if test="closeTime != null" >
  168. close_time,
  169. </if>
  170. <if test="remark != null" >
  171. remark,
  172. </if>
  173. <if test="orderAmount != null" >
  174. order_amount,
  175. </if>
  176. <if test="payAmount != null" >
  177. pay_amount,
  178. </if>
  179. <if test="couponAmount != null" >
  180. coupon_amount,
  181. </if>
  182. <if test="payTime != null" >
  183. pay_time,
  184. </if>
  185. <if test="outerTradeNo != null" >
  186. outer_trade_no,
  187. </if>
  188. <if test="queueNum != null" >
  189. queue_num,
  190. </if>
  191. <if test="deliveryStatus != null" >
  192. delivery_status,
  193. </if>
  194. <if test="isComment != null" >
  195. is_comment,
  196. </if>
  197. <if test="commentTime != null" >
  198. comment_time,
  199. </if>
  200. </trim>
  201. <trim prefix="values (" suffix=")" suffixOverrides="," >
  202. <if test="userId != null" >
  203. #{userId,jdbcType=INTEGER},
  204. </if>
  205. <if test="userCouponId != null" >
  206. #{userCouponId,jdbcType=INTEGER},
  207. </if>
  208. <if test="orderNum != null" >
  209. #{orderNum,jdbcType=VARCHAR},
  210. </if>
  211. <if test="tradeStatus != null" >
  212. #{tradeStatus,jdbcType=INTEGER},
  213. </if>
  214. <if test="payStatus != null" >
  215. #{payStatus,jdbcType=INTEGER},
  216. </if>
  217. <if test="createTime != null" >
  218. #{createTime,jdbcType=TIMESTAMP},
  219. </if>
  220. <if test="expireTime != null" >
  221. #{expireTime,jdbcType=TIMESTAMP},
  222. </if>
  223. <if test="closeTime != null" >
  224. #{closeTime,jdbcType=TIMESTAMP},
  225. </if>
  226. <if test="remark != null" >
  227. #{remark,jdbcType=VARCHAR},
  228. </if>
  229. <if test="orderAmount != null" >
  230. #{orderAmount,jdbcType=DOUBLE},
  231. </if>
  232. <if test="payAmount != null" >
  233. #{payAmount,jdbcType=DOUBLE},
  234. </if>
  235. <if test="couponAmount != null" >
  236. #{couponAmount,jdbcType=DOUBLE},
  237. </if>
  238. <if test="payTime != null" >
  239. #{payTime,jdbcType=TIMESTAMP},
  240. </if>
  241. <if test="outerTradeNo != null" >
  242. #{outerTradeNo,jdbcType=VARCHAR},
  243. </if>
  244. <if test="queueNum != null" >
  245. #{queueNum,jdbcType=VARCHAR},
  246. </if>
  247. <if test="deliveryStatus != null" >
  248. #{deliveryStatus,jdbcType=INTEGER},
  249. </if>
  250. <if test="isComment != null" >
  251. #{isComment,jdbcType=CHAR},
  252. </if>
  253. <if test="commentTime != null" >
  254. #{commentTime,jdbcType=TIMESTAMP},
  255. </if>
  256. </trim>
  257. </insert>
  258. <select id="countByExample" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDOExample" resultType="java.lang.Integer" >
  259. select count(*) from tb_order_form
  260. <if test="_parameter != null" >
  261. <include refid="Example_Where_Clause" />
  262. </if>
  263. </select>
  264. <update id="updateByExampleSelective" parameterType="map" >
  265. update tb_order_form
  266. <set >
  267. <if test="record.id != null" >
  268. id = #{record.id,jdbcType=INTEGER},
  269. </if>
  270. <if test="record.userId != null" >
  271. user_id = #{record.userId,jdbcType=INTEGER},
  272. </if>
  273. <if test="record.userCouponId != null" >
  274. user_coupon_id = #{record.userCouponId,jdbcType=INTEGER},
  275. </if>
  276. <if test="record.orderNum != null" >
  277. order_num = #{record.orderNum,jdbcType=VARCHAR},
  278. </if>
  279. <if test="record.tradeStatus != null" >
  280. trade_status = #{record.tradeStatus,jdbcType=INTEGER},
  281. </if>
  282. <if test="record.payStatus != null" >
  283. pay_status = #{record.payStatus,jdbcType=INTEGER},
  284. </if>
  285. <if test="record.createTime != null" >
  286. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  287. </if>
  288. <if test="record.expireTime != null" >
  289. expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
  290. </if>
  291. <if test="record.closeTime != null" >
  292. close_time = #{record.closeTime,jdbcType=TIMESTAMP},
  293. </if>
  294. <if test="record.remark != null" >
  295. remark = #{record.remark,jdbcType=VARCHAR},
  296. </if>
  297. <if test="record.orderAmount != null" >
  298. order_amount = #{record.orderAmount,jdbcType=DOUBLE},
  299. </if>
  300. <if test="record.payAmount != null" >
  301. pay_amount = #{record.payAmount,jdbcType=DOUBLE},
  302. </if>
  303. <if test="record.couponAmount != null" >
  304. coupon_amount = #{record.couponAmount,jdbcType=DOUBLE},
  305. </if>
  306. <if test="record.payTime != null" >
  307. pay_time = #{record.payTime,jdbcType=TIMESTAMP},
  308. </if>
  309. <if test="record.outerTradeNo != null" >
  310. outer_trade_no = #{record.outerTradeNo,jdbcType=VARCHAR},
  311. </if>
  312. <if test="record.queueNum != null" >
  313. queue_num = #{record.queueNum,jdbcType=VARCHAR},
  314. </if>
  315. <if test="record.deliveryStatus != null" >
  316. delivery_status = #{record.deliveryStatus,jdbcType=INTEGER},
  317. </if>
  318. <if test="record.isComment != null" >
  319. is_comment = #{record.isComment,jdbcType=CHAR},
  320. </if>
  321. <if test="record.commentTime != null" >
  322. comment_time = #{record.commentTime,jdbcType=TIMESTAMP},
  323. </if>
  324. </set>
  325. <if test="_parameter != null" >
  326. <include refid="Update_By_Example_Where_Clause" />
  327. </if>
  328. </update>
  329. <update id="updateByExample" parameterType="map" >
  330. update tb_order_form
  331. set id = #{record.id,jdbcType=INTEGER},
  332. user_id = #{record.userId,jdbcType=INTEGER},
  333. user_coupon_id = #{record.userCouponId,jdbcType=INTEGER},
  334. order_num = #{record.orderNum,jdbcType=VARCHAR},
  335. trade_status = #{record.tradeStatus,jdbcType=INTEGER},
  336. pay_status = #{record.payStatus,jdbcType=INTEGER},
  337. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  338. expire_time = #{record.expireTime,jdbcType=TIMESTAMP},
  339. close_time = #{record.closeTime,jdbcType=TIMESTAMP},
  340. remark = #{record.remark,jdbcType=VARCHAR},
  341. order_amount = #{record.orderAmount,jdbcType=DOUBLE},
  342. pay_amount = #{record.payAmount,jdbcType=DOUBLE},
  343. coupon_amount = #{record.couponAmount,jdbcType=DOUBLE},
  344. pay_time = #{record.payTime,jdbcType=TIMESTAMP},
  345. outer_trade_no = #{record.outerTradeNo,jdbcType=VARCHAR},
  346. queue_num = #{record.queueNum,jdbcType=VARCHAR},
  347. delivery_status = #{record.deliveryStatus,jdbcType=INTEGER},
  348. is_comment = #{record.isComment,jdbcType=CHAR},
  349. comment_time = #{record.commentTime,jdbcType=TIMESTAMP}
  350. <if test="_parameter != null" >
  351. <include refid="Update_By_Example_Where_Clause" />
  352. </if>
  353. </update>
  354. <update id="updateByPrimaryKeySelective" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDO" >
  355. update tb_order_form
  356. <set >
  357. <if test="userId != null" >
  358. user_id = #{userId,jdbcType=INTEGER},
  359. </if>
  360. <if test="userCouponId != null" >
  361. user_coupon_id = #{userCouponId,jdbcType=INTEGER},
  362. </if>
  363. <if test="orderNum != null" >
  364. order_num = #{orderNum,jdbcType=VARCHAR},
  365. </if>
  366. <if test="tradeStatus != null" >
  367. trade_status = #{tradeStatus,jdbcType=INTEGER},
  368. </if>
  369. <if test="payStatus != null" >
  370. pay_status = #{payStatus,jdbcType=INTEGER},
  371. </if>
  372. <if test="createTime != null" >
  373. create_time = #{createTime,jdbcType=TIMESTAMP},
  374. </if>
  375. <if test="expireTime != null" >
  376. expire_time = #{expireTime,jdbcType=TIMESTAMP},
  377. </if>
  378. <if test="closeTime != null" >
  379. close_time = #{closeTime,jdbcType=TIMESTAMP},
  380. </if>
  381. <if test="remark != null" >
  382. remark = #{remark,jdbcType=VARCHAR},
  383. </if>
  384. <if test="orderAmount != null" >
  385. order_amount = #{orderAmount,jdbcType=DOUBLE},
  386. </if>
  387. <if test="payAmount != null" >
  388. pay_amount = #{payAmount,jdbcType=DOUBLE},
  389. </if>
  390. <if test="couponAmount != null" >
  391. coupon_amount = #{couponAmount,jdbcType=DOUBLE},
  392. </if>
  393. <if test="payTime != null" >
  394. pay_time = #{payTime,jdbcType=TIMESTAMP},
  395. </if>
  396. <if test="outerTradeNo != null" >
  397. outer_trade_no = #{outerTradeNo,jdbcType=VARCHAR},
  398. </if>
  399. <if test="queueNum != null" >
  400. queue_num = #{queueNum,jdbcType=VARCHAR},
  401. </if>
  402. <if test="deliveryStatus != null" >
  403. delivery_status = #{deliveryStatus,jdbcType=INTEGER},
  404. </if>
  405. <if test="isComment != null" >
  406. is_comment = #{isComment,jdbcType=CHAR},
  407. </if>
  408. <if test="commentTime != null" >
  409. comment_time = #{commentTime,jdbcType=TIMESTAMP},
  410. </if>
  411. </set>
  412. where id = #{id,jdbcType=INTEGER}
  413. </update>
  414. <update id="updateByPrimaryKey" parameterType="com.cdu.lys.graduation.repository.entity.OrderFormDO" >
  415. update tb_order_form
  416. set user_id = #{userId,jdbcType=INTEGER},
  417. user_coupon_id = #{userCouponId,jdbcType=INTEGER},
  418. order_num = #{orderNum,jdbcType=VARCHAR},
  419. trade_status = #{tradeStatus,jdbcType=INTEGER},
  420. pay_status = #{payStatus,jdbcType=INTEGER},
  421. create_time = #{createTime,jdbcType=TIMESTAMP},
  422. expire_time = #{expireTime,jdbcType=TIMESTAMP},
  423. close_time = #{closeTime,jdbcType=TIMESTAMP},
  424. remark = #{remark,jdbcType=VARCHAR},
  425. order_amount = #{orderAmount,jdbcType=DOUBLE},
  426. pay_amount = #{payAmount,jdbcType=DOUBLE},
  427. coupon_amount = #{couponAmount,jdbcType=DOUBLE},
  428. pay_time = #{payTime,jdbcType=TIMESTAMP},
  429. outer_trade_no = #{outerTradeNo,jdbcType=VARCHAR},
  430. queue_num = #{queueNum,jdbcType=VARCHAR},
  431. delivery_status = #{deliveryStatus,jdbcType=INTEGER},
  432. is_comment = #{isComment,jdbcType=CHAR},
  433. comment_time = #{commentTime,jdbcType=TIMESTAMP}
  434. where id = #{id,jdbcType=INTEGER}
  435. </update>
  436. </mapper>