BookshelfRecommandMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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.book.server.dao.mapper.BookshelfRecommandMapper">
  4. <resultMap id="BaseResultMap" type="com.book.server.dao.entity.BookshelfRecommand">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="book_id" jdbcType="BIGINT" property="bookId" />
  12. <result column="book_name" jdbcType="VARCHAR" property="bookName" />
  13. <result column="sex" jdbcType="CHAR" property="sex" />
  14. <result column="status" jdbcType="CHAR" property="status" />
  15. <result column="createtime" jdbcType="INTEGER" property="createtime" />
  16. <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
  17. </resultMap>
  18. <sql id="Example_Where_Clause">
  19. <!--
  20. WARNING - @mbg.generated
  21. This element is automatically generated by MyBatis Generator, do not modify.
  22. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  23. -->
  24. <where>
  25. <foreach collection="oredCriteria" item="criteria" separator="or">
  26. <if test="criteria.valid">
  27. <trim prefix="(" prefixOverrides="and" suffix=")">
  28. <foreach collection="criteria.criteria" item="criterion">
  29. <choose>
  30. <when test="criterion.noValue">
  31. and ${criterion.condition}
  32. </when>
  33. <when test="criterion.singleValue">
  34. and ${criterion.condition} #{criterion.value}
  35. </when>
  36. <when test="criterion.betweenValue">
  37. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  38. </when>
  39. <when test="criterion.listValue">
  40. and ${criterion.condition}
  41. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  42. #{listItem}
  43. </foreach>
  44. </when>
  45. </choose>
  46. </foreach>
  47. </trim>
  48. </if>
  49. </foreach>
  50. </where>
  51. </sql>
  52. <sql id="Update_By_Example_Where_Clause">
  53. <!--
  54. WARNING - @mbg.generated
  55. This element is automatically generated by MyBatis Generator, do not modify.
  56. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  57. -->
  58. <where>
  59. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  60. <if test="criteria.valid">
  61. <trim prefix="(" prefixOverrides="and" suffix=")">
  62. <foreach collection="criteria.criteria" item="criterion">
  63. <choose>
  64. <when test="criterion.noValue">
  65. and ${criterion.condition}
  66. </when>
  67. <when test="criterion.singleValue">
  68. and ${criterion.condition} #{criterion.value}
  69. </when>
  70. <when test="criterion.betweenValue">
  71. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  72. </when>
  73. <when test="criterion.listValue">
  74. and ${criterion.condition}
  75. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  76. #{listItem}
  77. </foreach>
  78. </when>
  79. </choose>
  80. </foreach>
  81. </trim>
  82. </if>
  83. </foreach>
  84. </where>
  85. </sql>
  86. <sql id="Base_Column_List">
  87. <!--
  88. WARNING - @mbg.generated
  89. This element is automatically generated by MyBatis Generator, do not modify.
  90. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  91. -->
  92. id, book_id, book_name, sex, status, createtime, updatetime
  93. </sql>
  94. <select id="selectByExample" parameterType="com.book.server.dao.entity.example.BookshelfRecommandExample" resultMap="BaseResultMap">
  95. <!--
  96. WARNING - @mbg.generated
  97. This element is automatically generated by MyBatis Generator, do not modify.
  98. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  99. -->
  100. select
  101. <if test="distinct">
  102. distinct
  103. </if>
  104. <include refid="Base_Column_List" />
  105. from bookshelf_recommand
  106. <if test="_parameter != null">
  107. <include refid="Example_Where_Clause" />
  108. </if>
  109. <if test="orderByClause != null">
  110. order by ${orderByClause}
  111. </if>
  112. <if test="rows != null">
  113. <if test="offset != null">
  114. limit ${offset}, ${rows}
  115. </if>
  116. <if test="offset == null">
  117. limit ${rows}
  118. </if>
  119. </if>
  120. </select>
  121. <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
  122. <!--
  123. WARNING - @mbg.generated
  124. This element is automatically generated by MyBatis Generator, do not modify.
  125. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  126. -->
  127. select
  128. <if test="example != null and example.distinct">
  129. distinct
  130. </if>
  131. <choose>
  132. <when test="selective != null and selective.length > 0">
  133. <foreach collection="selective" item="column" separator=",">
  134. ${column.aliasedEscapedColumnName}
  135. </foreach>
  136. </when>
  137. <otherwise>
  138. <include refid="Base_Column_List" />
  139. </otherwise>
  140. </choose>
  141. from bookshelf_recommand
  142. <if test="example != null">
  143. <include refid="Update_By_Example_Where_Clause" />
  144. </if>
  145. <if test="example != null and example.orderByClause != null">
  146. order by ${example.orderByClause}
  147. </if>
  148. <if test="example != null and example.rows != null">
  149. <if test="example.offset != null">
  150. limit ${example.offset}, ${example.rows}
  151. </if>
  152. <if test="example.offset == null">
  153. limit ${example.rows}
  154. </if>
  155. </if>
  156. </select>
  157. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  158. <!--
  159. WARNING - @mbg.generated
  160. This element is automatically generated by MyBatis Generator, do not modify.
  161. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  162. -->
  163. select
  164. <include refid="Base_Column_List" />
  165. from bookshelf_recommand
  166. where id = #{id,jdbcType=INTEGER}
  167. </select>
  168. <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
  169. <!--
  170. WARNING - @mbg.generated
  171. This element is automatically generated by MyBatis Generator, do not modify.
  172. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  173. -->
  174. select
  175. <choose>
  176. <when test="selective != null and selective.length > 0">
  177. <foreach collection="selective" item="column" separator=",">
  178. ${column.aliasedEscapedColumnName}
  179. </foreach>
  180. </when>
  181. <otherwise>
  182. <include refid="Base_Column_List" />
  183. </otherwise>
  184. </choose>
  185. from bookshelf_recommand
  186. where id = #{id,jdbcType=INTEGER}
  187. </select>
  188. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  189. <!--
  190. WARNING - @mbg.generated
  191. This element is automatically generated by MyBatis Generator, do not modify.
  192. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  193. -->
  194. delete from bookshelf_recommand
  195. where id = #{id,jdbcType=INTEGER}
  196. </delete>
  197. <delete id="deleteByExample" parameterType="com.book.server.dao.entity.example.BookshelfRecommandExample">
  198. <!--
  199. WARNING - @mbg.generated
  200. This element is automatically generated by MyBatis Generator, do not modify.
  201. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  202. -->
  203. delete from bookshelf_recommand
  204. <if test="_parameter != null">
  205. <include refid="Example_Where_Clause" />
  206. </if>
  207. </delete>
  208. <insert id="insert" parameterType="com.book.server.dao.entity.BookshelfRecommand">
  209. <!--
  210. WARNING - @mbg.generated
  211. This element is automatically generated by MyBatis Generator, do not modify.
  212. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  213. -->
  214. insert into bookshelf_recommand (id, book_id, book_name,
  215. sex, status, createtime,
  216. updatetime)
  217. values (#{id,jdbcType=INTEGER}, #{bookId,jdbcType=BIGINT}, #{bookName,jdbcType=VARCHAR},
  218. #{sex,jdbcType=CHAR}, #{status,jdbcType=CHAR}, #{createtime,jdbcType=INTEGER},
  219. #{updatetime,jdbcType=INTEGER})
  220. </insert>
  221. <insert id="insertSelective" parameterType="map">
  222. <!--
  223. WARNING - @mbg.generated
  224. This element is automatically generated by MyBatis Generator, do not modify.
  225. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  226. -->
  227. insert into bookshelf_recommand
  228. <choose>
  229. <when test="selective != null and selective.length > 0">
  230. <foreach close=")" collection="selective" item="column" open="(" separator=",">
  231. ${column.escapedColumnName}
  232. </foreach>
  233. </when>
  234. <otherwise>
  235. <trim prefix="(" suffix=")" suffixOverrides=",">
  236. <if test="record.id != null">
  237. id,
  238. </if>
  239. <if test="record.bookId != null">
  240. book_id,
  241. </if>
  242. <if test="record.bookName != null">
  243. book_name,
  244. </if>
  245. <if test="record.sex != null">
  246. sex,
  247. </if>
  248. <if test="record.status != null">
  249. status,
  250. </if>
  251. <if test="record.createtime != null">
  252. createtime,
  253. </if>
  254. <if test="record.updatetime != null">
  255. updatetime,
  256. </if>
  257. </trim>
  258. <trim prefix="(" suffix=")" suffixOverrides="," />
  259. </otherwise>
  260. </choose>
  261. values
  262. <choose>
  263. <when test="selective != null and selective.length > 0">
  264. <foreach close=")" collection="selective" item="column" open="(" separator=",">
  265. #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
  266. </foreach>
  267. </when>
  268. <otherwise>
  269. <trim prefix="(" suffix=")" suffixOverrides=",">
  270. <if test="record.id != null">
  271. #{record.id,jdbcType=INTEGER},
  272. </if>
  273. <if test="record.bookId != null">
  274. #{record.bookId,jdbcType=BIGINT},
  275. </if>
  276. <if test="record.bookName != null">
  277. #{record.bookName,jdbcType=VARCHAR},
  278. </if>
  279. <if test="record.sex != null">
  280. #{record.sex,jdbcType=CHAR},
  281. </if>
  282. <if test="record.status != null">
  283. #{record.status,jdbcType=CHAR},
  284. </if>
  285. <if test="record.createtime != null">
  286. #{record.createtime,jdbcType=INTEGER},
  287. </if>
  288. <if test="record.updatetime != null">
  289. #{record.updatetime,jdbcType=INTEGER},
  290. </if>
  291. </trim>
  292. </otherwise>
  293. </choose>
  294. </insert>
  295. <select id="countByExample" parameterType="com.book.server.dao.entity.example.BookshelfRecommandExample" resultType="java.lang.Long">
  296. <!--
  297. WARNING - @mbg.generated
  298. This element is automatically generated by MyBatis Generator, do not modify.
  299. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  300. -->
  301. select count(*) from bookshelf_recommand
  302. <if test="_parameter != null">
  303. <include refid="Example_Where_Clause" />
  304. </if>
  305. </select>
  306. <update id="updateByExampleSelective" parameterType="map">
  307. <!--
  308. WARNING - @mbg.generated
  309. This element is automatically generated by MyBatis Generator, do not modify.
  310. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  311. -->
  312. update bookshelf_recommand
  313. SET
  314. <choose>
  315. <when test="selective != null and selective.length > 0">
  316. <foreach collection="selective" item="column" separator=",">
  317. ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
  318. </foreach>
  319. </when>
  320. <otherwise>
  321. <trim suffixOverrides=",">
  322. <if test="record.id != null">
  323. id = #{record.id,jdbcType=INTEGER},
  324. </if>
  325. <if test="record.bookId != null">
  326. book_id = #{record.bookId,jdbcType=BIGINT},
  327. </if>
  328. <if test="record.bookName != null">
  329. book_name = #{record.bookName,jdbcType=VARCHAR},
  330. </if>
  331. <if test="record.sex != null">
  332. sex = #{record.sex,jdbcType=CHAR},
  333. </if>
  334. <if test="record.status != null">
  335. status = #{record.status,jdbcType=CHAR},
  336. </if>
  337. <if test="record.createtime != null">
  338. createtime = #{record.createtime,jdbcType=INTEGER},
  339. </if>
  340. <if test="record.updatetime != null">
  341. updatetime = #{record.updatetime,jdbcType=INTEGER},
  342. </if>
  343. </trim>
  344. </otherwise>
  345. </choose>
  346. <if test="_parameter != null">
  347. <include refid="Update_By_Example_Where_Clause" />
  348. </if>
  349. </update>
  350. <update id="updateByExample" parameterType="map">
  351. <!--
  352. WARNING - @mbg.generated
  353. This element is automatically generated by MyBatis Generator, do not modify.
  354. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  355. -->
  356. update bookshelf_recommand
  357. set id = #{record.id,jdbcType=INTEGER},
  358. book_id = #{record.bookId,jdbcType=BIGINT},
  359. book_name = #{record.bookName,jdbcType=VARCHAR},
  360. sex = #{record.sex,jdbcType=CHAR},
  361. status = #{record.status,jdbcType=CHAR},
  362. createtime = #{record.createtime,jdbcType=INTEGER},
  363. updatetime = #{record.updatetime,jdbcType=INTEGER}
  364. <if test="_parameter != null">
  365. <include refid="Update_By_Example_Where_Clause" />
  366. </if>
  367. </update>
  368. <update id="updateByPrimaryKeySelective" parameterType="map">
  369. <!--
  370. WARNING - @mbg.generated
  371. This element is automatically generated by MyBatis Generator, do not modify.
  372. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  373. -->
  374. update bookshelf_recommand
  375. SET
  376. <choose>
  377. <when test="selective != null and selective.length > 0">
  378. <foreach collection="selective" item="column" separator=",">
  379. ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
  380. </foreach>
  381. </when>
  382. <otherwise>
  383. <trim suffixOverrides=",">
  384. <if test="record.bookId != null">
  385. book_id = #{record.bookId,jdbcType=BIGINT},
  386. </if>
  387. <if test="record.bookName != null">
  388. book_name = #{record.bookName,jdbcType=VARCHAR},
  389. </if>
  390. <if test="record.sex != null">
  391. sex = #{record.sex,jdbcType=CHAR},
  392. </if>
  393. <if test="record.status != null">
  394. status = #{record.status,jdbcType=CHAR},
  395. </if>
  396. <if test="record.createtime != null">
  397. createtime = #{record.createtime,jdbcType=INTEGER},
  398. </if>
  399. <if test="record.updatetime != null">
  400. updatetime = #{record.updatetime,jdbcType=INTEGER},
  401. </if>
  402. </trim>
  403. </otherwise>
  404. </choose>
  405. where id = #{record.id,jdbcType=INTEGER}
  406. </update>
  407. <update id="updateByPrimaryKey" parameterType="com.book.server.dao.entity.BookshelfRecommand">
  408. <!--
  409. WARNING - @mbg.generated
  410. This element is automatically generated by MyBatis Generator, do not modify.
  411. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  412. -->
  413. update bookshelf_recommand
  414. set book_id = #{bookId,jdbcType=BIGINT},
  415. book_name = #{bookName,jdbcType=VARCHAR},
  416. sex = #{sex,jdbcType=CHAR},
  417. status = #{status,jdbcType=CHAR},
  418. createtime = #{createtime,jdbcType=INTEGER},
  419. updatetime = #{updatetime,jdbcType=INTEGER}
  420. where id = #{id,jdbcType=INTEGER}
  421. </update>
  422. <select id="selectOneByExample" parameterType="com.book.server.dao.entity.example.BookshelfRecommandExample" resultMap="BaseResultMap">
  423. <!--
  424. WARNING - @mbg.generated
  425. This element is automatically generated by MyBatis Generator, do not modify.
  426. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  427. -->
  428. select
  429. <include refid="Base_Column_List" />
  430. from bookshelf_recommand
  431. <if test="_parameter != null">
  432. <include refid="Example_Where_Clause" />
  433. </if>
  434. <if test="orderByClause != null">
  435. order by ${orderByClause}
  436. </if>
  437. limit 1
  438. </select>
  439. <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
  440. <!--
  441. WARNING - @mbg.generated
  442. This element is automatically generated by MyBatis Generator, do not modify.
  443. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  444. -->
  445. select
  446. <choose>
  447. <when test="selective != null and selective.length > 0">
  448. <foreach collection="selective" item="column" separator=",">
  449. ${column.aliasedEscapedColumnName}
  450. </foreach>
  451. </when>
  452. <otherwise>
  453. <include refid="Base_Column_List" />
  454. </otherwise>
  455. </choose>
  456. from bookshelf_recommand
  457. <if test="example != null">
  458. <include refid="Update_By_Example_Where_Clause" />
  459. </if>
  460. <if test="example != null and example.orderByClause != null">
  461. order by ${example.orderByClause}
  462. </if>
  463. limit 1
  464. </select>
  465. <insert id="batchInsert" parameterType="map">
  466. <!--
  467. WARNING - @mbg.generated
  468. This element is automatically generated by MyBatis Generator, do not modify.
  469. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  470. -->
  471. insert into bookshelf_recommand
  472. (id, book_id, book_name, sex, status, createtime, updatetime)
  473. values
  474. <foreach collection="list" item="item" separator=",">
  475. (#{item.id,jdbcType=INTEGER}, #{item.bookId,jdbcType=BIGINT}, #{item.bookName,jdbcType=VARCHAR},
  476. #{item.sex,jdbcType=CHAR}, #{item.status,jdbcType=CHAR}, #{item.createtime,jdbcType=INTEGER},
  477. #{item.updatetime,jdbcType=INTEGER})
  478. </foreach>
  479. </insert>
  480. <insert id="batchInsertSelective" parameterType="map">
  481. <!--
  482. WARNING - @mbg.generated
  483. This element is automatically generated by MyBatis Generator, do not modify.
  484. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  485. -->
  486. insert into bookshelf_recommand (
  487. <foreach collection="selective" item="column" separator=",">
  488. ${column.escapedColumnName}
  489. </foreach>
  490. )
  491. values
  492. <foreach collection="list" item="item" separator=",">
  493. (
  494. <foreach collection="selective" item="column" separator=",">
  495. <if test="'id'.toString() == column.value">
  496. #{item.id,jdbcType=INTEGER}
  497. </if>
  498. <if test="'book_id'.toString() == column.value">
  499. #{item.bookId,jdbcType=BIGINT}
  500. </if>
  501. <if test="'book_name'.toString() == column.value">
  502. #{item.bookName,jdbcType=VARCHAR}
  503. </if>
  504. <if test="'sex'.toString() == column.value">
  505. #{item.sex,jdbcType=CHAR}
  506. </if>
  507. <if test="'status'.toString() == column.value">
  508. #{item.status,jdbcType=CHAR}
  509. </if>
  510. <if test="'createtime'.toString() == column.value">
  511. #{item.createtime,jdbcType=INTEGER}
  512. </if>
  513. <if test="'updatetime'.toString() == column.value">
  514. #{item.updatetime,jdbcType=INTEGER}
  515. </if>
  516. </foreach>
  517. )
  518. </foreach>
  519. </insert>
  520. <insert id="upsertSelective" parameterType="map">
  521. <!--
  522. WARNING - @mbg.generated
  523. This element is automatically generated by MyBatis Generator, do not modify.
  524. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  525. -->
  526. insert into bookshelf_recommand
  527. <choose>
  528. <when test="selective != null and selective.length > 0">
  529. <foreach close=")" collection="selective" item="column" open="(" separator=",">
  530. ${column.escapedColumnName}
  531. </foreach>
  532. </when>
  533. <otherwise>
  534. <trim prefix="(" suffix=")" suffixOverrides=",">
  535. <if test="record.id != null">
  536. id,
  537. </if>
  538. <if test="record.bookId != null">
  539. book_id,
  540. </if>
  541. <if test="record.bookName != null">
  542. book_name,
  543. </if>
  544. <if test="record.sex != null">
  545. sex,
  546. </if>
  547. <if test="record.status != null">
  548. status,
  549. </if>
  550. <if test="record.createtime != null">
  551. createtime,
  552. </if>
  553. <if test="record.updatetime != null">
  554. updatetime,
  555. </if>
  556. </trim>
  557. <trim prefix="(" suffix=")" suffixOverrides="," />
  558. </otherwise>
  559. </choose>
  560. values
  561. <choose>
  562. <when test="selective != null and selective.length > 0">
  563. <foreach close=")" collection="selective" item="column" open="(" separator=",">
  564. #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
  565. </foreach>
  566. </when>
  567. <otherwise>
  568. <trim prefix="(" suffix=")" suffixOverrides=",">
  569. <if test="record.id != null">
  570. #{record.id,jdbcType=INTEGER},
  571. </if>
  572. <if test="record.bookId != null">
  573. #{record.bookId,jdbcType=BIGINT},
  574. </if>
  575. <if test="record.bookName != null">
  576. #{record.bookName,jdbcType=VARCHAR},
  577. </if>
  578. <if test="record.sex != null">
  579. #{record.sex,jdbcType=CHAR},
  580. </if>
  581. <if test="record.status != null">
  582. #{record.status,jdbcType=CHAR},
  583. </if>
  584. <if test="record.createtime != null">
  585. #{record.createtime,jdbcType=INTEGER},
  586. </if>
  587. <if test="record.updatetime != null">
  588. #{record.updatetime,jdbcType=INTEGER},
  589. </if>
  590. </trim>
  591. </otherwise>
  592. </choose>
  593. on duplicate key update
  594. <choose>
  595. <when test="selective != null and selective.length > 0">
  596. <foreach collection="selective" item="column" separator=",">
  597. ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
  598. </foreach>
  599. </when>
  600. <otherwise>
  601. <trim suffixOverrides=",">
  602. <if test="record.id != null">
  603. id = #{record.id,jdbcType=INTEGER},
  604. </if>
  605. <if test="record.bookId != null">
  606. book_id = #{record.bookId,jdbcType=BIGINT},
  607. </if>
  608. <if test="record.bookName != null">
  609. book_name = #{record.bookName,jdbcType=VARCHAR},
  610. </if>
  611. <if test="record.sex != null">
  612. sex = #{record.sex,jdbcType=CHAR},
  613. </if>
  614. <if test="record.status != null">
  615. status = #{record.status,jdbcType=CHAR},
  616. </if>
  617. <if test="record.createtime != null">
  618. createtime = #{record.createtime,jdbcType=INTEGER},
  619. </if>
  620. <if test="record.updatetime != null">
  621. updatetime = #{record.updatetime,jdbcType=INTEGER},
  622. </if>
  623. </trim>
  624. </otherwise>
  625. </choose>
  626. </insert>
  627. <insert id="upsert" parameterType="com.book.server.dao.entity.BookshelfRecommand">
  628. <!--
  629. WARNING - @mbg.generated
  630. This element is automatically generated by MyBatis Generator, do not modify.
  631. This element was generated on Fri Aug 20 19:52:17 CST 2021.
  632. -->
  633. insert into bookshelf_recommand
  634. (id, book_id, book_name, sex, status, createtime, updatetime)
  635. values
  636. (#{id,jdbcType=INTEGER}, #{bookId,jdbcType=BIGINT}, #{bookName,jdbcType=VARCHAR},
  637. #{sex,jdbcType=CHAR}, #{status,jdbcType=CHAR}, #{createtime,jdbcType=INTEGER},
  638. #{updatetime,jdbcType=INTEGER})
  639. on duplicate key update
  640. id = #{id,jdbcType=INTEGER},
  641. book_id = #{bookId,jdbcType=BIGINT},
  642. book_name = #{bookName,jdbcType=VARCHAR},
  643. sex = #{sex,jdbcType=CHAR},
  644. status = #{status,jdbcType=CHAR},
  645. createtime = #{createtime,jdbcType=INTEGER},
  646. updatetime = #{updatetime,jdbcType=INTEGER}
  647. </insert>
  648. </mapper>