WeekStarItemRewardMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.juxiao.xchat.module.xbd.mapper.activity.WeekStarItemRewardMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.activity.WeekStarItemReward" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="status" property="status" jdbcType="INTEGER" />
  7. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  8. <result column="gift_id" property="giftId" jdbcType="INTEGER" />
  9. <result column="item_id" property="itemId" jdbcType="INTEGER" />
  10. <result column="admin_id" property="adminId" jdbcType="INTEGER" />
  11. <result column="type" property="type" jdbcType="INTEGER" />
  12. <result column="days" property="days" jdbcType="INTEGER" />
  13. <result column="content" property="content" jdbcType="VARCHAR" />
  14. <result column="seq" property="seq" jdbcType="INTEGER" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. id, status, create_time, gift_id, item_id, admin_id, type, days, content, seq
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from week_star_item_reward
  23. where id = #{id,jdbcType=BIGINT}
  24. </select>
  25. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.activity.WeekStarItemReward" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  26. insert into week_star_item_reward (id, status, create_time,
  27. gift_id, item_id, admin_id,
  28. type, days, content,
  29. seq)
  30. values (#{id,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  31. #{giftId,jdbcType=INTEGER}, #{itemId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER},
  32. #{type,jdbcType=INTEGER}, #{days,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR},
  33. #{seq,jdbcType=INTEGER})
  34. </insert>
  35. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.activity.WeekStarItemReward" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  36. insert into week_star_item_reward
  37. <trim prefix="(" suffix=")" suffixOverrides="," >
  38. <if test="id != null" >
  39. id,
  40. </if>
  41. <if test="status != null" >
  42. status,
  43. </if>
  44. <if test="createTime != null" >
  45. create_time,
  46. </if>
  47. <if test="giftId != null" >
  48. gift_id,
  49. </if>
  50. <if test="itemId != null" >
  51. item_id,
  52. </if>
  53. <if test="adminId != null" >
  54. admin_id,
  55. </if>
  56. <if test="type != null" >
  57. type,
  58. </if>
  59. <if test="days != null" >
  60. days,
  61. </if>
  62. <if test="content != null" >
  63. content,
  64. </if>
  65. <if test="seq != null" >
  66. seq,
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides="," >
  70. <if test="id != null" >
  71. #{id,jdbcType=BIGINT},
  72. </if>
  73. <if test="status != null" >
  74. #{status,jdbcType=INTEGER},
  75. </if>
  76. <if test="createTime != null" >
  77. #{createTime,jdbcType=TIMESTAMP},
  78. </if>
  79. <if test="giftId != null" >
  80. #{giftId,jdbcType=INTEGER},
  81. </if>
  82. <if test="itemId != null" >
  83. #{itemId,jdbcType=INTEGER},
  84. </if>
  85. <if test="adminId != null" >
  86. #{adminId,jdbcType=INTEGER},
  87. </if>
  88. <if test="type != null" >
  89. #{type,jdbcType=INTEGER},
  90. </if>
  91. <if test="days != null" >
  92. #{days,jdbcType=INTEGER},
  93. </if>
  94. <if test="content != null" >
  95. #{content,jdbcType=VARCHAR},
  96. </if>
  97. <if test="seq != null" >
  98. #{seq,jdbcType=INTEGER},
  99. </if>
  100. </trim>
  101. </insert>
  102. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.activity.WeekStarItemReward" >
  103. update week_star_item_reward
  104. <set >
  105. <if test="status != null" >
  106. status = #{status,jdbcType=INTEGER},
  107. </if>
  108. <if test="createTime != null" >
  109. create_time = #{createTime,jdbcType=TIMESTAMP},
  110. </if>
  111. <if test="giftId != null" >
  112. gift_id = #{giftId,jdbcType=INTEGER},
  113. </if>
  114. <if test="itemId != null" >
  115. item_id = #{itemId,jdbcType=INTEGER},
  116. </if>
  117. <if test="adminId != null" >
  118. admin_id = #{adminId,jdbcType=INTEGER},
  119. </if>
  120. <if test="type != null" >
  121. type = #{type,jdbcType=INTEGER},
  122. </if>
  123. <if test="days != null" >
  124. days = #{days,jdbcType=INTEGER},
  125. </if>
  126. <if test="content != null" >
  127. content = #{content,jdbcType=VARCHAR},
  128. </if>
  129. <if test="seq != null" >
  130. seq = #{seq,jdbcType=INTEGER},
  131. </if>
  132. </set>
  133. where id = #{id,jdbcType=BIGINT}
  134. </update>
  135. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.activity.WeekStarItemReward" >
  136. update week_star_item_reward
  137. set status = #{status,jdbcType=INTEGER},
  138. create_time = #{createTime,jdbcType=TIMESTAMP},
  139. gift_id = #{giftId,jdbcType=INTEGER},
  140. item_id = #{itemId,jdbcType=INTEGER},
  141. admin_id = #{adminId,jdbcType=INTEGER},
  142. type = #{type,jdbcType=INTEGER},
  143. days = #{days,jdbcType=INTEGER},
  144. content = #{content,jdbcType=VARCHAR},
  145. seq = #{seq,jdbcType=INTEGER}
  146. where id = #{id,jdbcType=BIGINT}
  147. </update>
  148. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  149. delete from week_star_item_reward
  150. where id = #{id,jdbcType=BIGINT}
  151. </delete>
  152. <select id="selectWeekStarItemRewardByQuery" resultType="com.juxiao.xchat.module.xbd.vo.WeekStarItemRewardVO">
  153. select id,status,create_time as createTime,gift_id as giftId,item_id as itemId,admin_id as adminId,type,days,content,seq
  154. from week_star_item_reward
  155. where 1 = 1
  156. <if test="type != null">
  157. and type = #{type}
  158. </if>
  159. order by create_time desc
  160. </select>
  161. </mapper>