1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-10-07 00:15:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
bookshelfplus/bookshelfplus/src/main/resources/mapping/FileObjectDOMapper.xml

176 lines
6.3 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.FileObjectDOMapper">
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="file_id" jdbcType="INTEGER" property="fileId" />
<result column="upload_status" jdbcType="VARCHAR" property="uploadStatus" />
<result column="storage_medium" jdbcType="VARCHAR" property="storageMedium" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="file_pwd" jdbcType="VARCHAR" property="filePwd" />
<result column="file_share_code" jdbcType="VARCHAR" property="fileShareCode" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, file_id, upload_status, storage_medium, file_path, file_pwd, file_share_code
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from file_object_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 file_object_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into file_object_info (id, file_id, upload_status,
storage_medium, file_path, file_pwd,
file_share_code)
values (#{id,jdbcType=INTEGER}, #{fileId,jdbcType=INTEGER}, #{uploadStatus,jdbcType=VARCHAR},
#{storageMedium,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{filePwd,jdbcType=VARCHAR},
#{fileShareCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into file_object_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="fileId != null">
file_id,
</if>
<if test="uploadStatus != null">
upload_status,
</if>
<if test="storageMedium != null">
storage_medium,
</if>
<if test="filePath != null">
file_path,
</if>
<if test="filePwd != null">
file_pwd,
</if>
<if test="fileShareCode != null">
file_share_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="fileId != null">
#{fileId,jdbcType=INTEGER},
</if>
<if test="uploadStatus != null">
#{uploadStatus,jdbcType=VARCHAR},
</if>
<if test="storageMedium != null">
#{storageMedium,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="filePwd != null">
#{filePwd,jdbcType=VARCHAR},
</if>
<if test="fileShareCode != null">
#{fileShareCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update file_object_info
<set>
<if test="fileId != null">
file_id = #{fileId,jdbcType=INTEGER},
</if>
<if test="uploadStatus != null">
upload_status = #{uploadStatus,jdbcType=VARCHAR},
</if>
<if test="storageMedium != null">
storage_medium = #{storageMedium,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
file_path = #{filePath,jdbcType=VARCHAR},
</if>
<if test="filePwd != null">
file_pwd = #{filePwd,jdbcType=VARCHAR},
</if>
<if test="fileShareCode != null">
file_share_code = #{fileShareCode,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="plus.bookshelf.Dao.DO.FileObjectDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update file_object_info
set file_id = #{fileId,jdbcType=INTEGER},
upload_status = #{uploadStatus,jdbcType=VARCHAR},
storage_medium = #{storageMedium,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
file_pwd = #{filePwd,jdbcType=VARCHAR},
file_share_code = #{fileShareCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from file_object_info
</select>
<select id="selectByFilePath" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from file_object_info
where file_path = #{filePath}
</select>
<select id="selectFileObjectByBookId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM `file_object_info`
WHERE file_id IN (SELECT id AS file_id FROM `file_info` WHERE book_id = #{bookId})
AND upload_status = 'SUCCESS'
</select>
<select id="selectByFileId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM `file_object_info`
WHERE file_id = #{fileId}
</select>
<select id="getLastInsertId" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID();
</select>
</mapper>