ExternalChannelMapper.xml 13 KB

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