file/file-web/src/main/resources/mybatis/mapper/UserFileMapper.xml
2020-12-12 16:45:33 +08:00

21 lines
688 B
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="com.qiwenshare.file.mapper.UserFileMapper">
<update id="replaceFilePath">
UPDATE userfile SET filepath=REPLACE(filepath, #{oldFilePath}, #{filePath})
WHERE filepath LIKE N'${oldFilePath}%' and userId = #{userId};
</update>
<select id="userFileList" parameterType="com.qiwenshare.file.domain.UserFile" resultType="java.util.Map">
select * from userfile
left join file on file.fileId = userfile.fileId
where userId = #{userId}
</select>
</mapper>