RootSourceMapper.xml 11 KB

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