2024-10-04 16:48:57 +08:00
|
|
|
<?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="cn.bunny.services.mapper.FilesMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
2024-10-04 23:36:54 +08:00
|
|
|
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.system.Files">
|
2024-10-04 16:48:57 +08:00
|
|
|
<id column="id" property="id"/>
|
2024-10-09 16:46:16 +08:00
|
|
|
<id column="create_time" property="createTime"/>
|
|
|
|
<id column="update_time" property="updateTime"/>
|
|
|
|
<id column="create_user" property="createUser"/>
|
|
|
|
<id column="update_user" property="updateUser"/>
|
|
|
|
<id column="is_deleted" property="isDeleted"/>
|
|
|
|
<id column="filename" property="filename"/>
|
|
|
|
<id column="filepath" property="filepath"/>
|
|
|
|
<id column="file_size" property="fileSize"/>
|
|
|
|
<id column="file_type" property="fileType"/>
|
|
|
|
<id column="download_count" property="downloadCount"/>
|
2024-10-04 16:48:57 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
<sql id="Base_Column_List">
|
2024-10-09 16:46:16 +08:00
|
|
|
id, create_time, update_time, create_user, update_user, is_deleted, filename, filepath, file_size, file_type, download_count
|
2024-10-04 16:48:57 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-10-09 16:46:16 +08:00
|
|
|
<!-- 分页查询系统文件表内容 -->
|
2024-10-31 10:01:58 +08:00
|
|
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.files.FilesVo">
|
2024-10-11 16:47:15 +08:00
|
|
|
select
|
2024-10-31 10:01:58 +08:00
|
|
|
files.*,
|
|
|
|
create_user.username as create_username,
|
|
|
|
update_user.username as update_username
|
|
|
|
from sys_files files
|
|
|
|
left join sys_user create_user on create_user.id = files.create_user
|
|
|
|
left join sys_user update_user on update_user.id = files.update_user
|
2024-10-09 16:46:16 +08:00
|
|
|
<where>
|
2024-10-31 10:01:58 +08:00
|
|
|
files.is_deleted = 0
|
2024-10-11 16:47:15 +08:00
|
|
|
<if test="dto.filename != null and dto.filename != ''">
|
2024-10-31 10:01:58 +08:00
|
|
|
and files.filename like CONCAT('%',#{dto.filename},'%')
|
2024-10-11 16:47:15 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.filepath != null and dto.filepath != ''">
|
2024-10-31 10:01:58 +08:00
|
|
|
and files.filepath like CONCAT('%',#{dto.filepath},'%')
|
2024-10-11 16:47:15 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.fileType != null and dto.fileType != ''">
|
2024-10-31 10:01:58 +08:00
|
|
|
and files.file_type like CONCAT('%',#{dto.fileType},'%')
|
2024-10-11 16:47:15 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.downloadCount != null and dto.downloadCount != ''">
|
2024-10-31 10:01:58 +08:00
|
|
|
and files.download_count like CONCAT('%',#{dto.downloadCount},'%')
|
2024-10-11 16:47:15 +08:00
|
|
|
</if>
|
2024-10-09 16:46:16 +08:00
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 物理删除系统文件表 -->
|
|
|
|
<delete id="deleteBatchIdsWithPhysics">
|
|
|
|
delete
|
|
|
|
from sys_files
|
|
|
|
where id in
|
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
2024-10-04 16:48:57 +08:00
|
|
|
</mapper>
|