GroupSendOpenIdMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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.GroupSendOpenIdMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenId">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
  7. <result column="publish_date" jdbcType="VARCHAR" property="publishDate" />
  8. <result column="user_group_id" jdbcType="INTEGER" property="userGroupId" />
  9. <result column="open_id" jdbcType="VARCHAR" property="openId" />
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  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. id, gh_id, publish_date, user_group_id, open_id, create_time
  72. </sql>
  73. <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenIdExample" resultMap="BaseResultMap">
  74. select
  75. <if test="distinct">
  76. distinct
  77. </if>
  78. <include refid="Base_Column_List" />
  79. from long_articles_group_send_open_id
  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.Long" resultMap="BaseResultMap">
  91. select
  92. <include refid="Base_Column_List" />
  93. from long_articles_group_send_open_id
  94. where id = #{id,jdbcType=BIGINT}
  95. </select>
  96. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  97. delete from long_articles_group_send_open_id
  98. where id = #{id,jdbcType=BIGINT}
  99. </delete>
  100. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenIdExample">
  101. delete from long_articles_group_send_open_id
  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.GroupSendOpenId">
  107. insert into long_articles_group_send_open_id (id, gh_id, publish_date,
  108. user_group_id, open_id, create_time
  109. )
  110. values (#{id,jdbcType=BIGINT}, #{ghId,jdbcType=VARCHAR}, #{publishDate,jdbcType=VARCHAR},
  111. #{userGroupId,jdbcType=INTEGER}, #{openId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  112. )
  113. </insert>
  114. <insert id="batchInsert" parameterType="java.util.List">
  115. INSERT INTO long_articles_group_send_open_id (gh_id, publish_date, user_group_id, open_id)
  116. VALUES
  117. <foreach collection="list" item="item" separator=",">
  118. (#{item.ghId,jdbcType=VARCHAR}, #{item.publishDate,jdbcType=VARCHAR},
  119. #{item.userGroupId,jdbcType=INTEGER}, #{item.openId,jdbcType=VARCHAR})
  120. </foreach>
  121. </insert>
  122. <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenId">
  123. insert into long_articles_group_send_open_id
  124. <trim prefix="(" suffix=")" suffixOverrides=",">
  125. <if test="id != null">
  126. id,
  127. </if>
  128. <if test="ghId != null">
  129. gh_id,
  130. </if>
  131. <if test="publishDate != null">
  132. publish_date,
  133. </if>
  134. <if test="userGroupId != null">
  135. user_group_id,
  136. </if>
  137. <if test="openId != null">
  138. open_id,
  139. </if>
  140. <if test="createTime != null">
  141. create_time,
  142. </if>
  143. </trim>
  144. <trim prefix="values (" suffix=")" suffixOverrides=",">
  145. <if test="id != null">
  146. #{id,jdbcType=BIGINT},
  147. </if>
  148. <if test="ghId != null">
  149. #{ghId,jdbcType=VARCHAR},
  150. </if>
  151. <if test="publishDate != null">
  152. #{publishDate,jdbcType=VARCHAR},
  153. </if>
  154. <if test="userGroupId != null">
  155. #{userGroupId,jdbcType=INTEGER},
  156. </if>
  157. <if test="openId != null">
  158. #{openId,jdbcType=VARCHAR},
  159. </if>
  160. <if test="createTime != null">
  161. #{createTime,jdbcType=TIMESTAMP},
  162. </if>
  163. </trim>
  164. </insert>
  165. <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenIdExample" resultType="java.lang.Long">
  166. select count(*) from long_articles_group_send_open_id
  167. <if test="_parameter != null">
  168. <include refid="Example_Where_Clause" />
  169. </if>
  170. </select>
  171. <update id="updateByExampleSelective" parameterType="map">
  172. update long_articles_group_send_open_id
  173. <set>
  174. <if test="record.id != null">
  175. id = #{record.id,jdbcType=BIGINT},
  176. </if>
  177. <if test="record.ghId != null">
  178. gh_id = #{record.ghId,jdbcType=VARCHAR},
  179. </if>
  180. <if test="record.publishDate != null">
  181. publish_date = #{record.publishDate,jdbcType=VARCHAR},
  182. </if>
  183. <if test="record.userGroupId != null">
  184. user_group_id = #{record.userGroupId,jdbcType=INTEGER},
  185. </if>
  186. <if test="record.openId != null">
  187. open_id = #{record.openId,jdbcType=VARCHAR},
  188. </if>
  189. <if test="record.createTime != null">
  190. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  191. </if>
  192. </set>
  193. <if test="_parameter != null">
  194. <include refid="Update_By_Example_Where_Clause" />
  195. </if>
  196. </update>
  197. <update id="updateByExample" parameterType="map">
  198. update long_articles_group_send_open_id
  199. set id = #{record.id,jdbcType=BIGINT},
  200. gh_id = #{record.ghId,jdbcType=VARCHAR},
  201. publish_date = #{record.publishDate,jdbcType=VARCHAR},
  202. user_group_id = #{record.userGroupId,jdbcType=INTEGER},
  203. open_id = #{record.openId,jdbcType=VARCHAR},
  204. create_time = #{record.createTime,jdbcType=TIMESTAMP}
  205. <if test="_parameter != null">
  206. <include refid="Update_By_Example_Where_Clause" />
  207. </if>
  208. </update>
  209. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenId">
  210. update long_articles_group_send_open_id
  211. <set>
  212. <if test="ghId != null">
  213. gh_id = #{ghId,jdbcType=VARCHAR},
  214. </if>
  215. <if test="publishDate != null">
  216. publish_date = #{publishDate,jdbcType=VARCHAR},
  217. </if>
  218. <if test="userGroupId != null">
  219. user_group_id = #{userGroupId,jdbcType=INTEGER},
  220. </if>
  221. <if test="openId != null">
  222. open_id = #{openId,jdbcType=VARCHAR},
  223. </if>
  224. <if test="createTime != null">
  225. create_time = #{createTime,jdbcType=TIMESTAMP},
  226. </if>
  227. </set>
  228. where id = #{id,jdbcType=BIGINT}
  229. </update>
  230. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.GroupSendOpenId">
  231. update long_articles_group_send_open_id
  232. set gh_id = #{ghId,jdbcType=VARCHAR},
  233. publish_date = #{publishDate,jdbcType=VARCHAR},
  234. user_group_id = #{userGroupId,jdbcType=INTEGER},
  235. open_id = #{openId,jdbcType=VARCHAR},
  236. create_time = #{createTime,jdbcType=TIMESTAMP}
  237. where id = #{id,jdbcType=BIGINT}
  238. </update>
  239. </mapper>