ContentPlatformGzhPlanMapper.xml 13 KB

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