HistoryMessageMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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.tzld.piaoquan.wecom.dao.mapper.HistoryMessageMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="corp_id" jdbcType="BIGINT" property="corpId" />
  7. <result column="user_id" jdbcType="BIGINT" property="userId" />
  8. <result column="staff_id" jdbcType="BIGINT" property="staffId" />
  9. <result column="video_id" jdbcType="BIGINT" property="videoId" />
  10. <result column="attachment_idx" jdbcType="INTEGER" property="attachmentIdx" />
  11. <result column="message_id" jdbcType="BIGINT" property="messageId" />
  12. <result column="status" jdbcType="INTEGER" property="status" />
  13. <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
  14. <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. </resultMap>
  17. <sql id="Example_Where_Clause">
  18. <where>
  19. <foreach collection="oredCriteria" item="criteria" separator="or">
  20. <if test="criteria.valid">
  21. <trim prefix="(" prefixOverrides="and" suffix=")">
  22. <foreach collection="criteria.criteria" item="criterion">
  23. <choose>
  24. <when test="criterion.noValue">
  25. and ${criterion.condition}
  26. </when>
  27. <when test="criterion.singleValue">
  28. and ${criterion.condition} #{criterion.value}
  29. </when>
  30. <when test="criterion.betweenValue">
  31. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  32. </when>
  33. <when test="criterion.listValue">
  34. and ${criterion.condition}
  35. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  36. #{listItem}
  37. </foreach>
  38. </when>
  39. </choose>
  40. </foreach>
  41. </trim>
  42. </if>
  43. </foreach>
  44. </where>
  45. </sql>
  46. <sql id="Update_By_Example_Where_Clause">
  47. <where>
  48. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  49. <if test="criteria.valid">
  50. <trim prefix="(" prefixOverrides="and" suffix=")">
  51. <foreach collection="criteria.criteria" item="criterion">
  52. <choose>
  53. <when test="criterion.noValue">
  54. and ${criterion.condition}
  55. </when>
  56. <when test="criterion.singleValue">
  57. and ${criterion.condition} #{criterion.value}
  58. </when>
  59. <when test="criterion.betweenValue">
  60. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  61. </when>
  62. <when test="criterion.listValue">
  63. and ${criterion.condition}
  64. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  65. #{listItem}
  66. </foreach>
  67. </when>
  68. </choose>
  69. </foreach>
  70. </trim>
  71. </if>
  72. </foreach>
  73. </where>
  74. </sql>
  75. <sql id="Base_Column_List">
  76. id, corp_id, user_id, staff_id, video_id, attachment_idx, message_id, `status`, send_time,
  77. is_delete, create_time
  78. </sql>
  79. <select id="selectByExample" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessageExample" resultMap="BaseResultMap">
  80. select
  81. <if test="distinct">
  82. distinct
  83. </if>
  84. <include refid="Base_Column_List" />
  85. from we_com_history_message
  86. <if test="_parameter != null">
  87. <include refid="Example_Where_Clause" />
  88. </if>
  89. <if test="orderByClause != null">
  90. order by ${orderByClause}
  91. </if>
  92. <if test="page != null">
  93. limit #{page.offset} , #{page.pageSize}
  94. </if>
  95. </select>
  96. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  97. select
  98. <include refid="Base_Column_List" />
  99. from we_com_history_message
  100. where id = #{id,jdbcType=BIGINT}
  101. </select>
  102. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  103. delete from we_com_history_message
  104. where id = #{id,jdbcType=BIGINT}
  105. </delete>
  106. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessageExample">
  107. delete from we_com_history_message
  108. <if test="_parameter != null">
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. </delete>
  112. <insert id="insert" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
  113. insert into we_com_history_message (id, corp_id, user_id,
  114. staff_id, video_id, attachment_idx,
  115. message_id, `status`, send_time,
  116. is_delete, create_time)
  117. values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
  118. #{staffId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, #{attachmentIdx,jdbcType=INTEGER},
  119. #{messageId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP},
  120. #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
  121. </insert>
  122. <insert id="insertSelective" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
  123. insert into we_com_history_message
  124. <trim prefix="(" suffix=")" suffixOverrides=",">
  125. <if test="id != null">
  126. id,
  127. </if>
  128. <if test="corpId != null">
  129. corp_id,
  130. </if>
  131. <if test="userId != null">
  132. user_id,
  133. </if>
  134. <if test="staffId != null">
  135. staff_id,
  136. </if>
  137. <if test="videoId != null">
  138. video_id,
  139. </if>
  140. <if test="attachmentIdx != null">
  141. attachment_idx,
  142. </if>
  143. <if test="messageId != null">
  144. message_id,
  145. </if>
  146. <if test="status != null">
  147. `status`,
  148. </if>
  149. <if test="sendTime != null">
  150. send_time,
  151. </if>
  152. <if test="isDelete != null">
  153. is_delete,
  154. </if>
  155. <if test="createTime != null">
  156. create_time,
  157. </if>
  158. </trim>
  159. <trim prefix="values (" suffix=")" suffixOverrides=",">
  160. <if test="id != null">
  161. #{id,jdbcType=BIGINT},
  162. </if>
  163. <if test="corpId != null">
  164. #{corpId,jdbcType=BIGINT},
  165. </if>
  166. <if test="userId != null">
  167. #{userId,jdbcType=BIGINT},
  168. </if>
  169. <if test="staffId != null">
  170. #{staffId,jdbcType=BIGINT},
  171. </if>
  172. <if test="videoId != null">
  173. #{videoId,jdbcType=BIGINT},
  174. </if>
  175. <if test="attachmentIdx != null">
  176. #{attachmentIdx,jdbcType=INTEGER},
  177. </if>
  178. <if test="messageId != null">
  179. #{messageId,jdbcType=BIGINT},
  180. </if>
  181. <if test="status != null">
  182. #{status,jdbcType=INTEGER},
  183. </if>
  184. <if test="sendTime != null">
  185. #{sendTime,jdbcType=TIMESTAMP},
  186. </if>
  187. <if test="isDelete != null">
  188. #{isDelete,jdbcType=INTEGER},
  189. </if>
  190. <if test="createTime != null">
  191. #{createTime,jdbcType=TIMESTAMP},
  192. </if>
  193. </trim>
  194. </insert>
  195. <select id="countByExample" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessageExample" resultType="java.lang.Long">
  196. select count(*) from we_com_history_message
  197. <if test="_parameter != null">
  198. <include refid="Example_Where_Clause" />
  199. </if>
  200. </select>
  201. <update id="updateByExampleSelective" parameterType="map">
  202. update we_com_history_message
  203. <set>
  204. <if test="record.id != null">
  205. id = #{record.id,jdbcType=BIGINT},
  206. </if>
  207. <if test="record.corpId != null">
  208. corp_id = #{record.corpId,jdbcType=BIGINT},
  209. </if>
  210. <if test="record.userId != null">
  211. user_id = #{record.userId,jdbcType=BIGINT},
  212. </if>
  213. <if test="record.staffId != null">
  214. staff_id = #{record.staffId,jdbcType=BIGINT},
  215. </if>
  216. <if test="record.videoId != null">
  217. video_id = #{record.videoId,jdbcType=BIGINT},
  218. </if>
  219. <if test="record.attachmentIdx != null">
  220. attachment_idx = #{record.attachmentIdx,jdbcType=INTEGER},
  221. </if>
  222. <if test="record.messageId != null">
  223. message_id = #{record.messageId,jdbcType=BIGINT},
  224. </if>
  225. <if test="record.status != null">
  226. `status` = #{record.status,jdbcType=INTEGER},
  227. </if>
  228. <if test="record.sendTime != null">
  229. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  230. </if>
  231. <if test="record.isDelete != null">
  232. is_delete = #{record.isDelete,jdbcType=INTEGER},
  233. </if>
  234. <if test="record.createTime != null">
  235. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  236. </if>
  237. </set>
  238. <if test="_parameter != null">
  239. <include refid="Update_By_Example_Where_Clause" />
  240. </if>
  241. </update>
  242. <update id="updateByExample" parameterType="map">
  243. update we_com_history_message
  244. set id = #{record.id,jdbcType=BIGINT},
  245. corp_id = #{record.corpId,jdbcType=BIGINT},
  246. user_id = #{record.userId,jdbcType=BIGINT},
  247. staff_id = #{record.staffId,jdbcType=BIGINT},
  248. video_id = #{record.videoId,jdbcType=BIGINT},
  249. attachment_idx = #{record.attachmentIdx,jdbcType=INTEGER},
  250. message_id = #{record.messageId,jdbcType=BIGINT},
  251. `status` = #{record.status,jdbcType=INTEGER},
  252. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  253. is_delete = #{record.isDelete,jdbcType=INTEGER},
  254. create_time = #{record.createTime,jdbcType=TIMESTAMP}
  255. <if test="_parameter != null">
  256. <include refid="Update_By_Example_Where_Clause" />
  257. </if>
  258. </update>
  259. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
  260. update we_com_history_message
  261. <set>
  262. <if test="corpId != null">
  263. corp_id = #{corpId,jdbcType=BIGINT},
  264. </if>
  265. <if test="userId != null">
  266. user_id = #{userId,jdbcType=BIGINT},
  267. </if>
  268. <if test="staffId != null">
  269. staff_id = #{staffId,jdbcType=BIGINT},
  270. </if>
  271. <if test="videoId != null">
  272. video_id = #{videoId,jdbcType=BIGINT},
  273. </if>
  274. <if test="attachmentIdx != null">
  275. attachment_idx = #{attachmentIdx,jdbcType=INTEGER},
  276. </if>
  277. <if test="messageId != null">
  278. message_id = #{messageId,jdbcType=BIGINT},
  279. </if>
  280. <if test="status != null">
  281. `status` = #{status,jdbcType=INTEGER},
  282. </if>
  283. <if test="sendTime != null">
  284. send_time = #{sendTime,jdbcType=TIMESTAMP},
  285. </if>
  286. <if test="isDelete != null">
  287. is_delete = #{isDelete,jdbcType=INTEGER},
  288. </if>
  289. <if test="createTime != null">
  290. create_time = #{createTime,jdbcType=TIMESTAMP},
  291. </if>
  292. </set>
  293. where id = #{id,jdbcType=BIGINT}
  294. </update>
  295. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
  296. update we_com_history_message
  297. set corp_id = #{corpId,jdbcType=BIGINT},
  298. user_id = #{userId,jdbcType=BIGINT},
  299. staff_id = #{staffId,jdbcType=BIGINT},
  300. video_id = #{videoId,jdbcType=BIGINT},
  301. attachment_idx = #{attachmentIdx,jdbcType=INTEGER},
  302. message_id = #{messageId,jdbcType=BIGINT},
  303. `status` = #{status,jdbcType=INTEGER},
  304. send_time = #{sendTime,jdbcType=TIMESTAMP},
  305. is_delete = #{isDelete,jdbcType=INTEGER},
  306. create_time = #{createTime,jdbcType=TIMESTAMP}
  307. where id = #{id,jdbcType=BIGINT}
  308. </update>
  309. </mapper>