AdVideoImageMapper.xml 10 KB

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