JtMessageProducerMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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.JtMessageProducerMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtMessageProducer">
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  9. -->
  10. <id column="id" jdbcType="VARCHAR" property="id" />
  11. <result column="creater" jdbcType="VARCHAR" property="creater" />
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
  14. <result column="title" jdbcType="VARCHAR" property="title" />
  15. <result column="body" jdbcType="VARCHAR" property="body" />
  16. <result column="subject" jdbcType="INTEGER" property="subject" />
  17. <result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
  18. <result column="resource_type" jdbcType="INTEGER" property="resourceType" />
  19. <result column="is_draft" jdbcType="BIT" property="isDraft" />
  20. <result column="is_send" jdbcType="BIT" property="isSend" />
  21. <result column="delete_sign" jdbcType="BIT" property="deleteSign" />
  22. </resultMap>
  23. <sql id="Example_Where_Clause">
  24. <!--
  25. WARNING - @mbggenerated
  26. This element is automatically generated by MyBatis Generator, do not modify.
  27. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  28. -->
  29. <where>
  30. <foreach collection="oredCriteria" item="criteria" separator="or">
  31. <if test="criteria.valid">
  32. <trim prefix="(" prefixOverrides="and" suffix=")">
  33. <foreach collection="criteria.criteria" item="criterion">
  34. <choose>
  35. <when test="criterion.noValue">
  36. and ${criterion.condition}
  37. </when>
  38. <when test="criterion.singleValue">
  39. and ${criterion.condition} #{criterion.value}
  40. </when>
  41. <when test="criterion.betweenValue">
  42. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  43. </when>
  44. <when test="criterion.listValue">
  45. and ${criterion.condition}
  46. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  47. #{listItem}
  48. </foreach>
  49. </when>
  50. </choose>
  51. </foreach>
  52. </trim>
  53. </if>
  54. </foreach>
  55. </where>
  56. </sql>
  57. <sql id="Update_By_Example_Where_Clause">
  58. <!--
  59. WARNING - @mbggenerated
  60. This element is automatically generated by MyBatis Generator, do not modify.
  61. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  62. -->
  63. <where>
  64. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  65. <if test="criteria.valid">
  66. <trim prefix="(" prefixOverrides="and" suffix=")">
  67. <foreach collection="criteria.criteria" item="criterion">
  68. <choose>
  69. <when test="criterion.noValue">
  70. and ${criterion.condition}
  71. </when>
  72. <when test="criterion.singleValue">
  73. and ${criterion.condition} #{criterion.value}
  74. </when>
  75. <when test="criterion.betweenValue">
  76. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  77. </when>
  78. <when test="criterion.listValue">
  79. and ${criterion.condition}
  80. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  81. #{listItem}
  82. </foreach>
  83. </when>
  84. </choose>
  85. </foreach>
  86. </trim>
  87. </if>
  88. </foreach>
  89. </where>
  90. </sql>
  91. <sql id="Base_Column_List">
  92. <!--
  93. WARNING - @mbggenerated
  94. This element is automatically generated by MyBatis Generator, do not modify.
  95. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  96. -->
  97. id, creater, create_time, send_time, title, body, subject, resource_id, resource_type,
  98. is_draft, is_send, delete_sign
  99. </sql>
  100. <select id="selectByExample" parameterType="com.goafanti.common.model.JtMessageProducerExample" resultMap="BaseResultMap">
  101. <!--
  102. WARNING - @mbggenerated
  103. This element is automatically generated by MyBatis Generator, do not modify.
  104. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  105. -->
  106. select
  107. <if test="distinct">
  108. distinct
  109. </if>
  110. <include refid="Base_Column_List" />
  111. from jt_message_producer
  112. <if test="_parameter != null">
  113. <include refid="Example_Where_Clause" />
  114. </if>
  115. <if test="orderByClause != null">
  116. order by ${orderByClause}
  117. </if>
  118. </select>
  119. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  120. <!--
  121. WARNING - @mbggenerated
  122. This element is automatically generated by MyBatis Generator, do not modify.
  123. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  124. -->
  125. select
  126. <include refid="Base_Column_List" />
  127. from jt_message_producer
  128. where id = #{id,jdbcType=VARCHAR}
  129. </select>
  130. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  131. <!--
  132. WARNING - @mbggenerated
  133. This element is automatically generated by MyBatis Generator, do not modify.
  134. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  135. -->
  136. delete from jt_message_producer
  137. where id = #{id,jdbcType=VARCHAR}
  138. </delete>
  139. <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtMessageProducerExample">
  140. <!--
  141. WARNING - @mbggenerated
  142. This element is automatically generated by MyBatis Generator, do not modify.
  143. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  144. -->
  145. delete from jt_message_producer
  146. <if test="_parameter != null">
  147. <include refid="Example_Where_Clause" />
  148. </if>
  149. </delete>
  150. <insert id="insert" parameterType="com.goafanti.common.model.JtMessageProducer">
  151. <!--
  152. WARNING - @mbggenerated
  153. This element is automatically generated by MyBatis Generator, do not modify.
  154. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  155. -->
  156. insert into jt_message_producer (id, creater, create_time,
  157. send_time, title, body,
  158. subject, resource_id, resource_type,
  159. is_draft, is_send, delete_sign)
  160. values (#{id,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  161. #{sendTime,jdbcType=TIMESTAMP}, #{title,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR},
  162. #{subject,jdbcType=INTEGER}, #{resourceId,jdbcType=VARCHAR}, #{resourceType,jdbcType=INTEGER},
  163. #{isDraft,jdbcType=BIT}, #{isSend,jdbcType=BIT}, #{deleteSign,jdbcType=BIT})
  164. </insert>
  165. <insert id="insertSelective" parameterType="com.goafanti.common.model.JtMessageProducer">
  166. <!--
  167. WARNING - @mbggenerated
  168. This element is automatically generated by MyBatis Generator, do not modify.
  169. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  170. -->
  171. insert into jt_message_producer
  172. <trim prefix="(" suffix=")" suffixOverrides=",">
  173. <if test="id != null">
  174. id,
  175. </if>
  176. <if test="creater != null">
  177. creater,
  178. </if>
  179. <if test="createTime != null">
  180. create_time,
  181. </if>
  182. <if test="sendTime != null">
  183. send_time,
  184. </if>
  185. <if test="title != null">
  186. title,
  187. </if>
  188. <if test="body != null">
  189. body,
  190. </if>
  191. <if test="subject != null">
  192. subject,
  193. </if>
  194. <if test="resourceId != null">
  195. resource_id,
  196. </if>
  197. <if test="resourceType != null">
  198. resource_type,
  199. </if>
  200. <if test="isDraft != null">
  201. is_draft,
  202. </if>
  203. <if test="isSend != null">
  204. is_send,
  205. </if>
  206. <if test="deleteSign != null">
  207. delete_sign,
  208. </if>
  209. </trim>
  210. <trim prefix="values (" suffix=")" suffixOverrides=",">
  211. <if test="id != null">
  212. #{id,jdbcType=VARCHAR},
  213. </if>
  214. <if test="creater != null">
  215. #{creater,jdbcType=VARCHAR},
  216. </if>
  217. <if test="createTime != null">
  218. #{createTime,jdbcType=TIMESTAMP},
  219. </if>
  220. <if test="sendTime != null">
  221. #{sendTime,jdbcType=TIMESTAMP},
  222. </if>
  223. <if test="title != null">
  224. #{title,jdbcType=VARCHAR},
  225. </if>
  226. <if test="body != null">
  227. #{body,jdbcType=VARCHAR},
  228. </if>
  229. <if test="subject != null">
  230. #{subject,jdbcType=INTEGER},
  231. </if>
  232. <if test="resourceId != null">
  233. #{resourceId,jdbcType=VARCHAR},
  234. </if>
  235. <if test="resourceType != null">
  236. #{resourceType,jdbcType=INTEGER},
  237. </if>
  238. <if test="isDraft != null">
  239. #{isDraft,jdbcType=BIT},
  240. </if>
  241. <if test="isSend != null">
  242. #{isSend,jdbcType=BIT},
  243. </if>
  244. <if test="deleteSign != null">
  245. #{deleteSign,jdbcType=BIT},
  246. </if>
  247. </trim>
  248. </insert>
  249. <select id="countByExample" parameterType="com.goafanti.common.model.JtMessageProducerExample" resultType="java.lang.Integer">
  250. <!--
  251. WARNING - @mbggenerated
  252. This element is automatically generated by MyBatis Generator, do not modify.
  253. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  254. -->
  255. select count(*) from jt_message_producer
  256. <if test="_parameter != null">
  257. <include refid="Example_Where_Clause" />
  258. </if>
  259. </select>
  260. <update id="updateByExampleSelective" parameterType="map">
  261. <!--
  262. WARNING - @mbggenerated
  263. This element is automatically generated by MyBatis Generator, do not modify.
  264. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  265. -->
  266. update jt_message_producer
  267. <set>
  268. <if test="record.id != null">
  269. id = #{record.id,jdbcType=VARCHAR},
  270. </if>
  271. <if test="record.creater != null">
  272. creater = #{record.creater,jdbcType=VARCHAR},
  273. </if>
  274. <if test="record.createTime != null">
  275. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  276. </if>
  277. <if test="record.sendTime != null">
  278. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  279. </if>
  280. <if test="record.title != null">
  281. title = #{record.title,jdbcType=VARCHAR},
  282. </if>
  283. <if test="record.body != null">
  284. body = #{record.body,jdbcType=VARCHAR},
  285. </if>
  286. <if test="record.subject != null">
  287. subject = #{record.subject,jdbcType=INTEGER},
  288. </if>
  289. <if test="record.resourceId != null">
  290. resource_id = #{record.resourceId,jdbcType=VARCHAR},
  291. </if>
  292. <if test="record.resourceType != null">
  293. resource_type = #{record.resourceType,jdbcType=INTEGER},
  294. </if>
  295. <if test="record.isDraft != null">
  296. is_draft = #{record.isDraft,jdbcType=BIT},
  297. </if>
  298. <if test="record.isSend != null">
  299. is_send = #{record.isSend,jdbcType=BIT},
  300. </if>
  301. <if test="record.deleteSign != null">
  302. delete_sign = #{record.deleteSign,jdbcType=BIT},
  303. </if>
  304. </set>
  305. <if test="_parameter != null">
  306. <include refid="Update_By_Example_Where_Clause" />
  307. </if>
  308. </update>
  309. <update id="updateByExample" parameterType="map">
  310. <!--
  311. WARNING - @mbggenerated
  312. This element is automatically generated by MyBatis Generator, do not modify.
  313. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  314. -->
  315. update jt_message_producer
  316. set id = #{record.id,jdbcType=VARCHAR},
  317. creater = #{record.creater,jdbcType=VARCHAR},
  318. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  319. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  320. title = #{record.title,jdbcType=VARCHAR},
  321. body = #{record.body,jdbcType=VARCHAR},
  322. subject = #{record.subject,jdbcType=INTEGER},
  323. resource_id = #{record.resourceId,jdbcType=VARCHAR},
  324. resource_type = #{record.resourceType,jdbcType=INTEGER},
  325. is_draft = #{record.isDraft,jdbcType=BIT},
  326. is_send = #{record.isSend,jdbcType=BIT},
  327. delete_sign = #{record.deleteSign,jdbcType=BIT}
  328. <if test="_parameter != null">
  329. <include refid="Update_By_Example_Where_Clause" />
  330. </if>
  331. </update>
  332. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtMessageProducer">
  333. <!--
  334. WARNING - @mbggenerated
  335. This element is automatically generated by MyBatis Generator, do not modify.
  336. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  337. -->
  338. update jt_message_producer
  339. <set>
  340. <if test="creater != null">
  341. creater = #{creater,jdbcType=VARCHAR},
  342. </if>
  343. <if test="createTime != null">
  344. create_time = #{createTime,jdbcType=TIMESTAMP},
  345. </if>
  346. <if test="sendTime != null">
  347. send_time = #{sendTime,jdbcType=TIMESTAMP},
  348. </if>
  349. <if test="title != null">
  350. title = #{title,jdbcType=VARCHAR},
  351. </if>
  352. <if test="body != null">
  353. body = #{body,jdbcType=VARCHAR},
  354. </if>
  355. <if test="subject != null">
  356. subject = #{subject,jdbcType=INTEGER},
  357. </if>
  358. <if test="resourceId != null">
  359. resource_id = #{resourceId,jdbcType=VARCHAR},
  360. </if>
  361. <if test="resourceType != null">
  362. resource_type = #{resourceType,jdbcType=INTEGER},
  363. </if>
  364. <if test="isDraft != null">
  365. is_draft = #{isDraft,jdbcType=BIT},
  366. </if>
  367. <if test="isSend != null">
  368. is_send = #{isSend,jdbcType=BIT},
  369. </if>
  370. <if test="deleteSign != null">
  371. delete_sign = #{deleteSign,jdbcType=BIT},
  372. </if>
  373. </set>
  374. where id = #{id,jdbcType=VARCHAR}
  375. </update>
  376. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtMessageProducer">
  377. <!--
  378. WARNING - @mbggenerated
  379. This element is automatically generated by MyBatis Generator, do not modify.
  380. This element was generated on Wed Aug 29 09:46:33 CST 2018.
  381. -->
  382. update jt_message_producer
  383. set creater = #{creater,jdbcType=VARCHAR},
  384. create_time = #{createTime,jdbcType=TIMESTAMP},
  385. send_time = #{sendTime,jdbcType=TIMESTAMP},
  386. title = #{title,jdbcType=VARCHAR},
  387. body = #{body,jdbcType=VARCHAR},
  388. subject = #{subject,jdbcType=INTEGER},
  389. resource_id = #{resourceId,jdbcType=VARCHAR},
  390. resource_type = #{resourceType,jdbcType=INTEGER},
  391. is_draft = #{isDraft,jdbcType=BIT},
  392. is_send = #{isSend,jdbcType=BIT},
  393. delete_sign = #{deleteSign,jdbcType=BIT}
  394. where id = #{id,jdbcType=VARCHAR}
  395. </update>
  396. <!-- 获得自己发送的消息列表数据 -->
  397. <select id="getMyMessageList" parameterType="java.lang.String" resultType="com.goafanti.common.model.JtMessageProducer">
  398. select
  399. id, creater, create_time as createTime, send_time as sendTime, title, body, subject,
  400. resource_id as resourceId, resource_type as resourceType,
  401. is_draft as isDraft, is_send as isSend, delete_sign as deleteSign
  402. from jt_message_producer
  403. where delete_sign = 0
  404. <if test="title != null">
  405. <bind name="t" value="'%' + title + '%' "/>
  406. and title like #{t,jdbcType=VARCHAR}
  407. </if>
  408. <if test="isDraft != null">
  409. and is_draft = #{isDraft,jdbcType=BIT}
  410. </if>
  411. <if test="isSend != null">
  412. and is_send = #{isSend,jdbcType=BIT}
  413. </if>
  414. <if test="deleteSign != null">
  415. and delete_sign = #{deleteSign,jdbcType=BIT}
  416. </if>
  417. <if test="creater != null">
  418. and creater = #{creater,jdbcType=VARCHAR}
  419. </if>
  420. <if test="sendStartTime != null and sendEndTime != null">
  421. and send_time between #{sendStartTime,jdbcType=VARCHAR} and #{sendEndTime,jdbcType=VARCHAR}
  422. </if>
  423. order by create_time desc
  424. <if test="page_sql!=null">
  425. ${page_sql}
  426. </if>
  427. </select>
  428. <select id="getMyMessageCount" parameterType="java.lang.String" resultType="java.lang.Integer">
  429. select
  430. count(0)
  431. from jt_message_producer
  432. where delete_sign = 0
  433. <if test="title != null">
  434. <bind name="t" value="'%' + title + '%' "/>
  435. and title like #{t,jdbcType=VARCHAR}
  436. </if>
  437. <if test="isDraft != null">
  438. and is_draft = #{isDraft,jdbcType=BIT}
  439. </if>
  440. <if test="isSend != null">
  441. and is_send = #{isSend,jdbcType=BIT}
  442. </if>
  443. <if test="creater != null">
  444. and creater = #{creater,jdbcType=VARCHAR}
  445. </if>
  446. <if test="sendStartTime != null and sendEndTime != null">
  447. and send_time between #{sendStartTime,jdbcType=VARCHAR} and #{sendEndTime,jdbcType=VARCHAR}
  448. </if>
  449. </select>
  450. </mapper>