MessageMapper.xml 14 KB

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