TitleAuditMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.longarticle.TitleAuditMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAudit">
  5. <id column="content_id" jdbcType="VARCHAR" property="contentId" />
  6. <result column="status" jdbcType="INTEGER" property="status" />
  7. <result column="flow_pool_level" jdbcType="VARCHAR" property="flowPoolLevel" />
  8. <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
  9. <result column="audit_account" jdbcType="VARCHAR" property="auditAccount" />
  10. <result column="audit_timestamp" jdbcType="BIGINT" property="auditTimestamp" />
  11. </resultMap>
  12. <sql id="Example_Where_Clause">
  13. <where>
  14. <foreach collection="oredCriteria" item="criteria" separator="or">
  15. <if test="criteria.valid">
  16. <trim prefix="(" prefixOverrides="and" suffix=")">
  17. <foreach collection="criteria.criteria" item="criterion">
  18. <choose>
  19. <when test="criterion.noValue">
  20. and ${criterion.condition}
  21. </when>
  22. <when test="criterion.singleValue">
  23. and ${criterion.condition} #{criterion.value}
  24. </when>
  25. <when test="criterion.betweenValue">
  26. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  27. </when>
  28. <when test="criterion.listValue">
  29. and ${criterion.condition}
  30. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  31. #{listItem}
  32. </foreach>
  33. </when>
  34. </choose>
  35. </foreach>
  36. </trim>
  37. </if>
  38. </foreach>
  39. </where>
  40. </sql>
  41. <sql id="Update_By_Example_Where_Clause">
  42. <where>
  43. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  44. <if test="criteria.valid">
  45. <trim prefix="(" prefixOverrides="and" suffix=")">
  46. <foreach collection="criteria.criteria" item="criterion">
  47. <choose>
  48. <when test="criterion.noValue">
  49. and ${criterion.condition}
  50. </when>
  51. <when test="criterion.singleValue">
  52. and ${criterion.condition} #{criterion.value}
  53. </when>
  54. <when test="criterion.betweenValue">
  55. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  56. </when>
  57. <when test="criterion.listValue">
  58. and ${criterion.condition}
  59. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </when>
  63. </choose>
  64. </foreach>
  65. </trim>
  66. </if>
  67. </foreach>
  68. </where>
  69. </sql>
  70. <sql id="Base_Column_List">
  71. content_id, `status`, flow_pool_level, create_timestamp, audit_account, audit_timestamp
  72. </sql>
  73. <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAuditExample" resultMap="BaseResultMap">
  74. select
  75. <if test="distinct">
  76. distinct
  77. </if>
  78. <include refid="Base_Column_List" />
  79. from long_articles_title_audit
  80. <if test="_parameter != null">
  81. <include refid="Example_Where_Clause" />
  82. </if>
  83. <if test="orderByClause != null">
  84. order by ${orderByClause}
  85. </if>
  86. <if test="page != null">
  87. limit #{page.offset} , #{page.pageSize}
  88. </if>
  89. </select>
  90. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  91. select
  92. <include refid="Base_Column_List" />
  93. from long_articles_title_audit
  94. where content_id = #{contentId,jdbcType=VARCHAR}
  95. </select>
  96. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  97. delete from long_articles_title_audit
  98. where content_id = #{contentId,jdbcType=VARCHAR}
  99. </delete>
  100. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAuditExample">
  101. delete from long_articles_title_audit
  102. <if test="_parameter != null">
  103. <include refid="Example_Where_Clause" />
  104. </if>
  105. </delete>
  106. <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAudit">
  107. insert into long_articles_title_audit (content_id, `status`, flow_pool_level,
  108. create_timestamp, audit_account, audit_timestamp
  109. )
  110. values (#{contentId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{flowPoolLevel,jdbcType=VARCHAR},
  111. #{createTimestamp,jdbcType=BIGINT}, #{auditAccount,jdbcType=VARCHAR}, #{auditTimestamp,jdbcType=BIGINT}
  112. )
  113. </insert>
  114. <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAudit">
  115. insert into long_articles_title_audit
  116. <trim prefix="(" suffix=")" suffixOverrides=",">
  117. <if test="contentId != null">
  118. content_id,
  119. </if>
  120. <if test="status != null">
  121. `status`,
  122. </if>
  123. <if test="flowPoolLevel != null">
  124. flow_pool_level,
  125. </if>
  126. <if test="createTimestamp != null">
  127. create_timestamp,
  128. </if>
  129. <if test="auditAccount != null">
  130. audit_account,
  131. </if>
  132. <if test="auditTimestamp != null">
  133. audit_timestamp,
  134. </if>
  135. </trim>
  136. <trim prefix="values (" suffix=")" suffixOverrides=",">
  137. <if test="contentId != null">
  138. #{contentId,jdbcType=VARCHAR},
  139. </if>
  140. <if test="status != null">
  141. #{status,jdbcType=INTEGER},
  142. </if>
  143. <if test="flowPoolLevel != null">
  144. #{flowPoolLevel,jdbcType=VARCHAR},
  145. </if>
  146. <if test="createTimestamp != null">
  147. #{createTimestamp,jdbcType=BIGINT},
  148. </if>
  149. <if test="auditAccount != null">
  150. #{auditAccount,jdbcType=VARCHAR},
  151. </if>
  152. <if test="auditTimestamp != null">
  153. #{auditTimestamp,jdbcType=BIGINT},
  154. </if>
  155. </trim>
  156. </insert>
  157. <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAuditExample" resultType="java.lang.Long">
  158. select count(*) from long_articles_title_audit
  159. <if test="_parameter != null">
  160. <include refid="Example_Where_Clause" />
  161. </if>
  162. </select>
  163. <update id="updateByExampleSelective" parameterType="map">
  164. update long_articles_title_audit
  165. <set>
  166. <if test="record.contentId != null">
  167. content_id = #{record.contentId,jdbcType=VARCHAR},
  168. </if>
  169. <if test="record.status != null">
  170. `status` = #{record.status,jdbcType=INTEGER},
  171. </if>
  172. <if test="record.flowPoolLevel != null">
  173. flow_pool_level = #{record.flowPoolLevel,jdbcType=VARCHAR},
  174. </if>
  175. <if test="record.createTimestamp != null">
  176. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
  177. </if>
  178. <if test="record.auditAccount != null">
  179. audit_account = #{record.auditAccount,jdbcType=VARCHAR},
  180. </if>
  181. <if test="record.auditTimestamp != null">
  182. audit_timestamp = #{record.auditTimestamp,jdbcType=BIGINT},
  183. </if>
  184. </set>
  185. <if test="_parameter != null">
  186. <include refid="Update_By_Example_Where_Clause" />
  187. </if>
  188. </update>
  189. <update id="updateByExample" parameterType="map">
  190. update long_articles_title_audit
  191. set content_id = #{record.contentId,jdbcType=VARCHAR},
  192. `status` = #{record.status,jdbcType=INTEGER},
  193. flow_pool_level = #{record.flowPoolLevel,jdbcType=VARCHAR},
  194. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
  195. audit_account = #{record.auditAccount,jdbcType=VARCHAR},
  196. audit_timestamp = #{record.auditTimestamp,jdbcType=BIGINT}
  197. <if test="_parameter != null">
  198. <include refid="Update_By_Example_Where_Clause" />
  199. </if>
  200. </update>
  201. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAudit">
  202. update long_articles_title_audit
  203. <set>
  204. <if test="status != null">
  205. `status` = #{status,jdbcType=INTEGER},
  206. </if>
  207. <if test="flowPoolLevel != null">
  208. flow_pool_level = #{flowPoolLevel,jdbcType=VARCHAR},
  209. </if>
  210. <if test="createTimestamp != null">
  211. create_timestamp = #{createTimestamp,jdbcType=BIGINT},
  212. </if>
  213. <if test="auditAccount != null">
  214. audit_account = #{auditAccount,jdbcType=VARCHAR},
  215. </if>
  216. <if test="auditTimestamp != null">
  217. audit_timestamp = #{auditTimestamp,jdbcType=BIGINT},
  218. </if>
  219. </set>
  220. where content_id = #{contentId,jdbcType=VARCHAR}
  221. </update>
  222. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.TitleAudit">
  223. update long_articles_title_audit
  224. set `status` = #{status,jdbcType=INTEGER},
  225. flow_pool_level = #{flowPoolLevel,jdbcType=VARCHAR},
  226. create_timestamp = #{createTimestamp,jdbcType=BIGINT},
  227. audit_account = #{auditAccount,jdbcType=VARCHAR},
  228. audit_timestamp = #{auditTimestamp,jdbcType=BIGINT}
  229. where content_id = #{contentId,jdbcType=VARCHAR}
  230. </update>
  231. </mapper>