MessageAttachmentMapper.xml 13 KB

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