mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-13 12:11:40 +08:00
299 lines
11 KiB
XML
299 lines
11 KiB
XML
<?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">
|
|
<mapper namespace="plus.bookshelf.Dao.Mapper.BookDOMapper">
|
|
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="book_name" jdbcType="VARCHAR" property="bookName" />
|
|
<result column="category_id" jdbcType="INTEGER" property="categoryId" />
|
|
<result column="publishing_house" jdbcType="VARCHAR" property="publishingHouse" />
|
|
<result column="language" jdbcType="VARCHAR" property="language" />
|
|
<result column="copyright" jdbcType="VARCHAR" property="copyright" />
|
|
<result column="is_delete" jdbcType="BIT" property="isDelete" />
|
|
<result column="thumbnail" jdbcType="VARCHAR" property="thumbnail" />
|
|
<result column="author" jdbcType="VARCHAR" property="author" />
|
|
</resultMap>
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
<result column="description" jdbcType="LONGVARCHAR" property="description" />
|
|
</resultMap>
|
|
<sql id="Example_Where_Clause">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
<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>
|
|
</where>
|
|
</sql>
|
|
<sql id="Base_Column_List">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
id, book_name, category_id, publishing_house, `language`, copyright, is_delete, thumbnail,
|
|
author
|
|
</sql>
|
|
<sql id="Blob_Column_List">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
description
|
|
</sql>
|
|
<select id="selectByExampleWithBLOBs" parameterType="plus.bookshelf.Dao.DO.BookDOExample" resultMap="ResultMapWithBLOBs">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
'false' as QUERYID,
|
|
<include refid="Base_Column_List" />
|
|
,
|
|
<include refid="Blob_Column_List" />
|
|
from book_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
</select>
|
|
<select id="selectByExample" parameterType="plus.bookshelf.Dao.DO.BookDOExample" resultMap="BaseResultMap">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
'false' as QUERYID,
|
|
<include refid="Base_Column_List" />
|
|
from book_info
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
</select>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
,
|
|
<include refid="Blob_Column_List" />
|
|
from book_info
|
|
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.
|
|
-->
|
|
delete from book_info
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
insert into book_info (id, book_name, category_id,
|
|
publishing_house, `language`, copyright,
|
|
is_delete, thumbnail, author,
|
|
description)
|
|
values (#{id,jdbcType=INTEGER}, #{bookName,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER},
|
|
#{publishingHouse,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, #{copyright,jdbcType=VARCHAR},
|
|
#{isDelete,jdbcType=BIT}, #{thumbnail,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
|
|
#{description,jdbcType=LONGVARCHAR})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
insert into book_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="bookName != null">
|
|
book_name,
|
|
</if>
|
|
<if test="categoryId != null">
|
|
category_id,
|
|
</if>
|
|
<if test="publishingHouse != null">
|
|
publishing_house,
|
|
</if>
|
|
<if test="language != null">
|
|
`language`,
|
|
</if>
|
|
<if test="copyright != null">
|
|
copyright,
|
|
</if>
|
|
<if test="isDelete != null">
|
|
is_delete,
|
|
</if>
|
|
<if test="thumbnail != null">
|
|
thumbnail,
|
|
</if>
|
|
<if test="author != null">
|
|
author,
|
|
</if>
|
|
<if test="description != null">
|
|
description,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="bookName != null">
|
|
#{bookName,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="categoryId != null">
|
|
#{categoryId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="publishingHouse != null">
|
|
#{publishingHouse,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="language != null">
|
|
#{language,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="copyright != null">
|
|
#{copyright,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isDelete != null">
|
|
#{isDelete,jdbcType=BIT},
|
|
</if>
|
|
<if test="thumbnail != null">
|
|
#{thumbnail,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="author != null">
|
|
#{author,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="description != null">
|
|
#{description,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
update book_info
|
|
<set>
|
|
<if test="bookName != null">
|
|
book_name = #{bookName,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="categoryId != null">
|
|
category_id = #{categoryId,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="publishingHouse != null">
|
|
publishing_house = #{publishingHouse,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="language != null">
|
|
`language` = #{language,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="copyright != null">
|
|
copyright = #{copyright,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isDelete != null">
|
|
is_delete = #{isDelete,jdbcType=BIT},
|
|
</if>
|
|
<if test="thumbnail != null">
|
|
thumbnail = #{thumbnail,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="author != null">
|
|
author = #{author,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="description != null">
|
|
description = #{description,jdbcType=LONGVARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
update book_info
|
|
set book_name = #{bookName,jdbcType=VARCHAR},
|
|
category_id = #{categoryId,jdbcType=INTEGER},
|
|
publishing_house = #{publishingHouse,jdbcType=VARCHAR},
|
|
`language` = #{language,jdbcType=VARCHAR},
|
|
copyright = #{copyright,jdbcType=VARCHAR},
|
|
is_delete = #{isDelete,jdbcType=BIT},
|
|
thumbnail = #{thumbnail,jdbcType=VARCHAR},
|
|
author = #{author,jdbcType=VARCHAR},
|
|
description = #{description,jdbcType=LONGVARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="plus.bookshelf.Dao.DO.BookDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
update book_info
|
|
set book_name = #{bookName,jdbcType=VARCHAR},
|
|
category_id = #{categoryId,jdbcType=INTEGER},
|
|
publishing_house = #{publishingHouse,jdbcType=VARCHAR},
|
|
`language` = #{language,jdbcType=VARCHAR},
|
|
copyright = #{copyright,jdbcType=VARCHAR},
|
|
is_delete = #{isDelete,jdbcType=BIT},
|
|
thumbnail = #{thumbnail,jdbcType=VARCHAR},
|
|
author = #{author,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<select id="selectFavoritesListByUserId" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
|
|
select
|
|
book_info.id, book_name, category_id, publishing_house, `language`, copyright, is_delete, thumbnail
|
|
<!--<include refid="Base_Column_List" />-->
|
|
,
|
|
<include refid="Blob_Column_List" />,
|
|
from user_book_favorites_relation
|
|
left join book_info on user_book_favorites_relation.book_id = book_info.id
|
|
where user_book_favorites_relation.user_id = #{userId,jdbcType=INTEGER}
|
|
</select>
|
|
</mapper> |