VcouponMapper.xml 14 KB

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