PublishContentMapper.xml 12 KB

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