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.
 
 
 
 
 
 

108 lines
4.5 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.zdxt.excel.mapper.ExcelUploadMapper">
<resultMap type="com.zdxt.excel.domain.ExcelUpload" id="ExcelUploadResult">
<result property="id" column="Id" />
<result property="uploadType" column="upload_type" />
<result property="attachmentName" column="excel_name" />
<result property="attachmentPath" column="excel_path" />
<result property="attachmentObjectName" column="excel_object_name" />
<result property="attachmentMdName" column="excel_md_name" />
<result property="attachmentSize" column="excel_size" />
<result property="attachmentSuffix" column="excel_suffix" />
<result property="attachmentBucketName" column="bucket_name" />
<result property="attachmentUploadStatus" column="upload_status" />
<result property="creator" column="creator" />
<result property="createTime" column="create_time" />
<result property="updator" column="updator" />
<result property="updateTime" column="update_time" />
<result property="uploadMessage" column="upload_message" />
<result property="errorExcelObjName" column="error_excel_obj_name" />
<result property="errorExcelPath" column="error_excel_path" />
<result property="activityType" column="activity_type" />
</resultMap>
<sql id="SQL_BASE">
Id,activity_type, upload_type, excel_name, excel_path, excel_object_name, excel_md_name, excel_size, excel_suffix, bucket_name, upload_status, creator, create_time, updator, update_time, upload_message, error_excel_obj_name, error_excel_path
</sql>
<select id="excelUploadHisPageList" resultMap="ExcelUploadResult">
select
<include refid="SQL_BASE"></include>
from excel_upload_t
<where>
<if test="attachmentName != null and attachmentName != ''">
excel_name like concat('%',#{attachmentName,jdbcType=VARCHAR},'%')
</if>
</where>
</select>
<select id="queryExcelUploadHisInfo" resultMap="ExcelUploadResult">
select
<include refid="SQL_BASE"></include>
from excel_upload_t
where id = #{id}
</select>
<insert id="saveExcelUpload" parameterType="com.zdxt.excel.domain.ExcelUpload"
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into excel_upload_t
(
<if test="activityType != null and activityType != ''">
`activity_type`,
</if>
`upload_type`,
`excel_name`,
`excel_md_name`,
`excel_object_name`,
`excel_path`,
`excel_Size`,
`excel_Suffix`,
`bucket_Name`,
`upload_Status`,
creator,
create_time,
updator,
update_time
)
values(
<if test="activityType != null and activityType != ''">
#{activityType,jdbcType=VARCHAR},
</if>
#{uploadType,jdbcType=VARCHAR},
#{attachmentName,jdbcType=VARCHAR},
#{attachmentMdName,jdbcType=VARCHAR},
#{attachmentObjectName,jdbcType=VARCHAR},
#{attachmentPath,jdbcType=VARCHAR},
#{attachmentSize,jdbcType=NUMERIC},
#{attachmentSuffix,jdbcType=VARCHAR},
#{attachmentBucketName,jdbcType=VARCHAR},
#{attachmentUploadStatus,jdbcType=VARCHAR},
#{creator},
NOW(),
#{updator},
NOW()
)
</insert>
<update id="updateExcelUploadStatus">
update excel_upload_t
set upload_Status = #{attachmentUploadStatus,jdbcType=VARCHAR}
,update_time = NOW()
,updator = #{updator}
,upload_message = #{uploadMessage,jdbcType=VARCHAR}
where id = #{id,jdbcType=NUMERIC}
</update>
<update id="updateErrorExcelInfo">
update excel_upload_t
set error_excel_obj_name = #{errorExcelObjName,jdbcType=VARCHAR}
,update_time = NOW()
,updator = #{updator}
,error_excel_path = #{errorExcelPath,jdbcType=VARCHAR}
where id = #{id,jdbcType=NUMERIC}
</update>
</mapper>