JNBusinessTest/ruoyi-system/target/classes/mapper/bid/BidFileMapper.xml

64 lines
2.7 KiB
XML
Raw Normal View History

2024-08-05 17:16:54 +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.bid.mapper.BidFileMapper">
<resultMap type="BidFile" id="BidFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileBucketName" column="file_bucket_name" />
<result property="fileUrl" column="file_url" />
<result property="fileSize" column="file_size" />
<result property="fileTime" column="file_time" />
<result property="fileType" column="file_type" />
<result property="relationId" column="relation_id" />
</resultMap>
<sql id="selectBidFileVo">
select file_id, file_name, file_bucket_name, file_url, file_size, file_time, file_type, relation_id from bid_file
</sql>
<select id="selectBidFileList" parameterType="BidFile" resultMap="BidFileResult">
<include refid="selectBidFileVo"/>
<where>
and relation_id = #{relationId}
and file_type = #{fileType}
</where>
order by file_time desc
</select>
<select id="selectBidFileByFileId" parameterType="String" resultMap="BidFileResult">
<include refid="selectBidFileVo"/>
where file_id = #{fileId}
</select>
<insert id="insertBidFile" parameterType="BidFile">
insert into bid_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileBucketName != null">file_bucket_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="fileType != null">file_type,</if>
<if test="relationId != null">relation_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileId != null">#{fileId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileBucketName != null">#{fileBucketName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileTime != null">#{fileTime},</if>
<if test="fileType != null">#{fileType},</if>
<if test="relationId != null">#{relationId},</if>
</trim>
</insert>
<delete id="deleteBidFileByFileId" parameterType="String">
delete from bid_file where file_id = #{fileId}
</delete>
</mapper>