CouponMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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.js.kbt.mapper.CouponMapper">
  4. <resultMap id="BaseResultMap" type="com.js.kbt.model.Coupon">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="coupon_no" jdbcType="VARCHAR" property="couponNo" />
  12. <result column="order_identity" jdbcType="VARCHAR" property="orderIdentity" />
  13. <result column="type" jdbcType="INTEGER" property="type" />
  14. <result column="ower_id" jdbcType="INTEGER" property="owerId" />
  15. <result column="coupon_amount" jdbcType="INTEGER" property="couponAmount" />
  16. <result column="coupon_rule" jdbcType="VARCHAR" property="couponRule" />
  17. <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
  18. <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
  19. <result column="area_limit" jdbcType="VARCHAR" property="areaLimit" />
  20. <result column="time_e" jdbcType="VARCHAR" property="timeE" />
  21. <result column="time_s" jdbcType="VARCHAR" property="timeS" />
  22. <result column="channel" jdbcType="VARCHAR" property="channel" />
  23. <result column="title" jdbcType="VARCHAR" property="title" />
  24. <result column="descp" jdbcType="VARCHAR" property="descp" />
  25. <result column="memo" jdbcType="VARCHAR" property="memo" />
  26. <result column="indate" jdbcType="TIMESTAMP" property="indate" />
  27. <result column="type_id" jdbcType="INTEGER" property="typeId" />
  28. </resultMap>
  29. <sql id="Example_Where_Clause">
  30. <!--
  31. WARNING - @mbggenerated
  32. This element is automatically generated by MyBatis Generator, do not modify.
  33. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  34. -->
  35. <where>
  36. <foreach collection="oredCriteria" item="criteria" separator="or">
  37. <if test="criteria.valid">
  38. <trim prefix="(" prefixOverrides="and" suffix=")">
  39. <foreach collection="criteria.criteria" item="criterion">
  40. <choose>
  41. <when test="criterion.noValue">
  42. and ${criterion.condition}
  43. </when>
  44. <when test="criterion.singleValue">
  45. and ${criterion.condition} #{criterion.value}
  46. </when>
  47. <when test="criterion.betweenValue">
  48. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  49. </when>
  50. <when test="criterion.listValue">
  51. and ${criterion.condition}
  52. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  53. #{listItem}
  54. </foreach>
  55. </when>
  56. </choose>
  57. </foreach>
  58. </trim>
  59. </if>
  60. </foreach>
  61. </where>
  62. </sql>
  63. <sql id="Update_By_Example_Where_Clause">
  64. <!--
  65. WARNING - @mbggenerated
  66. This element is automatically generated by MyBatis Generator, do not modify.
  67. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  68. -->
  69. <where>
  70. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  71. <if test="criteria.valid">
  72. <trim prefix="(" prefixOverrides="and" suffix=")">
  73. <foreach collection="criteria.criteria" item="criterion">
  74. <choose>
  75. <when test="criterion.noValue">
  76. and ${criterion.condition}
  77. </when>
  78. <when test="criterion.singleValue">
  79. and ${criterion.condition} #{criterion.value}
  80. </when>
  81. <when test="criterion.betweenValue">
  82. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  83. </when>
  84. <when test="criterion.listValue">
  85. and ${criterion.condition}
  86. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  87. #{listItem}
  88. </foreach>
  89. </when>
  90. </choose>
  91. </foreach>
  92. </trim>
  93. </if>
  94. </foreach>
  95. </where>
  96. </sql>
  97. <sql id="Base_Column_List">
  98. <!--
  99. WARNING - @mbggenerated
  100. This element is automatically generated by MyBatis Generator, do not modify.
  101. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  102. -->
  103. id, coupon_no, order_identity, type, ower_id, coupon_amount, coupon_rule, start_time,
  104. end_time, area_limit, time_e, time_s, channel, title, descp, memo, indate, type_id
  105. </sql>
  106. <select id="selectByExample" parameterType="com.js.kbt.model.CouponExample" resultMap="BaseResultMap">
  107. <!--
  108. WARNING - @mbggenerated
  109. This element is automatically generated by MyBatis Generator, do not modify.
  110. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  111. -->
  112. select
  113. <if test="distinct">
  114. distinct
  115. </if>
  116. <include refid="Base_Column_List" />
  117. from coupon
  118. <if test="_parameter != null">
  119. <include refid="Example_Where_Clause" />
  120. </if>
  121. <if test="orderByClause != null">
  122. order by ${orderByClause}
  123. </if>
  124. </select>
  125. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  126. <!--
  127. WARNING - @mbggenerated
  128. This element is automatically generated by MyBatis Generator, do not modify.
  129. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  130. -->
  131. select
  132. <include refid="Base_Column_List" />
  133. from coupon
  134. where id = #{id,jdbcType=INTEGER}
  135. </select>
  136. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  137. <!--
  138. WARNING - @mbggenerated
  139. This element is automatically generated by MyBatis Generator, do not modify.
  140. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  141. -->
  142. delete from coupon
  143. where id = #{id,jdbcType=INTEGER}
  144. </delete>
  145. <delete id="deleteByExample" parameterType="com.js.kbt.model.CouponExample">
  146. <!--
  147. WARNING - @mbggenerated
  148. This element is automatically generated by MyBatis Generator, do not modify.
  149. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  150. -->
  151. delete from coupon
  152. <if test="_parameter != null">
  153. <include refid="Example_Where_Clause" />
  154. </if>
  155. </delete>
  156. <insert id="insert" parameterType="com.js.kbt.model.Coupon">
  157. <!--
  158. WARNING - @mbggenerated
  159. This element is automatically generated by MyBatis Generator, do not modify.
  160. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  161. -->
  162. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  163. SELECT LAST_INSERT_ID()
  164. </selectKey>
  165. insert into coupon (coupon_no, order_identity, type,
  166. ower_id, coupon_amount, coupon_rule,
  167. start_time, end_time, area_limit,
  168. time_e, time_s, channel,
  169. title, descp, memo,
  170. indate, type_id)
  171. values (#{couponNo,jdbcType=VARCHAR}, #{orderIdentity,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  172. #{owerId,jdbcType=INTEGER}, #{couponAmount,jdbcType=INTEGER}, #{couponRule,jdbcType=VARCHAR},
  173. #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{areaLimit,jdbcType=VARCHAR},
  174. #{timeE,jdbcType=VARCHAR}, #{timeS,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR},
  175. #{title,jdbcType=VARCHAR}, #{descp,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},
  176. #{indate,jdbcType=TIMESTAMP}, #{typeId,jdbcType=INTEGER})
  177. </insert>
  178. <insert id="insertSelective" parameterType="com.js.kbt.model.Coupon">
  179. <!--
  180. WARNING - @mbggenerated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  183. -->
  184. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
  185. SELECT LAST_INSERT_ID()
  186. </selectKey>
  187. insert into coupon
  188. <trim prefix="(" suffix=")" suffixOverrides=",">
  189. <if test="couponNo != null">
  190. coupon_no,
  191. </if>
  192. <if test="orderIdentity != null">
  193. order_identity,
  194. </if>
  195. <if test="type != null">
  196. type,
  197. </if>
  198. <if test="owerId != null">
  199. ower_id,
  200. </if>
  201. <if test="couponAmount != null">
  202. coupon_amount,
  203. </if>
  204. <if test="couponRule != null">
  205. coupon_rule,
  206. </if>
  207. <if test="startTime != null">
  208. start_time,
  209. </if>
  210. <if test="endTime != null">
  211. end_time,
  212. </if>
  213. <if test="areaLimit != null">
  214. area_limit,
  215. </if>
  216. <if test="timeE != null">
  217. time_e,
  218. </if>
  219. <if test="timeS != null">
  220. time_s,
  221. </if>
  222. <if test="channel != null">
  223. channel,
  224. </if>
  225. <if test="title != null">
  226. title,
  227. </if>
  228. <if test="descp != null">
  229. descp,
  230. </if>
  231. <if test="memo != null">
  232. memo,
  233. </if>
  234. <if test="indate != null">
  235. indate,
  236. </if>
  237. <if test="typeId != null">
  238. type_id,
  239. </if>
  240. </trim>
  241. <trim prefix="values (" suffix=")" suffixOverrides=",">
  242. <if test="couponNo != null">
  243. #{couponNo,jdbcType=VARCHAR},
  244. </if>
  245. <if test="orderIdentity != null">
  246. #{orderIdentity,jdbcType=VARCHAR},
  247. </if>
  248. <if test="type != null">
  249. #{type,jdbcType=INTEGER},
  250. </if>
  251. <if test="owerId != null">
  252. #{owerId,jdbcType=INTEGER},
  253. </if>
  254. <if test="couponAmount != null">
  255. #{couponAmount,jdbcType=INTEGER},
  256. </if>
  257. <if test="couponRule != null">
  258. #{couponRule,jdbcType=VARCHAR},
  259. </if>
  260. <if test="startTime != null">
  261. #{startTime,jdbcType=TIMESTAMP},
  262. </if>
  263. <if test="endTime != null">
  264. #{endTime,jdbcType=TIMESTAMP},
  265. </if>
  266. <if test="areaLimit != null">
  267. #{areaLimit,jdbcType=VARCHAR},
  268. </if>
  269. <if test="timeE != null">
  270. #{timeE,jdbcType=VARCHAR},
  271. </if>
  272. <if test="timeS != null">
  273. #{timeS,jdbcType=VARCHAR},
  274. </if>
  275. <if test="channel != null">
  276. #{channel,jdbcType=VARCHAR},
  277. </if>
  278. <if test="title != null">
  279. #{title,jdbcType=VARCHAR},
  280. </if>
  281. <if test="descp != null">
  282. #{descp,jdbcType=VARCHAR},
  283. </if>
  284. <if test="memo != null">
  285. #{memo,jdbcType=VARCHAR},
  286. </if>
  287. <if test="indate != null">
  288. #{indate,jdbcType=TIMESTAMP},
  289. </if>
  290. <if test="typeId != null">
  291. #{typeId,jdbcType=INTEGER},
  292. </if>
  293. </trim>
  294. </insert>
  295. <select id="countByExample" parameterType="com.js.kbt.model.CouponExample" resultType="java.lang.Integer">
  296. <!--
  297. WARNING - @mbggenerated
  298. This element is automatically generated by MyBatis Generator, do not modify.
  299. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  300. -->
  301. select count(*) from coupon
  302. <if test="_parameter != null">
  303. <include refid="Example_Where_Clause" />
  304. </if>
  305. </select>
  306. <update id="updateByExampleSelective" parameterType="map">
  307. <!--
  308. WARNING - @mbggenerated
  309. This element is automatically generated by MyBatis Generator, do not modify.
  310. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  311. -->
  312. update coupon
  313. <set>
  314. <if test="record.id != null">
  315. id = #{record.id,jdbcType=INTEGER},
  316. </if>
  317. <if test="record.couponNo != null">
  318. coupon_no = #{record.couponNo,jdbcType=VARCHAR},
  319. </if>
  320. <if test="record.orderIdentity != null">
  321. order_identity = #{record.orderIdentity,jdbcType=VARCHAR},
  322. </if>
  323. <if test="record.type != null">
  324. type = #{record.type,jdbcType=INTEGER},
  325. </if>
  326. <if test="record.owerId != null">
  327. ower_id = #{record.owerId,jdbcType=INTEGER},
  328. </if>
  329. <if test="record.couponAmount != null">
  330. coupon_amount = #{record.couponAmount,jdbcType=INTEGER},
  331. </if>
  332. <if test="record.couponRule != null">
  333. coupon_rule = #{record.couponRule,jdbcType=VARCHAR},
  334. </if>
  335. <if test="record.startTime != null">
  336. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  337. </if>
  338. <if test="record.endTime != null">
  339. end_time = #{record.endTime,jdbcType=TIMESTAMP},
  340. </if>
  341. <if test="record.areaLimit != null">
  342. area_limit = #{record.areaLimit,jdbcType=VARCHAR},
  343. </if>
  344. <if test="record.timeE != null">
  345. time_e = #{record.timeE,jdbcType=VARCHAR},
  346. </if>
  347. <if test="record.timeS != null">
  348. time_s = #{record.timeS,jdbcType=VARCHAR},
  349. </if>
  350. <if test="record.channel != null">
  351. channel = #{record.channel,jdbcType=VARCHAR},
  352. </if>
  353. <if test="record.title != null">
  354. title = #{record.title,jdbcType=VARCHAR},
  355. </if>
  356. <if test="record.descp != null">
  357. descp = #{record.descp,jdbcType=VARCHAR},
  358. </if>
  359. <if test="record.memo != null">
  360. memo = #{record.memo,jdbcType=VARCHAR},
  361. </if>
  362. <if test="record.indate != null">
  363. indate = #{record.indate,jdbcType=TIMESTAMP},
  364. </if>
  365. <if test="record.typeId != null">
  366. type_id = #{record.typeId,jdbcType=INTEGER},
  367. </if>
  368. </set>
  369. <if test="_parameter != null">
  370. <include refid="Update_By_Example_Where_Clause" />
  371. </if>
  372. </update>
  373. <update id="updateByExample" parameterType="map">
  374. <!--
  375. WARNING - @mbggenerated
  376. This element is automatically generated by MyBatis Generator, do not modify.
  377. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  378. -->
  379. update coupon
  380. set id = #{record.id,jdbcType=INTEGER},
  381. coupon_no = #{record.couponNo,jdbcType=VARCHAR},
  382. order_identity = #{record.orderIdentity,jdbcType=VARCHAR},
  383. type = #{record.type,jdbcType=INTEGER},
  384. ower_id = #{record.owerId,jdbcType=INTEGER},
  385. coupon_amount = #{record.couponAmount,jdbcType=INTEGER},
  386. coupon_rule = #{record.couponRule,jdbcType=VARCHAR},
  387. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  388. end_time = #{record.endTime,jdbcType=TIMESTAMP},
  389. area_limit = #{record.areaLimit,jdbcType=VARCHAR},
  390. time_e = #{record.timeE,jdbcType=VARCHAR},
  391. time_s = #{record.timeS,jdbcType=VARCHAR},
  392. channel = #{record.channel,jdbcType=VARCHAR},
  393. title = #{record.title,jdbcType=VARCHAR},
  394. descp = #{record.descp,jdbcType=VARCHAR},
  395. memo = #{record.memo,jdbcType=VARCHAR},
  396. indate = #{record.indate,jdbcType=TIMESTAMP},
  397. type_id = #{record.typeId,jdbcType=INTEGER}
  398. <if test="_parameter != null">
  399. <include refid="Update_By_Example_Where_Clause" />
  400. </if>
  401. </update>
  402. <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.Coupon">
  403. <!--
  404. WARNING - @mbggenerated
  405. This element is automatically generated by MyBatis Generator, do not modify.
  406. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  407. -->
  408. update coupon
  409. <set>
  410. <if test="couponNo != null">
  411. coupon_no = #{couponNo,jdbcType=VARCHAR},
  412. </if>
  413. <if test="orderIdentity != null">
  414. order_identity = #{orderIdentity,jdbcType=VARCHAR},
  415. </if>
  416. <if test="type != null">
  417. type = #{type,jdbcType=INTEGER},
  418. </if>
  419. <if test="owerId != null">
  420. ower_id = #{owerId,jdbcType=INTEGER},
  421. </if>
  422. <if test="couponAmount != null">
  423. coupon_amount = #{couponAmount,jdbcType=INTEGER},
  424. </if>
  425. <if test="couponRule != null">
  426. coupon_rule = #{couponRule,jdbcType=VARCHAR},
  427. </if>
  428. <if test="startTime != null">
  429. start_time = #{startTime,jdbcType=TIMESTAMP},
  430. </if>
  431. <if test="endTime != null">
  432. end_time = #{endTime,jdbcType=TIMESTAMP},
  433. </if>
  434. <if test="areaLimit != null">
  435. area_limit = #{areaLimit,jdbcType=VARCHAR},
  436. </if>
  437. <if test="timeE != null">
  438. time_e = #{timeE,jdbcType=VARCHAR},
  439. </if>
  440. <if test="timeS != null">
  441. time_s = #{timeS,jdbcType=VARCHAR},
  442. </if>
  443. <if test="channel != null">
  444. channel = #{channel,jdbcType=VARCHAR},
  445. </if>
  446. <if test="title != null">
  447. title = #{title,jdbcType=VARCHAR},
  448. </if>
  449. <if test="descp != null">
  450. descp = #{descp,jdbcType=VARCHAR},
  451. </if>
  452. <if test="memo != null">
  453. memo = #{memo,jdbcType=VARCHAR},
  454. </if>
  455. <if test="indate != null">
  456. indate = #{indate,jdbcType=TIMESTAMP},
  457. </if>
  458. <if test="typeId != null">
  459. type_id = #{typeId,jdbcType=INTEGER},
  460. </if>
  461. </set>
  462. where id = #{id,jdbcType=INTEGER}
  463. </update>
  464. <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.Coupon">
  465. <!--
  466. WARNING - @mbggenerated
  467. This element is automatically generated by MyBatis Generator, do not modify.
  468. This element was generated on Wed Jul 12 17:22:50 CST 2017.
  469. -->
  470. update coupon
  471. set coupon_no = #{couponNo,jdbcType=VARCHAR},
  472. order_identity = #{orderIdentity,jdbcType=VARCHAR},
  473. type = #{type,jdbcType=INTEGER},
  474. ower_id = #{owerId,jdbcType=INTEGER},
  475. coupon_amount = #{couponAmount,jdbcType=INTEGER},
  476. coupon_rule = #{couponRule,jdbcType=VARCHAR},
  477. start_time = #{startTime,jdbcType=TIMESTAMP},
  478. end_time = #{endTime,jdbcType=TIMESTAMP},
  479. area_limit = #{areaLimit,jdbcType=VARCHAR},
  480. time_e = #{timeE,jdbcType=VARCHAR},
  481. time_s = #{timeS,jdbcType=VARCHAR},
  482. channel = #{channel,jdbcType=VARCHAR},
  483. title = #{title,jdbcType=VARCHAR},
  484. descp = #{descp,jdbcType=VARCHAR},
  485. memo = #{memo,jdbcType=VARCHAR},
  486. indate = #{indate,jdbcType=TIMESTAMP},
  487. type_id = #{typeId,jdbcType=INTEGER}
  488. where id = #{id,jdbcType=INTEGER}
  489. </update>
  490. </mapper>