TitleAuditMapper.xml 8.5 KB

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