MsgPushRecordMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.messgae.MsgPushRecordMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.message.MsgPushRecord" >
  7. <id column="record_id" property="recordId" jdbcType="INTEGER" />
  8. <result column="from_accid" property="fromAccid" jdbcType="BIGINT" />
  9. <result column="to_obj_type" property="toObjType" jdbcType="TINYINT" />
  10. <result column="msg_type" property="msgType" jdbcType="TINYINT" />
  11. <result column="to_accids" property="toAccids" jdbcType="VARCHAR" />
  12. <result column="to_erban_nos" property="toErbanNos" jdbcType="VARCHAR" />
  13. <result column="title" property="title" jdbcType="VARCHAR" />
  14. <result column="web_url" property="webUrl" jdbcType="VARCHAR" />
  15. <result column="pic_url" property="picUrl" jdbcType="VARCHAR" />
  16. <result column="skip_type" property="skipType" jdbcType="TINYINT" />
  17. <result column="skip_uri" property="skipUri" jdbcType="VARCHAR" />
  18. <result column="msg_desc" property="msgDesc" jdbcType="VARCHAR" />
  19. <result column="admin_id" property="adminId" jdbcType="VARCHAR" />
  20. <result column="crate_time" property="crateTime" jdbcType="TIMESTAMP" />
  21. <result column="msg_id" property="msgId" jdbcType="VARCHAR" />
  22. <result column="status" property="status" jdbcType="TINYINT" />
  23. </resultMap>
  24. <resultMap id="MessageInfoDTOMap" type="com.juxiao.xchat.module.xbd.dto.MessageInfoDTO" >
  25. <id column="record_id" property="recordId" jdbcType="INTEGER" />
  26. <result column="from_accid" property="fromAccid" jdbcType="BIGINT" />
  27. <result column="to_obj_type" property="toObjType" jdbcType="TINYINT" />
  28. <result column="msg_type" property="msgType" jdbcType="TINYINT" />
  29. <result column="to_accids" property="toAccids" jdbcType="VARCHAR" />
  30. <result column="to_erban_nos" property="toErbanNos" jdbcType="VARCHAR" />
  31. <result column="title" property="title" jdbcType="VARCHAR" />
  32. <result column="web_url" property="webUrl" jdbcType="VARCHAR" />
  33. <result column="pic_url" property="picUrl" jdbcType="VARCHAR" />
  34. <result column="skip_type" property="skipType" jdbcType="TINYINT" />
  35. <result column="skip_uri" property="skipUri" jdbcType="VARCHAR" />
  36. <result column="msg_desc" property="msgDesc" jdbcType="VARCHAR" />
  37. <result column="admin_id" property="adminId" jdbcType="VARCHAR" />
  38. <result column="crate_time" property="crateTime" jdbcType="TIMESTAMP" />
  39. <result column="msg_id" property="msgId" jdbcType="VARCHAR" />
  40. <result column="status" property="status" jdbcType="TINYINT" />
  41. </resultMap>
  42. <sql id="Base_Column_List" >
  43. record_id, from_accid, to_obj_type, msg_type, to_accids, to_erban_nos, title, web_url,
  44. pic_url, skip_type, skip_uri, msg_desc, admin_id, crate_time,msg_id,status
  45. </sql>
  46. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from msg_push_record
  50. where record_id = #{recordId,jdbcType=INTEGER}
  51. </select>
  52. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.message.MsgPushRecord" >
  53. <selectKey resultType="java.lang.Integer" keyProperty="recordId" order="AFTER" >
  54. SELECT LAST_INSERT_ID()
  55. </selectKey>
  56. insert into msg_push_record (from_accid, to_obj_type, msg_type,
  57. to_accids, to_erban_nos, title,
  58. web_url, pic_url, skip_type,
  59. skip_uri, msg_desc, admin_id,
  60. crate_time,msg_id,status)
  61. values (#{fromAccid,jdbcType=BIGINT}, #{toObjType,jdbcType=TINYINT}, #{msgType,jdbcType=TINYINT},
  62. #{toAccids,jdbcType=VARCHAR}, #{toErbanNos,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
  63. #{webUrl,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{skipType,jdbcType=TINYINT},
  64. #{skipUri,jdbcType=VARCHAR}, #{msgDesc,jdbcType=VARCHAR}, #{adminId,jdbcType=VARCHAR},
  65. #{crateTime,jdbcType=TIMESTAMP},#{msgId,jdbcType=VARCHAR},#{status,jdbcType=TINYINT})
  66. </insert>
  67. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.message.MsgPushRecord" >
  68. <selectKey resultType="java.lang.Integer" keyProperty="recordId" order="AFTER" >
  69. SELECT LAST_INSERT_ID()
  70. </selectKey>
  71. insert into msg_push_record
  72. <trim prefix="(" suffix=")" suffixOverrides="," >
  73. <if test="fromAccid != null" >
  74. from_accid,
  75. </if>
  76. <if test="toObjType != null" >
  77. to_obj_type,
  78. </if>
  79. <if test="msgType != null" >
  80. msg_type,
  81. </if>
  82. <if test="toAccids != null" >
  83. to_accids,
  84. </if>
  85. <if test="toErbanNos != null" >
  86. to_erban_nos,
  87. </if>
  88. <if test="title != null" >
  89. title,
  90. </if>
  91. <if test="webUrl != null" >
  92. web_url,
  93. </if>
  94. <if test="picUrl != null" >
  95. pic_url,
  96. </if>
  97. <if test="skipType != null" >
  98. skip_type,
  99. </if>
  100. <if test="skipUri != null" >
  101. skip_uri,
  102. </if>
  103. <if test="msgDesc != null" >
  104. msg_desc,
  105. </if>
  106. <if test="adminId != null" >
  107. admin_id,
  108. </if>
  109. <if test="crateTime != null" >
  110. crate_time,
  111. </if>
  112. <if test="status != null" >
  113. status,
  114. </if>
  115. <if test="msgId != null" >
  116. msg_id,
  117. </if>
  118. </trim>
  119. <trim prefix="values (" suffix=")" suffixOverrides="," >
  120. <if test="fromAccid != null" >
  121. #{fromAccid,jdbcType=BIGINT},
  122. </if>
  123. <if test="toObjType != null" >
  124. #{toObjType,jdbcType=TINYINT},
  125. </if>
  126. <if test="msgType != null" >
  127. #{msgType,jdbcType=TINYINT},
  128. </if>
  129. <if test="toAccids != null" >
  130. #{toAccids,jdbcType=VARCHAR},
  131. </if>
  132. <if test="toErbanNos != null" >
  133. #{toErbanNos,jdbcType=VARCHAR},
  134. </if>
  135. <if test="title != null" >
  136. #{title,jdbcType=VARCHAR},
  137. </if>
  138. <if test="webUrl != null" >
  139. #{webUrl,jdbcType=VARCHAR},
  140. </if>
  141. <if test="picUrl != null" >
  142. #{picUrl,jdbcType=VARCHAR},
  143. </if>
  144. <if test="skipType != null" >
  145. #{skipType,jdbcType=TINYINT},
  146. </if>
  147. <if test="skipUri != null" >
  148. #{skipUri,jdbcType=VARCHAR},
  149. </if>
  150. <if test="msgDesc != null" >
  151. #{msgDesc,jdbcType=VARCHAR},
  152. </if>
  153. <if test="adminId != null" >
  154. #{adminId,jdbcType=VARCHAR},
  155. </if>
  156. <if test="crateTime != null" >
  157. #{crateTime,jdbcType=TIMESTAMP},
  158. </if>
  159. <if test="status != null" >
  160. #{status,jdbcType=VARCHAR},
  161. </if>
  162. <if test="msgId != null" >
  163. #{msgId,jdbcType=TINYINT},
  164. </if>
  165. </trim>
  166. </insert>
  167. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.message.MsgPushRecord" >
  168. update msg_push_record
  169. <set >
  170. <if test="fromAccid != null" >
  171. from_accid = #{fromAccid,jdbcType=BIGINT},
  172. </if>
  173. <if test="toObjType != null" >
  174. to_obj_type = #{toObjType,jdbcType=TINYINT},
  175. </if>
  176. <if test="msgType != null" >
  177. msg_type = #{msgType,jdbcType=TINYINT},
  178. </if>
  179. <if test="toAccids != null" >
  180. to_accids = #{toAccids,jdbcType=VARCHAR},
  181. </if>
  182. <if test="toErbanNos != null" >
  183. to_erban_nos = #{toErbanNos,jdbcType=VARCHAR},
  184. </if>
  185. <if test="title != null" >
  186. title = #{title,jdbcType=VARCHAR},
  187. </if>
  188. <if test="webUrl != null" >
  189. web_url = #{webUrl,jdbcType=VARCHAR},
  190. </if>
  191. <if test="picUrl != null" >
  192. pic_url = #{picUrl,jdbcType=VARCHAR},
  193. </if>
  194. <if test="skipType != null" >
  195. skip_type = #{skipType,jdbcType=TINYINT},
  196. </if>
  197. <if test="skipUri != null" >
  198. skip_uri = #{skipUri,jdbcType=VARCHAR},
  199. </if>
  200. <if test="msgDesc != null" >
  201. msg_desc = #{msgDesc,jdbcType=VARCHAR},
  202. </if>
  203. <if test="adminId != null" >
  204. admin_id = #{adminId,jdbcType=VARCHAR},
  205. </if>
  206. <if test="crateTime != null" >
  207. crate_time = #{crateTime,jdbcType=TIMESTAMP},
  208. </if>
  209. <if test="msgId != null" >
  210. msg_id = #{msgId,jdbcType=VARCHAR},
  211. </if>
  212. <if test="status != null" >
  213. status = #{status,jdbcType=TINYINT},
  214. </if>
  215. </set>
  216. where record_id = #{recordId,jdbcType=INTEGER}
  217. </update>
  218. <select id="selectMessageInfoList" resultMap="MessageInfoDTOMap">
  219. select
  220. <include refid="Base_Column_List" />
  221. from msg_push_record
  222. where 1 = 1
  223. <if test="erBanNo != null">
  224. and to_erban_nos = #{erBanNo}
  225. </if>
  226. <if test="messageType != null">
  227. and msg_type = #{messageType}
  228. </if>
  229. order by crate_time desc
  230. </select>
  231. </mapper>