BannerMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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.home.BannerMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.home.Banner" >
  5. <id column="banner_id" property="bannerId" jdbcType="INTEGER" />
  6. <result column="banner_name" property="bannerName" jdbcType="VARCHAR" />
  7. <result column="banner_pic" property="bannerPic" jdbcType="VARCHAR" />
  8. <result column="skip_type" property="skipType" jdbcType="TINYINT" />
  9. <result column="skip_uri" property="skipUri" jdbcType="VARCHAR" />
  10. <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
  11. <result column="os_type" property="osType" jdbcType="TINYINT" />
  12. <result column="is_new_user" property="isNewUser" jdbcType="TINYINT" />
  13. <result column="app_type" property="appType" jdbcType="TINYINT" />
  14. <result column="banner_status" property="bannerStatus" jdbcType="TINYINT" />
  15. <result column="start_time" property="startTime" jdbcType="VARCHAR" />
  16. <result column="end_time" property="endTime" jdbcType="VARCHAR" />
  17. <result column="create_tiem" property="createTiem" jdbcType="TIMESTAMP" />
  18. <result column="view_type" property="viewType" jdbcType="TINYINT" />
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. banner_id, banner_name, banner_pic, skip_type, skip_uri, seq_no, os_type, is_new_user,
  22. app_type, banner_status, start_time, end_time, create_tiem, view_type
  23. </sql>
  24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  25. select
  26. <include refid="Base_Column_List" />
  27. from banner
  28. where banner_id = #{bannerId,jdbcType=INTEGER}
  29. </select>
  30. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
  31. insert into banner (banner_id, banner_name, banner_pic,
  32. skip_type, skip_uri, seq_no,
  33. os_type, is_new_user, app_type,
  34. banner_status, start_time, end_time,
  35. create_tiem, view_type)
  36. values (#{bannerId,jdbcType=INTEGER}, #{bannerName,jdbcType=VARCHAR}, #{bannerPic,jdbcType=VARCHAR},
  37. #{skipType,jdbcType=TINYINT}, #{skipUri,jdbcType=VARCHAR}, #{seqNo,jdbcType=INTEGER},
  38. #{osType,jdbcType=TINYINT}, #{isNewUser,jdbcType=TINYINT}, #{appType,jdbcType=TINYINT},
  39. #{bannerStatus,jdbcType=TINYINT}, #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR},
  40. #{createTiem,jdbcType=TIMESTAMP}, #{viewType,jdbcType=TINYINT})
  41. </insert>
  42. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
  43. insert into banner
  44. <trim prefix="(" suffix=")" suffixOverrides="," >
  45. <if test="bannerId != null" >
  46. banner_id,
  47. </if>
  48. <if test="bannerName != null" >
  49. banner_name,
  50. </if>
  51. <if test="bannerPic != null" >
  52. banner_pic,
  53. </if>
  54. <if test="skipType != null" >
  55. skip_type,
  56. </if>
  57. <if test="skipUri != null" >
  58. skip_uri,
  59. </if>
  60. <if test="seqNo != null" >
  61. seq_no,
  62. </if>
  63. <if test="osType != null" >
  64. os_type,
  65. </if>
  66. <if test="isNewUser != null" >
  67. is_new_user,
  68. </if>
  69. <if test="appType != null" >
  70. app_type,
  71. </if>
  72. <if test="bannerStatus != null" >
  73. banner_status,
  74. </if>
  75. <if test="startTime != null" >
  76. start_time,
  77. </if>
  78. <if test="endTime != null" >
  79. end_time,
  80. </if>
  81. <if test="createTiem != null" >
  82. create_tiem,
  83. </if>
  84. <if test="viewType != null" >
  85. view_type,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides="," >
  89. <if test="bannerId != null" >
  90. #{bannerId,jdbcType=INTEGER},
  91. </if>
  92. <if test="bannerName != null" >
  93. #{bannerName,jdbcType=VARCHAR},
  94. </if>
  95. <if test="bannerPic != null" >
  96. #{bannerPic,jdbcType=VARCHAR},
  97. </if>
  98. <if test="skipType != null" >
  99. #{skipType,jdbcType=TINYINT},
  100. </if>
  101. <if test="skipUri != null" >
  102. #{skipUri,jdbcType=VARCHAR},
  103. </if>
  104. <if test="seqNo != null" >
  105. #{seqNo,jdbcType=INTEGER},
  106. </if>
  107. <if test="osType != null" >
  108. #{osType,jdbcType=TINYINT},
  109. </if>
  110. <if test="isNewUser != null" >
  111. #{isNewUser,jdbcType=TINYINT},
  112. </if>
  113. <if test="appType != null" >
  114. #{appType,jdbcType=TINYINT},
  115. </if>
  116. <if test="bannerStatus != null" >
  117. #{bannerStatus,jdbcType=TINYINT},
  118. </if>
  119. <if test="startTime != null" >
  120. #{startTime,jdbcType=VARCHAR},
  121. </if>
  122. <if test="endTime != null" >
  123. #{endTime,jdbcType=VARCHAR},
  124. </if>
  125. <if test="createTiem != null" >
  126. #{createTiem,jdbcType=TIMESTAMP},
  127. </if>
  128. <if test="viewType != null" >
  129. #{viewType,jdbcType=TINYINT},
  130. </if>
  131. </trim>
  132. </insert>
  133. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
  134. update banner
  135. <set >
  136. <if test="bannerName != null" >
  137. banner_name = #{bannerName,jdbcType=VARCHAR},
  138. </if>
  139. <if test="bannerPic != null" >
  140. banner_pic = #{bannerPic,jdbcType=VARCHAR},
  141. </if>
  142. <if test="skipType != null" >
  143. skip_type = #{skipType,jdbcType=TINYINT},
  144. </if>
  145. <if test="skipUri != null" >
  146. skip_uri = #{skipUri,jdbcType=VARCHAR},
  147. </if>
  148. <if test="seqNo != null" >
  149. seq_no = #{seqNo,jdbcType=INTEGER},
  150. </if>
  151. <if test="osType != null" >
  152. os_type = #{osType,jdbcType=TINYINT},
  153. </if>
  154. <if test="isNewUser != null" >
  155. is_new_user = #{isNewUser,jdbcType=TINYINT},
  156. </if>
  157. <if test="appType != null" >
  158. app_type = #{appType,jdbcType=TINYINT},
  159. </if>
  160. <if test="bannerStatus != null" >
  161. banner_status = #{bannerStatus,jdbcType=TINYINT},
  162. </if>
  163. <if test="startTime != null" >
  164. start_time = #{startTime,jdbcType=VARCHAR},
  165. </if>
  166. <if test="endTime != null" >
  167. end_time = #{endTime,jdbcType=VARCHAR},
  168. </if>
  169. <if test="createTiem != null" >
  170. create_tiem = #{createTiem,jdbcType=TIMESTAMP},
  171. </if>
  172. <if test="viewType != null" >
  173. view_type = #{viewType,jdbcType=TINYINT},
  174. </if>
  175. </set>
  176. where banner_id = #{bannerId,jdbcType=INTEGER}
  177. </update>
  178. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
  179. update banner
  180. set banner_name = #{bannerName,jdbcType=VARCHAR},
  181. banner_pic = #{bannerPic,jdbcType=VARCHAR},
  182. skip_type = #{skipType,jdbcType=TINYINT},
  183. skip_uri = #{skipUri,jdbcType=VARCHAR},
  184. seq_no = #{seqNo,jdbcType=INTEGER},
  185. os_type = #{osType,jdbcType=TINYINT},
  186. is_new_user = #{isNewUser,jdbcType=TINYINT},
  187. app_type = #{appType,jdbcType=TINYINT},
  188. banner_status = #{bannerStatus,jdbcType=TINYINT},
  189. start_time = #{startTime,jdbcType=VARCHAR},
  190. end_time = #{endTime,jdbcType=VARCHAR},
  191. create_tiem = #{createTiem,jdbcType=TIMESTAMP},
  192. view_type = #{viewType,jdbcType=TINYINT}
  193. where banner_id = #{bannerId,jdbcType=INTEGER}
  194. </update>
  195. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  196. delete from banner
  197. where banner_id = #{bannerId,jdbcType=INTEGER}
  198. </delete>
  199. <select id="selectBannerByList" resultMap="BaseResultMap">
  200. select
  201. <include refid="Base_Column_List" />
  202. from banner
  203. where 1 = 1
  204. <if test="skipType">
  205. and skip_type = #{skipType}
  206. </if>
  207. <if test="bannerStatus">
  208. and banner_status = #{bannerStatus}
  209. </if>
  210. <if test="viewType">
  211. and view_type = #{viewType}
  212. </if>
  213. order by start_time desc
  214. </select>
  215. </mapper>