HistoryMessageBackupMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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.offline.dao.mapper.OfflineHistoryMessageBackupMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.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="status" jdbcType="INTEGER" property="status" />
  12. <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
  13. <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
  14. <result column="source" jdbcType="VARCHAR" property="source" />
  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, `status`, send_time, is_delete,
  77. `source`, create_time
  78. </sql>
  79. <select id="selectByExample" parameterType="com.tzld.piaoquan.common.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_backup
  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_backup
  100. where id = #{id,jdbcType=BIGINT}
  101. </select>
  102. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  103. delete from we_com_history_message_backup
  104. where id = #{id,jdbcType=BIGINT}
  105. </delete>
  106. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.HistoryMessageExample">
  107. delete from we_com_history_message_backup
  108. <if test="_parameter != null">
  109. <include refid="Example_Where_Clause" />
  110. </if>
  111. </delete>
  112. <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.HistoryMessage">
  113. insert into we_com_history_message_backup (id, corp_id, user_id,
  114. staff_id, video_id, attachment_idx,
  115. `status`, send_time, is_delete,
  116. `source`, create_time)
  117. values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
  118. #{staffId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, #{attachmentIdx,jdbcType=INTEGER},
  119. #{status,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=INTEGER},
  120. #{source,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  121. </insert>
  122. <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.HistoryMessage">
  123. insert into we_com_history_message_backup
  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="status != null">
  144. `status`,
  145. </if>
  146. <if test="sendTime != null">
  147. send_time,
  148. </if>
  149. <if test="isDelete != null">
  150. is_delete,
  151. </if>
  152. <if test="source != null">
  153. `source`,
  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="status != null">
  179. #{status,jdbcType=INTEGER},
  180. </if>
  181. <if test="sendTime != null">
  182. #{sendTime,jdbcType=TIMESTAMP},
  183. </if>
  184. <if test="isDelete != null">
  185. #{isDelete,jdbcType=INTEGER},
  186. </if>
  187. <if test="source != null">
  188. #{source,jdbcType=VARCHAR},
  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.common.model.po.HistoryMessageExample" resultType="java.lang.Long">
  196. select count(*) from we_com_history_message_backup
  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_backup
  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.status != null">
  223. `status` = #{record.status,jdbcType=INTEGER},
  224. </if>
  225. <if test="record.sendTime != null">
  226. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  227. </if>
  228. <if test="record.isDelete != null">
  229. is_delete = #{record.isDelete,jdbcType=INTEGER},
  230. </if>
  231. <if test="record.source != null">
  232. `source` = #{record.source,jdbcType=VARCHAR},
  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_backup
  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. `status` = #{record.status,jdbcType=INTEGER},
  251. send_time = #{record.sendTime,jdbcType=TIMESTAMP},
  252. is_delete = #{record.isDelete,jdbcType=INTEGER},
  253. `source` = #{record.source,jdbcType=VARCHAR},
  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.common.model.po.HistoryMessage">
  260. update we_com_history_message_backup
  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="status != null">
  278. `status` = #{status,jdbcType=INTEGER},
  279. </if>
  280. <if test="sendTime != null">
  281. send_time = #{sendTime,jdbcType=TIMESTAMP},
  282. </if>
  283. <if test="isDelete != null">
  284. is_delete = #{isDelete,jdbcType=INTEGER},
  285. </if>
  286. <if test="source != null">
  287. `source` = #{source,jdbcType=VARCHAR},
  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.common.model.po.HistoryMessage">
  296. update we_com_history_message_backup
  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. `status` = #{status,jdbcType=INTEGER},
  303. send_time = #{sendTime,jdbcType=TIMESTAMP},
  304. is_delete = #{isDelete,jdbcType=INTEGER},
  305. `source` = #{source,jdbcType=VARCHAR},
  306. create_time = #{createTime,jdbcType=TIMESTAMP}
  307. where id = #{id,jdbcType=BIGINT}
  308. </update>
  309. <insert id="insertList" parameterType="java.util.List">
  310. insert into we_com_history_message_backup
  311. (
  312. id,
  313. corp_id,
  314. user_id,
  315. staff_id,
  316. video_id,
  317. attachment_idx,
  318. `status`,
  319. send_time,
  320. `source`,
  321. create_time
  322. )
  323. values
  324. <foreach collection="list" item="item" separator=",">
  325. (
  326. #{item.id,jdbcType=BIGINT},
  327. #{item.corpId,jdbcType=BIGINT},
  328. #{item.userId,jdbcType=BIGINT},
  329. #{item.staffId,jdbcType=BIGINT},
  330. #{item.videoId,jdbcType=BIGINT},
  331. #{item.attachmentIdx,jdbcType=INTEGER},
  332. #{item.status,jdbcType=INTEGER},
  333. #{item.sendTime,jdbcType=TIMESTAMP},
  334. #{item.source,jdbcType=VARCHAR},
  335. #{item.createTime,jdbcType=TIMESTAMP}
  336. )
  337. </foreach>
  338. </insert>
  339. </mapper>