You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
4.9 KiB
XML
98 lines
4.9 KiB
XML
|
3 weeks ago
|
<?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.system.mapper.SysAttachmentMapper">
|
||
|
|
|
||
|
|
<resultMap type="SysAttachment" id="SysAttachmentResult">
|
||
|
|
<result property="attachmentId" column="attachment_id" />
|
||
|
|
<result property="fileName" column="file_name" />
|
||
|
|
<result property="filePath" column="file_path" />
|
||
|
|
<result property="fileSize" column="file_size" />
|
||
|
|
<result property="fileType" column="file_type" />
|
||
|
|
<result property="uploadTime" column="upload_time" />
|
||
|
|
<result property="uploadBy" column="upload_by" />
|
||
|
|
<result property="orderId" column="order_id" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectSysAttachmentVo">
|
||
|
|
select attachment_id, file_name, file_path, file_size, file_type, upload_time, upload_by, order_id, remark from sys_attachment
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectSysAttachmentList" parameterType="SysAttachment" resultMap="SysAttachmentResult">
|
||
|
|
<include refid="selectSysAttachmentVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||
|
|
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
|
||
|
|
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
|
||
|
|
<if test="uploadBy != null and uploadBy != ''"> and upload_by = #{uploadBy}</if>
|
||
|
|
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectSysAttachmentById" parameterType="Long" resultMap="SysAttachmentResult">
|
||
|
|
<include refid="selectSysAttachmentVo"/>
|
||
|
|
where attachment_id = #{attachmentId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectAttachmentsByOrderId" parameterType="Long" resultMap="SysAttachmentResult">
|
||
|
|
<include refid="selectSysAttachmentVo"/>
|
||
|
|
where order_id = #{orderId}
|
||
|
|
order by upload_time desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertSysAttachment" parameterType="SysAttachment" useGeneratedKeys="true" keyProperty="attachmentId">
|
||
|
|
insert into sys_attachment
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="fileName != null and fileName != ''">file_name,</if>
|
||
|
|
<if test="filePath != null and filePath != ''">file_path,</if>
|
||
|
|
<if test="fileSize != null">file_size,</if>
|
||
|
|
<if test="fileType != null and fileType != ''">file_type,</if>
|
||
|
|
<if test="uploadTime != null">upload_time,</if>
|
||
|
|
<if test="uploadBy != null and uploadBy != ''">upload_by,</if>
|
||
|
|
<if test="orderId != null">order_id,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||
|
|
<if test="filePath != null and filePath != ''">#{filePath},</if>
|
||
|
|
<if test="fileSize != null">#{fileSize},</if>
|
||
|
|
<if test="fileType != null and fileType != ''">#{fileType},</if>
|
||
|
|
<if test="uploadTime != null">#{uploadTime},</if>
|
||
|
|
<if test="uploadBy != null and uploadBy != ''">#{uploadBy},</if>
|
||
|
|
<if test="orderId != null">#{orderId},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateSysAttachment" parameterType="SysAttachment">
|
||
|
|
update sys_attachment
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
||
|
|
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
|
||
|
|
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||
|
|
<if test="fileType != null and fileType != ''">file_type = #{fileType},</if>
|
||
|
|
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
||
|
|
<if test="uploadBy != null and uploadBy != ''">upload_by = #{uploadBy},</if>
|
||
|
|
<if test="orderId != null">order_id = #{orderId},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
</trim>
|
||
|
|
where attachment_id = #{attachmentId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteSysAttachmentById" parameterType="Long">
|
||
|
|
delete from sys_attachment where attachment_id = #{attachmentId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteAttachmentsByOrderId" parameterType="Long">
|
||
|
|
delete from sys_attachment where order_id = #{orderId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteSysAttachmentByIds" parameterType="String">
|
||
|
|
delete from sys_attachment where attachment_id in
|
||
|
|
<foreach item="attachmentId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{attachmentId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|