JNBusiness/ruoyi-system/src/main/resources/mapper/quot/QuotFileMapper.xml

56 lines
2.2 KiB
XML
Raw Normal View History

2024-04-02 11:24:37 +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="com.ruoyi.quot.mapper.QuotFileMapper">
<resultMap type="QuotFile" id="QuotFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileUrl" column="file_url" />
<result property="fileSize" column="file_size" />
<result property="fileTime" column="file_time" />
<result property="quotId" column="quot_id" />
</resultMap>
<sql id="selectQuotFileVo">
select file_id, file_name, file_url, file_size, file_time, quot_id from quot_file
</sql>
<select id="selectQuotFileList" parameterType="QuotFile" resultMap="QuotFileResult">
<include refid="selectQuotFileVo"/>
<where>
<if test="quotId != null and quotId != ''"> and quot_id = #{quotId}</if>
</where>
</select>
<select id="selectQuotFileByFileId" parameterType="String" resultMap="QuotFileResult">
<include refid="selectQuotFileVo"/>
where file_id = #{fileId}
</select>
<insert id="insertQuotFile" parameterType="QuotFile">
insert into quot_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileUrl != null">file_url,</if>
<if test="fileSize != null">file_size,</if>
<if test="fileTime != null">file_time,</if>
<if test="quotId != null">quot_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">#{fileId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileTime != null">#{fileTime},</if>
<if test="quotId != null">#{quotId},</if>
</trim>
</insert>
<delete id="deleteQuotFileByFileId" parameterType="String">
delete from quot_file where file_id = #{fileId}
</delete>
</mapper>