ContentPlatformPqAccountRelMapper.xml 10 KB

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