|
@@ -1,739 +1,756 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.book.dao.cpsshard.mapper.UserRecentlyReadMapper">
|
|
<mapper namespace="com.book.dao.cpsshard.mapper.UserRecentlyReadMapper">
|
|
- <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
- <result column="user_id" jdbcType="BIGINT" property="userId" />
|
|
|
|
- <result column="book_id" jdbcType="BIGINT" property="bookId" />
|
|
|
|
- <result column="chapter_id" jdbcType="BIGINT" property="chapterId" />
|
|
|
|
- <result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
|
|
|
|
- <result column="flag" jdbcType="TINYINT" property="flag" />
|
|
|
|
- <result column="createtime" jdbcType="INTEGER" property="createtime" />
|
|
|
|
- <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
|
|
|
|
- <result column="book_shelf_add" jdbcType="TINYINT" property="bookShelfAdd" />
|
|
|
|
- <result column="book_shelf_flag" jdbcType="TINYINT" property="bookShelfFlag" />
|
|
|
|
- </resultMap>
|
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- <where>
|
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
|
- <if test="criteria.valid">
|
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
|
- <choose>
|
|
|
|
- <when test="criterion.noValue">
|
|
|
|
- and ${criterion.condition}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.singleValue">
|
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.betweenValue">
|
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.listValue">
|
|
|
|
- and ${criterion.condition}
|
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
- #{listItem}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- </choose>
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id"/>
|
|
|
|
+ <result column="user_id" jdbcType="BIGINT" property="userId"/>
|
|
|
|
+ <result column="book_id" jdbcType="BIGINT" property="bookId"/>
|
|
|
|
+ <result column="chapter_id" jdbcType="BIGINT" property="chapterId"/>
|
|
|
|
+ <result column="chapter_name" jdbcType="VARCHAR" property="chapterName"/>
|
|
|
|
+ <result column="flag" jdbcType="TINYINT" property="flag"/>
|
|
|
|
+ <result column="createtime" jdbcType="INTEGER" property="createtime"/>
|
|
|
|
+ <result column="updatetime" jdbcType="INTEGER" property="updatetime"/>
|
|
|
|
+ <result column="book_shelf_add" jdbcType="TINYINT" property="bookShelfAdd"/>
|
|
|
|
+ <result column="book_shelf_flag" jdbcType="TINYINT" property="bookShelfFlag"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ <where>
|
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
|
+ <if test="criteria.valid">
|
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="criterion.noValue">
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.singleValue">
|
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.listValue">
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
+ separator=",">
|
|
|
|
+ #{listItem}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ </choose>
|
|
|
|
+ </foreach>
|
|
|
|
+ </trim>
|
|
|
|
+ </if>
|
|
</foreach>
|
|
</foreach>
|
|
- </trim>
|
|
|
|
- </if>
|
|
|
|
- </foreach>
|
|
|
|
- </where>
|
|
|
|
- </sql>
|
|
|
|
- <sql id="Update_By_Example_Where_Clause">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- <where>
|
|
|
|
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
- <if test="criteria.valid">
|
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
|
- <choose>
|
|
|
|
- <when test="criterion.noValue">
|
|
|
|
- and ${criterion.condition}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.singleValue">
|
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.betweenValue">
|
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
- </when>
|
|
|
|
- <when test="criterion.listValue">
|
|
|
|
- and ${criterion.condition}
|
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
- #{listItem}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- </choose>
|
|
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="Update_By_Example_Where_Clause">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ <where>
|
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
+ <if test="criteria.valid">
|
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="criterion.noValue">
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.singleValue">
|
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
+ </when>
|
|
|
|
+ <when test="criterion.listValue">
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
+ separator=",">
|
|
|
|
+ #{listItem}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ </choose>
|
|
|
|
+ </foreach>
|
|
|
|
+ </trim>
|
|
|
|
+ </if>
|
|
</foreach>
|
|
</foreach>
|
|
- </trim>
|
|
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="Base_Column_List">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
+ book_shelf_flag
|
|
|
|
+ </sql>
|
|
|
|
+ <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
|
|
|
|
+ resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <if test="distinct">
|
|
|
|
+ distinct
|
|
</if>
|
|
</if>
|
|
- </foreach>
|
|
|
|
- </where>
|
|
|
|
- </sql>
|
|
|
|
- <sql id="Base_Column_List">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
- book_shelf_flag
|
|
|
|
- </sql>
|
|
|
|
- <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <if test="distinct">
|
|
|
|
- distinct
|
|
|
|
- </if>
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- from user_recently_read
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- <if test="orderByClause != null">
|
|
|
|
- order by ${orderByClause}
|
|
|
|
- </if>
|
|
|
|
- <if test="rows != null">
|
|
|
|
- <if test="offset != null">
|
|
|
|
- limit ${offset}, ${rows}
|
|
|
|
- </if>
|
|
|
|
- <if test="offset == null">
|
|
|
|
- limit ${rows}
|
|
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
- </select>
|
|
|
|
- <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <if test="example != null and example.distinct">
|
|
|
|
- distinct
|
|
|
|
- </if>
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.aliasedEscapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- from user_recently_read
|
|
|
|
- <if test="example != null">
|
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- <if test="example != null and example.orderByClause != null">
|
|
|
|
- order by ${example.orderByClause}
|
|
|
|
- </if>
|
|
|
|
- <if test="example != null and example.rows != null">
|
|
|
|
- <if test="example.offset != null">
|
|
|
|
- limit ${example.offset}, ${example.rows}
|
|
|
|
- </if>
|
|
|
|
- <if test="example.offset == null">
|
|
|
|
- limit ${example.rows}
|
|
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
- </select>
|
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- from user_recently_read
|
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
|
- </select>
|
|
|
|
- <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.aliasedEscapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- from user_recently_read
|
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
|
- </select>
|
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- delete from user_recently_read
|
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
|
- </delete>
|
|
|
|
- <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- delete from user_recently_read
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- </delete>
|
|
|
|
- <insert id="insert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read (id, user_id, book_id,
|
|
|
|
- chapter_id, chapter_name, flag,
|
|
|
|
- createtime, updatetime, book_shelf_add,
|
|
|
|
- book_shelf_flag)
|
|
|
|
- values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT},
|
|
|
|
- #{chapterId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT},
|
|
|
|
- #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- #{bookShelfFlag,jdbcType=TINYINT})
|
|
|
|
- </insert>
|
|
|
|
- <insert id="insertSelective" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
- ${column.escapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- user_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- book_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- chapter_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- chapter_name,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- flag,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- createtime,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- updatetime,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- book_shelf_add,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- book_shelf_flag,
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," />
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- values
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
- #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- #{record.id,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- #{record.userId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- #{record.flag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- </insert>
|
|
|
|
- <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultType="java.lang.Long">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select count(*) from user_recently_read
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- </select>
|
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- update user_recently_read
|
|
|
|
- SET
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- id = #{record.id,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- </update>
|
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- update user_recently_read
|
|
|
|
- set id = #{record.id,jdbcType=INTEGER},
|
|
|
|
- user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
- book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
- createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- </update>
|
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- update user_recently_read
|
|
|
|
- SET
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim suffixOverrides=",">
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- where id = #{record.id,jdbcType=INTEGER}
|
|
|
|
- </update>
|
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- update user_recently_read
|
|
|
|
- set user_id = #{userId,jdbcType=BIGINT},
|
|
|
|
- book_id = #{bookId,jdbcType=BIGINT},
|
|
|
|
- chapter_id = #{chapterId,jdbcType=BIGINT},
|
|
|
|
- chapter_name = #{chapterName,jdbcType=VARCHAR},
|
|
|
|
- flag = #{flag,jdbcType=TINYINT},
|
|
|
|
- createtime = #{createtime,jdbcType=INTEGER},
|
|
|
|
- updatetime = #{updatetime,jdbcType=INTEGER},
|
|
|
|
- book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
|
- </update>
|
|
|
|
- <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- from user_recently_read
|
|
|
|
- <if test="_parameter != null">
|
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- <if test="orderByClause != null">
|
|
|
|
- order by ${orderByClause}
|
|
|
|
- </if>
|
|
|
|
- limit 1
|
|
|
|
- </select>
|
|
|
|
- <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- select
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.aliasedEscapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- from user_recently_read
|
|
|
|
- <if test="example != null">
|
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
- </if>
|
|
|
|
- <if test="example != null and example.orderByClause != null">
|
|
|
|
- order by ${example.orderByClause}
|
|
|
|
- </if>
|
|
|
|
- limit 1
|
|
|
|
- </select>
|
|
|
|
- <insert id="batchInsert" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read
|
|
|
|
- (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
- book_shelf_flag)
|
|
|
|
- values
|
|
|
|
- <foreach collection="list" item="item" separator=",">
|
|
|
|
- (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT},
|
|
|
|
- #{item.chapterId,jdbcType=BIGINT}, #{item.chapterName,jdbcType=VARCHAR}, #{item.flag,jdbcType=TINYINT},
|
|
|
|
- #{item.createtime,jdbcType=INTEGER}, #{item.updatetime,jdbcType=INTEGER}, #{item.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- #{item.bookShelfFlag,jdbcType=TINYINT})
|
|
|
|
- </foreach>
|
|
|
|
- </insert>
|
|
|
|
- <insert id="batchInsertSelective" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read (
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- ${column.escapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- )
|
|
|
|
- values
|
|
|
|
- <foreach collection="list" item="item" separator=",">
|
|
|
|
- (
|
|
|
|
- <foreach collection="selective" item="column" separator=",">
|
|
|
|
- <if test="'id'.toString() == column.value">
|
|
|
|
- #{item.id,jdbcType=INTEGER}
|
|
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
</if>
|
|
</if>
|
|
- <if test="'user_id'.toString() == column.value">
|
|
|
|
- #{item.userId,jdbcType=BIGINT}
|
|
|
|
|
|
+ <if test="orderByClause != null">
|
|
|
|
+ order by ${orderByClause}
|
|
</if>
|
|
</if>
|
|
- <if test="'book_id'.toString() == column.value">
|
|
|
|
- #{item.bookId,jdbcType=BIGINT}
|
|
|
|
|
|
+ <if test="rows != null">
|
|
|
|
+ <if test="offset != null">
|
|
|
|
+ limit ${offset}, ${rows}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="offset == null">
|
|
|
|
+ limit ${rows}
|
|
|
|
+ </if>
|
|
</if>
|
|
</if>
|
|
- <if test="'chapter_id'.toString() == column.value">
|
|
|
|
- #{item.chapterId,jdbcType=BIGINT}
|
|
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <if test="example != null and example.distinct">
|
|
|
|
+ distinct
|
|
</if>
|
|
</if>
|
|
- <if test="'chapter_name'.toString() == column.value">
|
|
|
|
- #{item.chapterName,jdbcType=VARCHAR}
|
|
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.aliasedEscapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ <if test="example != null">
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
</if>
|
|
</if>
|
|
- <if test="'flag'.toString() == column.value">
|
|
|
|
- #{item.flag,jdbcType=TINYINT}
|
|
|
|
|
|
+ <if test="example != null and example.orderByClause != null">
|
|
|
|
+ order by ${example.orderByClause}
|
|
</if>
|
|
</if>
|
|
- <if test="'createtime'.toString() == column.value">
|
|
|
|
- #{item.createtime,jdbcType=INTEGER}
|
|
|
|
|
|
+ <if test="example != null and example.rows != null">
|
|
|
|
+ <if test="example.offset != null">
|
|
|
|
+ limit ${example.offset}, ${example.rows}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="example.offset == null">
|
|
|
|
+ limit ${example.rows}
|
|
|
|
+ </if>
|
|
</if>
|
|
</if>
|
|
- <if test="'updatetime'.toString() == column.value">
|
|
|
|
- #{item.updatetime,jdbcType=INTEGER}
|
|
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.aliasedEscapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </select>
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ delete from user_recently_read
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </delete>
|
|
|
|
+ <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ delete from user_recently_read
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
</if>
|
|
</if>
|
|
- <if test="'book_shelf_add'.toString() == column.value">
|
|
|
|
- #{item.bookShelfAdd,jdbcType=TINYINT}
|
|
|
|
|
|
+ </delete>
|
|
|
|
+ <insert id="insert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read (id, user_id, book_id,
|
|
|
|
+ chapter_id, chapter_name, flag,
|
|
|
|
+ createtime, updatetime, book_shelf_add,
|
|
|
|
+ book_shelf_flag)
|
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT},
|
|
|
|
+ #{chapterId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT},
|
|
|
|
+ #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ #{bookShelfFlag,jdbcType=TINYINT})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertSelective" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
+ ${column.escapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ user_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ book_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ chapter_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ chapter_name,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ flag,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ createtime,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ updatetime,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ book_shelf_add,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ book_shelf_flag,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=","/>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ values
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
+ #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ #{record.id,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </insert>
|
|
|
|
+ <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
|
|
|
|
+ resultType="java.lang.Long">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select count(*) from user_recently_read
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
</if>
|
|
</if>
|
|
- <if test="'book_shelf_flag'.toString() == column.value">
|
|
|
|
- #{item.bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
|
|
+ </select>
|
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ update user_recently_read
|
|
|
|
+ SET
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ id = #{record.id,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
</if>
|
|
</if>
|
|
- </foreach>
|
|
|
|
- )
|
|
|
|
- </foreach>
|
|
|
|
- </insert>
|
|
|
|
- <insert id="upsertSelective" parameterType="map">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
- ${column.escapedColumnName}
|
|
|
|
- </foreach>
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- user_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- book_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- chapter_id,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- chapter_name,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- flag,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- createtime,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- updatetime,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- book_shelf_add,
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- book_shelf_flag,
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," />
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- values
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
- <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
- #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ update user_recently_read
|
|
|
|
+ set id = #{record.id,jdbcType=INTEGER},
|
|
|
|
+ user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
+ </if>
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ update user_recently_read
|
|
|
|
+ SET
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ where id = #{record.id,jdbcType=INTEGER}
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ update user_recently_read
|
|
|
|
+ set user_id = #{userId,jdbcType=BIGINT},
|
|
|
|
+ book_id = #{bookId,jdbcType=BIGINT},
|
|
|
|
+ chapter_id = #{chapterId,jdbcType=BIGINT},
|
|
|
|
+ chapter_name = #{chapterName,jdbcType=VARCHAR},
|
|
|
|
+ flag = #{flag,jdbcType=TINYINT},
|
|
|
|
+ createtime = #{createtime,jdbcType=INTEGER},
|
|
|
|
+ updatetime = #{updatetime,jdbcType=INTEGER},
|
|
|
|
+ book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
|
+ </update>
|
|
|
|
+ <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
|
|
|
|
+ resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderByClause != null">
|
|
|
|
+ order by ${orderByClause}
|
|
|
|
+ </if>
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ select
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.aliasedEscapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ from user_recently_read
|
|
|
|
+ <if test="example != null">
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="example != null and example.orderByClause != null">
|
|
|
|
+ order by ${example.orderByClause}
|
|
|
|
+ </if>
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectLastGroupByUserId" resultMap="BaseResultMap">
|
|
|
|
+ select a.*
|
|
|
|
+ from user_recently_read a,
|
|
|
|
+ (select user_id, max(updatetime) updatetime
|
|
|
|
+ from user_recently_read where createtime between #{from} and #{to}
|
|
|
|
+ group by user_id ) b
|
|
|
|
+ where a.user_id = b.user_id
|
|
|
|
+ and a.updatetime = b.updatetime
|
|
|
|
+ </select>
|
|
|
|
+ <insert id="batchInsert" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read
|
|
|
|
+ (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
+ book_shelf_flag)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
|
+ (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT},
|
|
|
|
+ #{item.chapterId,jdbcType=BIGINT}, #{item.chapterName,jdbcType=VARCHAR}, #{item.flag,jdbcType=TINYINT},
|
|
|
|
+ #{item.createtime,jdbcType=INTEGER}, #{item.updatetime,jdbcType=INTEGER},
|
|
|
|
+ #{item.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ #{item.bookShelfFlag,jdbcType=TINYINT})
|
|
</foreach>
|
|
</foreach>
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- #{record.id,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- #{record.userId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- #{record.flag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- on duplicate key update
|
|
|
|
- <choose>
|
|
|
|
- <when test="selective != null and selective.length > 0">
|
|
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="batchInsertSelective" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read (
|
|
<foreach collection="selective" item="column" separator=",">
|
|
<foreach collection="selective" item="column" separator=",">
|
|
- ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
|
|
+ ${column.escapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ )
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
|
+ (
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ <if test="'id'.toString() == column.value">
|
|
|
|
+ #{item.id,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'user_id'.toString() == column.value">
|
|
|
|
+ #{item.userId,jdbcType=BIGINT}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'book_id'.toString() == column.value">
|
|
|
|
+ #{item.bookId,jdbcType=BIGINT}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'chapter_id'.toString() == column.value">
|
|
|
|
+ #{item.chapterId,jdbcType=BIGINT}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'chapter_name'.toString() == column.value">
|
|
|
|
+ #{item.chapterName,jdbcType=VARCHAR}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'flag'.toString() == column.value">
|
|
|
|
+ #{item.flag,jdbcType=TINYINT}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'createtime'.toString() == column.value">
|
|
|
|
+ #{item.createtime,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'updatetime'.toString() == column.value">
|
|
|
|
+ #{item.updatetime,jdbcType=INTEGER}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'book_shelf_add'.toString() == column.value">
|
|
|
|
+ #{item.bookShelfAdd,jdbcType=TINYINT}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="'book_shelf_flag'.toString() == column.value">
|
|
|
|
+ #{item.bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
+ </if>
|
|
|
|
+ </foreach>
|
|
|
|
+ )
|
|
</foreach>
|
|
</foreach>
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- <trim suffixOverrides=",">
|
|
|
|
- <if test="record.id != null">
|
|
|
|
- id = #{record.id,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.userId != null">
|
|
|
|
- user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookId != null">
|
|
|
|
- book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterId != null">
|
|
|
|
- chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.chapterName != null">
|
|
|
|
- chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.flag != null">
|
|
|
|
- flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.createtime != null">
|
|
|
|
- createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.updatetime != null">
|
|
|
|
- updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfAdd != null">
|
|
|
|
- book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- <if test="record.bookShelfFlag != null">
|
|
|
|
- book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
- </if>
|
|
|
|
- </trim>
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
- </insert>
|
|
|
|
- <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
- <!--
|
|
|
|
- WARNING - @mbg.generated
|
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
- This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
- -->
|
|
|
|
- insert into user_recently_read
|
|
|
|
- (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
- book_shelf_flag)
|
|
|
|
- values
|
|
|
|
- (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT},
|
|
|
|
- #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT}, #{createtime,jdbcType=INTEGER},
|
|
|
|
- #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT}, #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
- )
|
|
|
|
- on duplicate key update
|
|
|
|
- id = #{id,jdbcType=INTEGER},
|
|
|
|
- user_id = #{userId,jdbcType=BIGINT},
|
|
|
|
- book_id = #{bookId,jdbcType=BIGINT},
|
|
|
|
- chapter_id = #{chapterId,jdbcType=BIGINT},
|
|
|
|
- chapter_name = #{chapterName,jdbcType=VARCHAR},
|
|
|
|
- flag = #{flag,jdbcType=TINYINT},
|
|
|
|
- createtime = #{createtime,jdbcType=INTEGER},
|
|
|
|
- updatetime = #{updatetime,jdbcType=INTEGER},
|
|
|
|
- book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
- book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
- </insert>
|
|
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="upsertSelective" parameterType="map">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
+ ${column.escapedColumnName}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ user_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ book_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ chapter_id,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ chapter_name,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ flag,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ createtime,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ updatetime,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ book_shelf_add,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ book_shelf_flag,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=","/>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ values
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach close=")" collection="selective" item="column" open="(" separator=",">
|
|
|
|
+ #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ #{record.id,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ on duplicate key update
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="selective != null and selective.length > 0">
|
|
|
|
+ <foreach collection="selective" item="column" separator=",">
|
|
|
|
+ ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
|
|
|
|
+ </foreach>
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
+ id = #{record.id,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.userId != null">
|
|
|
|
+ user_id = #{record.userId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookId != null">
|
|
|
|
+ book_id = #{record.bookId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterId != null">
|
|
|
|
+ chapter_id = #{record.chapterId,jdbcType=BIGINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.chapterName != null">
|
|
|
|
+ chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.flag != null">
|
|
|
|
+ flag = #{record.flag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.createtime != null">
|
|
|
|
+ createtime = #{record.createtime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.updatetime != null">
|
|
|
|
+ updatetime = #{record.updatetime,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfAdd != null">
|
|
|
|
+ book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.bookShelfFlag != null">
|
|
|
|
+ book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
|
|
|
|
+ <!--
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
+ This element was generated on Sun Aug 22 13:51:10 CST 2021.
|
|
|
|
+ -->
|
|
|
|
+ insert into user_recently_read
|
|
|
|
+ (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
|
|
|
|
+ book_shelf_flag)
|
|
|
|
+ values
|
|
|
|
+ (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT},
|
|
|
|
+ #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT}, #{createtime,jdbcType=INTEGER},
|
|
|
|
+ #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT}, #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
+ )
|
|
|
|
+ on duplicate key update
|
|
|
|
+ id = #{id,jdbcType=INTEGER},
|
|
|
|
+ user_id = #{userId,jdbcType=BIGINT},
|
|
|
|
+ book_id = #{bookId,jdbcType=BIGINT},
|
|
|
|
+ chapter_id = #{chapterId,jdbcType=BIGINT},
|
|
|
|
+ chapter_name = #{chapterName,jdbcType=VARCHAR},
|
|
|
|
+ flag = #{flag,jdbcType=TINYINT},
|
|
|
|
+ createtime = #{createtime,jdbcType=INTEGER},
|
|
|
|
+ updatetime = #{updatetime,jdbcType=INTEGER},
|
|
|
|
+ book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
|
|
|
|
+ book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
|
|
|
|
+ </insert>
|
|
</mapper>
|
|
</mapper>
|