<?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.energy.manage.service.mappers.datatransferhistory.DataTransferHistoryMapper">
    <resultMap id="resultMap" type="com.energy.manage.common.po.datatransfer.DataTransferHistoryPo">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="batchCode" column="batch_code" jdbcType="VARCHAR"/>
        <result property="transferAddr" column="transfer_addr" jdbcType="VARCHAR"/>
        <result property="engineCount" column="engine_count" jdbcType="INTEGER"/>
        <result property="errInfo" column="err_info" jdbcType="VARCHAR"/>
        <result property="transferType" column="transfer_type" jdbcType="VARCHAR"/>
        <result property="transferFinishTime" column="transfer_finish_time" jdbcType="TIMESTAMP"/>
        <result property="optionBy" column="option_by" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
    </resultMap>


    <insert id="addDataTransferHistory" parameterType="com.energy.manage.common.po.datatransfer.DataTransferHistoryPo">
        insert into data_transfer_history
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="batchCode != null">
                batch_code,
            </if>
            <if test="engineCount != null">
                engine_count,
            </if>
            <if test="errInfo != null">
                err_info,
            </if>
            <if test="transferAddr != null">
                transfer_addr,
            </if>
            <if test="transferType != null">
                transfer_type,
            </if>
            <if test="transferFinishTime != null">
                transfer_finish_time,
            </if>
            <if test="optionBy != null">
                option_by
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="batchCode != null">
                #{batchCode,jdbcType=VARCHAR},
            </if>
            <if test="engineCount != null">
                #{engineCount,jdbcType=VARCHAR},
            </if>
            <if test="errInfo != null">
                #{errInfo,jdbcType=VARCHAR},
            </if>
            <if test="transferAddr != null">
                #{transferAddr,jdbcType=VARCHAR},
            </if>
            <if test="transferType != null">
                #{transferType,jdbcType=VARCHAR},
            </if>
            <if test="transferFinishTime != null">
                #{transferFinishTime,jdbcType=TIMESTAMP},
            </if>
            <if test="optionBy != null">
                #{optionBy,jdbcType=VARCHAR}
            </if>
        </trim>
    </insert>
</mapper>
