You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

131 lines
4.7 KiB

<?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.spring.modules.oss.dao.FileAssociateDao">
<resultMap id="BaseResultMap" type="com.spring.modules.oss.vo.FileAssociateData">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="site" jdbcType="VARCHAR" property="site" />
<result column="sys_oss_id" jdbcType="INTEGER" property="sysOssId" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="associated_field1" jdbcType="VARCHAR" property="associatedField1" />
<result column="associated_field2" jdbcType="VARCHAR" property="associatedField2" />
<result column="associated_field3" jdbcType="VARCHAR" property="associatedField3" />
</resultMap>
<sql id="Base_Column_List">
id, site, sys_oss_id, "type", associated_field1, associated_field2, associated_field3
</sql>
<select id="getFileAssociateData" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from file_associate
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteFileAssociate" parameterType="java.lang.Integer">
delete from file_associate
<where>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="site != null and site != ''">
and site = #{site,jdbcType=VARCHAR}
</if>
<if test="sysOssId != null">
and sys_oss_id = #{sysOssId,jdbcType=INTEGER}
</if>
<if test="type != null and type != ''">
and type = #{type,jdbcType=VARCHAR}
</if>
</where>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.spring.modules.oss.vo.FileAssociateData" useGeneratedKeys="true">
insert into file_associate (site, sys_oss_id, "type",
associated_field1, associated_field2, associated_field3
)
values (#{site,jdbcType=VARCHAR}, #{sysOssId,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR},
#{associatedField1,jdbcType=VARCHAR}, #{associatedField2,jdbcType=VARCHAR}, #{associatedField3,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.spring.modules.oss.vo.FileAssociateData" useGeneratedKeys="true">
insert into file_associate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="site != null">
site,
</if>
<if test="sysOssId != null">
sys_oss_id,
</if>
<if test="type != null">
"type",
</if>
<if test="associatedField1 != null">
associated_field1,
</if>
<if test="associatedField2 != null">
associated_field2,
</if>
<if test="associatedField3 != null">
associated_field3,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="site != null">
#{site,jdbcType=VARCHAR},
</if>
<if test="sysOssId != null">
#{sysOssId,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="associatedField1 != null">
#{associatedField1,jdbcType=VARCHAR},
</if>
<if test="associatedField2 != null">
#{associatedField2,jdbcType=VARCHAR},
</if>
<if test="associatedField3 != null">
#{associatedField3,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateSelective" parameterType="com.spring.modules.oss.vo.FileAssociateData">
update file_associate
<set>
<if test="site != null">
site = #{site,jdbcType=VARCHAR},
</if>
<if test="sysOssId != null">
sys_oss_id = #{sysOssId,jdbcType=INTEGER},
</if>
<if test="type != null">
"type" = #{type,jdbcType=VARCHAR},
</if>
<if test="associatedField1 != null">
associated_field1 = #{associatedField1,jdbcType=VARCHAR},
</if>
<if test="associatedField2 != null">
associated_field2 = #{associatedField2,jdbcType=VARCHAR},
</if>
<if test="associatedField3 != null">
associated_field3 = #{associatedField3,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="update" parameterType="com.spring.modules.oss.vo.FileAssociateData">
update file_associate
set site = #{site,jdbcType=VARCHAR},
sys_oss_id = #{sysOssId,jdbcType=INTEGER},
"type" = #{type,jdbcType=VARCHAR},
associated_field1 = #{associatedField1,jdbcType=VARCHAR},
associated_field2 = #{associatedField2,jdbcType=VARCHAR},
associated_field3 = #{associatedField3,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>