init2
This commit is contained in:
@@ -13,7 +13,10 @@ minio.bucketName=timeline-test
|
||||
mybatis.mapper-locations=classpath:mapper/*.xml
|
||||
mybatis.type-aliases-package=com.timeline.file.entity
|
||||
|
||||
mybatis.configuration.mapUnderscoreToCamelCase=true
|
||||
|
||||
|
||||
server.port=30002
|
||||
spring.servlet.multipart.enabled=true
|
||||
spring.servlet.multipart.max-file-size=10MB
|
||||
spring.servlet.multipart.max-request-size=10MB
|
||||
spring.servlet.multipart.max-request-size=10MB
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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="com.timeline.file.dao.FileHashMapper">
|
||||
|
||||
<insert id="insertFileHash" parameterType="com.timeline.file.entity.FileHash">
|
||||
INSERT INTO file_hash (instance_id, hash_value, is_deleted)
|
||||
VALUES (#{instanceId}, #{hashValue}, #{isDeleted})
|
||||
</insert>
|
||||
<select id="getFileHashByInstanceId" resultType="com.timeline.file.entity.FileHash">
|
||||
SELECT * FROM file_hash WHERE instance_id = #{instanceId} AND is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getFileHashByFileHash" resultType="com.timeline.file.entity.FileHash">
|
||||
SELECT * FROM file_hash WHERE hash_value = #{hashValue} AND is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getOtherFileHashByInstanceId" resultType="com.timeline.file.entity.FileHash">
|
||||
SELECT * FROM file_hash WHERE instance_id != #{instanceId} AND is_deleted = 0 AND hash_value IN (SELECT hash_value FROM file_hash WHERE instance_id = #{instanceId} AND is_deleted = 0)
|
||||
</select>
|
||||
|
||||
<delete id="deleteFileHash">
|
||||
UPDATE file_hash SET is_deleted = 1 WHERE instance_id = #{instanceId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -18,6 +18,22 @@
|
||||
</delete>
|
||||
|
||||
<select id="selectObjectKeyById" resultType="string">
|
||||
SELECT object_key FROM image_info WHERE instance_id = #{instanceId}
|
||||
SELECT object_key FROM image_info WHERE instance_id = #{instanceId} AND is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectListByOwnerId" resultType="com.timeline.file.entity.ImageInfo" parameterType="java.util.Map">
|
||||
SELECT * FROM image_info WHERE user_id = #{ownerId} AND is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByInstanceId" resultType="com.timeline.file.entity.ImageInfo">
|
||||
SELECT * FROM image_info WHERE instance_id = #{instanceId} AND is_deleted = 0
|
||||
</select>
|
||||
|
||||
<update id="update" parameterType="com.timeline.file.entity.ImageInfo">
|
||||
UPDATE image_info SET object_key = #{objectKey},
|
||||
user_id = #{userId},
|
||||
update_time = #{updateTime},
|
||||
is_deleted = #{isDeleted}
|
||||
WHERE instance_id = #{instanceId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user