CitTrialBalanceExtendsMapper.xml 2.67 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="pwc.taxtech.atms.dao.CitTrialBalanceMapper">

  <insert id="insertBatch" parameterType="java.util.List">
    insert into balance_sheet_final
    (<include refid="Base_Column_List"/>)
    values
    <foreach collection="list" item="item" index="index" separator=",">
      <trim prefix="(" suffix=")" suffixOverrides=",">
        <choose>
          <when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
        <choose>
          <when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.accountCode != null">#{item.accountCode,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.accountDescription != null">#{item.accountDescription,jdbcType=VARCHAR},</when>
          <otherwise>'',</otherwise>
        </choose>
        <choose>
          <when test="item.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
          <otherwise>0,</otherwise>
        </choose>

        <choose>
          <when test="item.beginningBalance != null">#{item.beginningBalance,jdbcType=DECIMAL},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when>
          <otherwise>0,</otherwise>
        </choose>
        <choose>
          <when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
        <choose>
          <when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
          <otherwise>CURRENT_TIMESTAMP,</otherwise>
        </choose>
      </trim>
    </foreach>;
    SELECT 1 FROM DUAL;
  </insert>

</mapper>