ActivityMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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.goafanti.common.dao.ActivityMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.Activity" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
  7. <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
  8. <result column="name" property="name" jdbcType="VARCHAR" />
  9. <result column="status" property="status" jdbcType="INTEGER" />
  10. <result column="address" property="address" jdbcType="VARCHAR" />
  11. <result column="host" property="host" jdbcType="VARCHAR" />
  12. <result column="undertake" property="undertake" jdbcType="VARCHAR" />
  13. <result column="asist" property="asist" jdbcType="VARCHAR" />
  14. <result column="type" property="type" jdbcType="INTEGER" />
  15. <result column="form" property="form" jdbcType="INTEGER" />
  16. <result column="img_urls" property="imgUrls" jdbcType="VARCHAR" />
  17. <result column="result" property="result" jdbcType="VARCHAR" />
  18. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  19. <result column="enroll_deadline" property="enrollDeadline" jdbcType="TIMESTAMP" />
  20. <result column="title_url" property="titleUrl" jdbcType="VARCHAR" />
  21. </resultMap>
  22. <resultMap id="ResultMapWithBLOBs" type="com.goafanti.common.model.Activity" extends="BaseResultMap" >
  23. <result column="desc" property="desc" jdbcType="LONGVARCHAR" />
  24. </resultMap>
  25. <sql id="Base_Column_List" >
  26. id, start_time, end_time, name, status, address, host, undertake, asist, type, form,
  27. img_urls, result, create_time, enroll_deadline, title_url
  28. </sql>
  29. <sql id="Blob_Column_List" >
  30. desc
  31. </sql>
  32. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
  33. select
  34. <include refid="Base_Column_List" />
  35. ,
  36. <include refid="Blob_Column_List" />
  37. from activity
  38. where id = #{id,jdbcType=BIGINT}
  39. </select>
  40. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  41. delete from activity
  42. where id = #{id,jdbcType=BIGINT}
  43. </delete>
  44. <insert id="insert" parameterType="com.goafanti.common.model.Activity" >
  45. insert into activity (id, start_time, end_time,
  46. name, status, address,
  47. host, undertake, asist,
  48. type, form, img_urls,
  49. result, create_time, enroll_deadline,
  50. title_url, desc)
  51. values (#{id,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
  52. #{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR},
  53. #{host,jdbcType=VARCHAR}, #{undertake,jdbcType=VARCHAR}, #{asist,jdbcType=VARCHAR},
  54. #{type,jdbcType=INTEGER}, #{form,jdbcType=INTEGER}, #{imgUrls,jdbcType=VARCHAR},
  55. #{result,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{enrollDeadline,jdbcType=TIMESTAMP},
  56. #{titleUrl,jdbcType=VARCHAR}, #{desc,jdbcType=LONGVARCHAR})
  57. </insert>
  58. <insert id="insertSelective" parameterType="com.goafanti.common.model.Activity" >
  59. insert into activity
  60. <trim prefix="(" suffix=")" suffixOverrides="," >
  61. <if test="id != null" >
  62. id,
  63. </if>
  64. <if test="startTime != null" >
  65. start_time,
  66. </if>
  67. <if test="endTime != null" >
  68. end_time,
  69. </if>
  70. <if test="name != null" >
  71. name,
  72. </if>
  73. <if test="status != null" >
  74. status,
  75. </if>
  76. <if test="address != null" >
  77. address,
  78. </if>
  79. <if test="host != null" >
  80. host,
  81. </if>
  82. <if test="undertake != null" >
  83. undertake,
  84. </if>
  85. <if test="asist != null" >
  86. asist,
  87. </if>
  88. <if test="type != null" >
  89. type,
  90. </if>
  91. <if test="form != null" >
  92. form,
  93. </if>
  94. <if test="imgUrls != null" >
  95. img_urls,
  96. </if>
  97. <if test="result != null" >
  98. result,
  99. </if>
  100. <if test="createTime != null" >
  101. create_time,
  102. </if>
  103. <if test="enrollDeadline != null" >
  104. enroll_deadline,
  105. </if>
  106. <if test="titleUrl != null" >
  107. title_url,
  108. </if>
  109. <if test="desc != null" >
  110. desc,
  111. </if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides="," >
  114. <if test="id != null" >
  115. #{id,jdbcType=BIGINT},
  116. </if>
  117. <if test="startTime != null" >
  118. #{startTime,jdbcType=TIMESTAMP},
  119. </if>
  120. <if test="endTime != null" >
  121. #{endTime,jdbcType=TIMESTAMP},
  122. </if>
  123. <if test="name != null" >
  124. #{name,jdbcType=VARCHAR},
  125. </if>
  126. <if test="status != null" >
  127. #{status,jdbcType=INTEGER},
  128. </if>
  129. <if test="address != null" >
  130. #{address,jdbcType=VARCHAR},
  131. </if>
  132. <if test="host != null" >
  133. #{host,jdbcType=VARCHAR},
  134. </if>
  135. <if test="undertake != null" >
  136. #{undertake,jdbcType=VARCHAR},
  137. </if>
  138. <if test="asist != null" >
  139. #{asist,jdbcType=VARCHAR},
  140. </if>
  141. <if test="type != null" >
  142. #{type,jdbcType=INTEGER},
  143. </if>
  144. <if test="form != null" >
  145. #{form,jdbcType=INTEGER},
  146. </if>
  147. <if test="imgUrls != null" >
  148. #{imgUrls,jdbcType=VARCHAR},
  149. </if>
  150. <if test="result != null" >
  151. #{result,jdbcType=VARCHAR},
  152. </if>
  153. <if test="createTime != null" >
  154. #{createTime,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="enrollDeadline != null" >
  157. #{enrollDeadline,jdbcType=TIMESTAMP},
  158. </if>
  159. <if test="titleUrl != null" >
  160. #{titleUrl,jdbcType=VARCHAR},
  161. </if>
  162. <if test="desc != null" >
  163. #{desc,jdbcType=LONGVARCHAR},
  164. </if>
  165. </trim>
  166. </insert>
  167. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Activity" >
  168. update activity
  169. <set >
  170. <if test="startTime != null" >
  171. start_time = #{startTime,jdbcType=TIMESTAMP},
  172. </if>
  173. <if test="endTime != null" >
  174. end_time = #{endTime,jdbcType=TIMESTAMP},
  175. </if>
  176. <if test="name != null" >
  177. name = #{name,jdbcType=VARCHAR},
  178. </if>
  179. <if test="status != null" >
  180. status = #{status,jdbcType=INTEGER},
  181. </if>
  182. <if test="address != null" >
  183. address = #{address,jdbcType=VARCHAR},
  184. </if>
  185. <if test="host != null" >
  186. host = #{host,jdbcType=VARCHAR},
  187. </if>
  188. <if test="undertake != null" >
  189. undertake = #{undertake,jdbcType=VARCHAR},
  190. </if>
  191. <if test="asist != null" >
  192. asist = #{asist,jdbcType=VARCHAR},
  193. </if>
  194. <if test="type != null" >
  195. type = #{type,jdbcType=INTEGER},
  196. </if>
  197. <if test="form != null" >
  198. form = #{form,jdbcType=INTEGER},
  199. </if>
  200. <if test="imgUrls != null" >
  201. img_urls = #{imgUrls,jdbcType=VARCHAR},
  202. </if>
  203. <if test="result != null" >
  204. result = #{result,jdbcType=VARCHAR},
  205. </if>
  206. <if test="createTime != null" >
  207. create_time = #{createTime,jdbcType=TIMESTAMP},
  208. </if>
  209. <if test="enrollDeadline != null" >
  210. enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="titleUrl != null" >
  213. title_url = #{titleUrl,jdbcType=VARCHAR},
  214. </if>
  215. <if test="desc != null" >
  216. desc = #{desc,jdbcType=LONGVARCHAR},
  217. </if>
  218. </set>
  219. where id = #{id,jdbcType=BIGINT}
  220. </update>
  221. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.Activity" >
  222. update activity
  223. set start_time = #{startTime,jdbcType=TIMESTAMP},
  224. end_time = #{endTime,jdbcType=TIMESTAMP},
  225. name = #{name,jdbcType=VARCHAR},
  226. status = #{status,jdbcType=INTEGER},
  227. address = #{address,jdbcType=VARCHAR},
  228. host = #{host,jdbcType=VARCHAR},
  229. undertake = #{undertake,jdbcType=VARCHAR},
  230. asist = #{asist,jdbcType=VARCHAR},
  231. type = #{type,jdbcType=INTEGER},
  232. form = #{form,jdbcType=INTEGER},
  233. img_urls = #{imgUrls,jdbcType=VARCHAR},
  234. result = #{result,jdbcType=VARCHAR},
  235. create_time = #{createTime,jdbcType=TIMESTAMP},
  236. enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
  237. title_url = #{titleUrl,jdbcType=VARCHAR},
  238. desc = #{desc,jdbcType=LONGVARCHAR}
  239. where id = #{id,jdbcType=BIGINT}
  240. </update>
  241. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Activity" >
  242. update activity
  243. set start_time = #{startTime,jdbcType=TIMESTAMP},
  244. end_time = #{endTime,jdbcType=TIMESTAMP},
  245. name = #{name,jdbcType=VARCHAR},
  246. status = #{status,jdbcType=INTEGER},
  247. address = #{address,jdbcType=VARCHAR},
  248. host = #{host,jdbcType=VARCHAR},
  249. undertake = #{undertake,jdbcType=VARCHAR},
  250. asist = #{asist,jdbcType=VARCHAR},
  251. type = #{type,jdbcType=INTEGER},
  252. form = #{form,jdbcType=INTEGER},
  253. img_urls = #{imgUrls,jdbcType=VARCHAR},
  254. result = #{result,jdbcType=VARCHAR},
  255. create_time = #{createTime,jdbcType=TIMESTAMP},
  256. enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
  257. title_url = #{titleUrl,jdbcType=VARCHAR}
  258. where id = #{id,jdbcType=BIGINT}
  259. </update>
  260. </mapper>