JtMessageProducerMapper.xml 18 KB

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