<?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.ltkj.hosp.mapper.SysAttachmentMapper">
|
|
<resultMap type="SysAttachment" id="SysAttachmentResult">
|
<result property="id" column="id"/>
|
<result property="sysDictVal" column="sys_dict_val"/>
|
<result property="filePath" column="file_path"/>
|
<result property="fileName" column="file_name"/>
|
<result property="fileSize" column="file_size"/>
|
<result property="fileSizeMb" column="file_size_mb"/>
|
<result property="fileSizeGb" column="file_size_gb"/>
|
<result property="uploadTime" column="upload_time"/>
|
<result property="ip" column="ip"/>
|
<result property="url" column="url"/>
|
</resultMap>
|
|
<sql id="selectSysAttachmentVo">
|
select id, sys_dict_val, file_path, file_name, file_size, file_size_mb, file_size_gb, upload_time, ip,url
|
from sys_attachment
|
</sql>
|
|
<select id="selectSysAttachmentList" parameterType="SysAttachment" resultMap="SysAttachmentResult">
|
<include refid="selectSysAttachmentVo"/>
|
<where>
|
<if test="sysDictVal != null and sysDictVal != ''">
|
and sys_dict_val = #{sysDictVal}
|
</if>
|
<if test="filePath != null and filePath != ''">
|
and file_path = #{filePath}
|
</if>
|
<if test="fileName != null and fileName != ''">
|
and file_name like concat('%', #{fileName}, '%')
|
</if>
|
<if test="fileSize != null and fileSize != ''">
|
and file_size = #{fileSize}
|
</if>
|
<if test="fileSizeMb != null and fileSizeMb != ''">
|
and file_size_mb = #{fileSizeMb}
|
</if>
|
<if test="fileSizeGb != null and fileSizeGb != ''">
|
and file_size_gb = #{fileSizeGb}
|
</if>
|
<if test="uploadTime != null ">
|
and upload_time = #{uploadTime}
|
</if>
|
<if test="ip != null and ip != ''">
|
and ip = #{ip}
|
</if>
|
<if test="url != null and url != ''">
|
and url = #{url}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectSysAttachmentById" parameterType="Long"
|
resultMap="SysAttachmentResult">
|
<include refid="selectSysAttachmentVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertSysAttachment" parameterType="SysAttachment">
|
insert into sys_attachment
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,
|
</if>
|
<if test="sysDictVal != null">sys_dict_val,
|
</if>
|
<if test="filePath != null and filePath != ''">file_path,
|
</if>
|
<if test="fileName != null and fileName != ''">file_name,
|
</if>
|
<if test="fileSize != null and fileSize != ''">file_size,
|
</if>
|
<if test="fileSizeMb != null and fileSizeMb != ''">file_size_mb,
|
</if>
|
<if test="fileSizeGb != null and fileSizeGb != ''">file_size_gb,
|
</if>
|
<if test="uploadTime != null">upload_time,
|
</if>
|
<if test="ip != null and ip != ''">ip,
|
</if>
|
<if test="url != null and url != ''">url,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},
|
</if>
|
<if test="sysDictVal != null">#{sysDictVal},
|
</if>
|
<if test="filePath != null and filePath != ''">#{filePath},
|
</if>
|
<if test="fileName != null and fileName != ''">#{fileName},
|
</if>
|
<if test="fileSize != null and fileSize != ''">#{fileSize},
|
</if>
|
<if test="fileSizeMb != null and fileSizeMb != ''">#{fileSizeMb},
|
</if>
|
<if test="fileSizeGb != null and fileSizeGb != ''">#{fileSizeGb},
|
</if>
|
<if test="uploadTime != null">#{uploadTime},
|
</if>
|
<if test="ip != null and ip != ''">#{ip},
|
</if>
|
<if test="url != null and url != ''">#{url},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateSysAttachment" parameterType="SysAttachment">
|
update sys_attachment
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="sysDictVal != null">sys_dict_val =
|
#{sysDictVal},
|
</if>
|
<if test="filePath != null and filePath != ''">file_path =
|
#{filePath},
|
</if>
|
<if test="fileName != null and fileName != ''">file_name =
|
#{fileName},
|
</if>
|
<if test="fileSize != null and fileSize != ''">file_size =
|
#{fileSize},
|
</if>
|
<if test="fileSizeMb != null and fileSizeMb != ''">file_size_mb =
|
#{fileSizeMb},
|
</if>
|
<if test="fileSizeGb != null and fileSizeGb != ''">file_size_gb =
|
#{fileSizeGb},
|
</if>
|
<if test="uploadTime != null">upload_time =
|
#{uploadTime},
|
</if>
|
<if test="ip != null and ip != ''">ip =
|
#{ip},
|
</if>
|
<if test="url != null and url != ''">ip =
|
#{url},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteSysAttachmentById" parameterType="Long">
|
delete
|
from sys_attachment where id = #{id}
|
</delete>
|
|
<delete id="deleteSysAttachmentByIds" parameterType="String">
|
delete from sys_attachment where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|