TdCFileStorageServiceSMapper.xml 2.56 KB
<?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.zteits.pay.mapper.smapper.TdCFileStorageServiceSMapper" >
	<insert id="insertFileStorageInfo" parameterType="com.zteits.pay.domain.FileStorageDO">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
	      SELECT LAST_INSERT_ID()
	    </selectKey>
	     insert into td_c_file
	    <trim prefix="(" suffix=")" suffixOverrides="," >
	      <if test="sourceId != null and sourceId !=''" >
	        source_id,
	      </if>
	      <if test="storageGroupName != null and storageGroupName !=''" >
	        storage_group_name,
	      </if>
	      <if test="storageFileName != null and storageFileName !=''" >
	        storage_file_name,
	      </if>
	      <if test="fileSuffix != null and fileSuffix !=''" >
	        file_suffix,
	      </if>
	      <if test="httpUrlFilePath != null and httpUrlFilePath !=''" >
	        file_path,
	      </if>
	      <if test="fileType != null" >
	        file_type,
	      </if>
	      <if test="fileState != null" >
	        file_state,
	      </if>
	      <if test="dataState != null" >
	        data_state,
	      </if>
	      <if test="fileSize != null" >
	        file_size,
	      </if>
	      create_date
	    </trim>
	    <trim prefix="values (" suffix=")" suffixOverrides="," >
	      <if test="sourceId != null and sourceId !=''" >
	        #{sourceId, jdbcType=VARCHAR},
	      </if>
	      <if test="storageGroupName != null and storageGroupName !=''" >
	        #{storageGroupName, jdbcType=VARCHAR},
	      </if>
	      <if test="storageFileName != null and storageFileName !=''" >
	        #{storageFileName, jdbcType=VARCHAR},
	      </if>
	      <if test="fileSuffix != null and fileSuffix !=''" >
	        #{fileSuffix, jdbcType=VARCHAR},
	      </if>
	      <if test="httpUrlFilePath != null and httpUrlFilePath !=''" >
	        #{httpUrlFilePath, jdbcType=VARCHAR},
	      </if>
	      <if test="fileType != null" >
	        #{fileType},
	      </if>
	      <if test="fileState != null" >
	        #{fileState},
	      </if>
	      <if test="dataState != null" >
	        #{dataState},
	      </if>
	      <if test="fileSize != null" >
	        #{fileSize},
	      </if>
	      SYSDATE()
	    </trim>
	</insert>
	
	<select id="getFullFileURLPath" resultType="java.lang.String" 
		parameterType="com.zteits.clouds.api.dto.pay.param.FileURLPathRequest">
	   select
		  file_path
	   from td_c_file
	   where file_type = #{fileType} and source_id=#{sourceId} 
	</select>
</mapper>