ContentPlatformGzhPlanMapper.xml 11 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.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="publish_stage" jdbcType="INTEGER" property="publishStage" />
  7. <result column="account_id" jdbcType="BIGINT" property="accountId" />
  8. <result column="scene" jdbcType="INTEGER" property="scene" />
  9. <result column="external_id" jdbcType="VARCHAR" property="externalId" />
  10. <result column="status" jdbcType="INTEGER" property="status" />
  11. <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
  12. <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
  13. <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
  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, publish_stage, account_id, scene, external_id, `status`, create_account_id, create_timestamp,
  75. update_timestamp
  76. </sql>
  77. <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanExample" resultMap="BaseResultMap">
  78. select
  79. <if test="distinct">
  80. distinct
  81. </if>
  82. <include refid="Base_Column_List" />
  83. from content_platform_gzh_plan
  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 content_platform_gzh_plan
  98. where id = #{id,jdbcType=BIGINT}
  99. </select>
  100. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  101. delete from content_platform_gzh_plan
  102. where id = #{id,jdbcType=BIGINT}
  103. </delete>
  104. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanExample">
  105. delete from content_platform_gzh_plan
  106. <if test="_parameter != null">
  107. <include refid="Example_Where_Clause" />
  108. </if>
  109. </delete>
  110. <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
  111. insert into content_platform_gzh_plan (id, publish_stage, account_id,
  112. scene, external_id, `status`,
  113. create_account_id, create_timestamp, update_timestamp
  114. )
  115. values (#{id,jdbcType=BIGINT}, #{publishStage,jdbcType=INTEGER}, #{accountId,jdbcType=BIGINT},
  116. #{scene,jdbcType=INTEGER}, #{externalId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  117. #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
  118. )
  119. </insert>
  120. <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
  121. insert into content_platform_gzh_plan
  122. <trim prefix="(" suffix=")" suffixOverrides=",">
  123. <if test="id != null">
  124. id,
  125. </if>
  126. <if test="publishStage != null">
  127. publish_stage,
  128. </if>
  129. <if test="accountId != null">
  130. account_id,
  131. </if>
  132. <if test="scene != null">
  133. scene,
  134. </if>
  135. <if test="externalId != null">
  136. external_id,
  137. </if>
  138. <if test="status != null">
  139. `status`,
  140. </if>
  141. <if test="createAccountId != null">
  142. create_account_id,
  143. </if>
  144. <if test="createTimestamp != null">
  145. create_timestamp,
  146. </if>
  147. <if test="updateTimestamp != null">
  148. update_timestamp,
  149. </if>
  150. </trim>
  151. <trim prefix="values (" suffix=")" suffixOverrides=",">
  152. <if test="id != null">
  153. #{id,jdbcType=BIGINT},
  154. </if>
  155. <if test="publishStage != null">
  156. #{publishStage,jdbcType=INTEGER},
  157. </if>
  158. <if test="accountId != null">
  159. #{accountId,jdbcType=BIGINT},
  160. </if>
  161. <if test="scene != null">
  162. #{scene,jdbcType=INTEGER},
  163. </if>
  164. <if test="externalId != null">
  165. #{externalId,jdbcType=VARCHAR},
  166. </if>
  167. <if test="status != null">
  168. #{status,jdbcType=INTEGER},
  169. </if>
  170. <if test="createAccountId != null">
  171. #{createAccountId,jdbcType=BIGINT},
  172. </if>
  173. <if test="createTimestamp != null">
  174. #{createTimestamp,jdbcType=BIGINT},
  175. </if>
  176. <if test="updateTimestamp != null">
  177. #{updateTimestamp,jdbcType=BIGINT},
  178. </if>
  179. </trim>
  180. </insert>
  181. <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanExample" resultType="java.lang.Long">
  182. select count(*) from content_platform_gzh_plan
  183. <if test="_parameter != null">
  184. <include refid="Example_Where_Clause" />
  185. </if>
  186. </select>
  187. <update id="updateByExampleSelective" parameterType="map">
  188. update content_platform_gzh_plan
  189. <set>
  190. <if test="record.id != null">
  191. id = #{record.id,jdbcType=BIGINT},
  192. </if>
  193. <if test="record.publishStage != null">
  194. publish_stage = #{record.publishStage,jdbcType=INTEGER},
  195. </if>
  196. <if test="record.accountId != null">
  197. account_id = #{record.accountId,jdbcType=BIGINT},
  198. </if>
  199. <if test="record.scene != null">
  200. scene = #{record.scene,jdbcType=INTEGER},
  201. </if>
  202. <if test="record.externalId != null">
  203. external_id = #{record.externalId,jdbcType=VARCHAR},
  204. </if>
  205. <if test="record.status != null">
  206. `status` = #{record.status,jdbcType=INTEGER},
  207. </if>
  208. <if test="record.createAccountId != null">
  209. create_account_id = #{record.createAccountId,jdbcType=BIGINT},
  210. </if>
  211. <if test="record.createTimestamp != null">
  212. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
  213. </if>
  214. <if test="record.updateTimestamp != null">
  215. update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT},
  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 content_platform_gzh_plan
  224. set id = #{record.id,jdbcType=BIGINT},
  225. publish_stage = #{record.publishStage,jdbcType=INTEGER},
  226. account_id = #{record.accountId,jdbcType=BIGINT},
  227. scene = #{record.scene,jdbcType=INTEGER},
  228. external_id = #{record.externalId,jdbcType=VARCHAR},
  229. `status` = #{record.status,jdbcType=INTEGER},
  230. create_account_id = #{record.createAccountId,jdbcType=BIGINT},
  231. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
  232. update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
  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.api.model.po.contentplatform.ContentPlatformGzhPlan">
  238. update content_platform_gzh_plan
  239. <set>
  240. <if test="publishStage != null">
  241. publish_stage = #{publishStage,jdbcType=INTEGER},
  242. </if>
  243. <if test="accountId != null">
  244. account_id = #{accountId,jdbcType=BIGINT},
  245. </if>
  246. <if test="scene != null">
  247. scene = #{scene,jdbcType=INTEGER},
  248. </if>
  249. <if test="externalId != null">
  250. external_id = #{externalId,jdbcType=VARCHAR},
  251. </if>
  252. <if test="status != null">
  253. `status` = #{status,jdbcType=INTEGER},
  254. </if>
  255. <if test="createAccountId != null">
  256. create_account_id = #{createAccountId,jdbcType=BIGINT},
  257. </if>
  258. <if test="createTimestamp != null">
  259. create_timestamp = #{createTimestamp,jdbcType=BIGINT},
  260. </if>
  261. <if test="updateTimestamp != null">
  262. update_timestamp = #{updateTimestamp,jdbcType=BIGINT},
  263. </if>
  264. </set>
  265. where id = #{id,jdbcType=BIGINT}
  266. </update>
  267. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
  268. update content_platform_gzh_plan
  269. set publish_stage = #{publishStage,jdbcType=INTEGER},
  270. account_id = #{accountId,jdbcType=BIGINT},
  271. scene = #{scene,jdbcType=INTEGER},
  272. external_id = #{externalId,jdbcType=VARCHAR},
  273. `status` = #{status,jdbcType=INTEGER},
  274. create_account_id = #{createAccountId,jdbcType=BIGINT},
  275. create_timestamp = #{createTimestamp,jdbcType=BIGINT},
  276. update_timestamp = #{updateTimestamp,jdbcType=BIGINT}
  277. where id = #{id,jdbcType=BIGINT}
  278. </update>
  279. </mapper>