GhDetailMapper.xml 13 KB

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