CitTbamExtendsMapper.xml 4.69 KB
Newer Older
1 2 3 4
<?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.CitTbamMapper">

kevin's avatar
kevin committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
    <insert id="insertBatch" parameterType="java.util.List">
        insert into cit_tbam
        (<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.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
                    <otherwise>0,</otherwise>
                </choose>
                <choose>
                    <when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when>
                    <otherwise>'',</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.debitAmount != null">#{item.debitAmount,jdbcType=DECIMAL},</when>
                    <otherwise>0,</otherwise>
                </choose>
                <choose>
                    <when test="item.creditAmount != null">#{item.creditAmount,jdbcType=DECIMAL},</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.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
                    <otherwise>'',</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>
79 80 81 82
                <choose>
                    <when test="item.dataType != null">#{item.dataType,jdbcType=VARCHAR},</when>
                    <otherwise>'',</otherwise>
                </choose>
kevin's avatar
kevin committed
83 84 85 86 87
            </trim>
        </foreach>
        ;
        SELECT 1 FROM DUAL;
    </insert>
88

kevin's avatar
kevin committed
89
    <select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.entity.CitTbam">
kevin's avatar
kevin committed
90 91 92 93 94 95 96 97
        select
        id as id,
        attribute attribute,
        account_code as accountCode,
        account_description accountDescription,
        debit_amount as debitAmount ,
        credit_amount as creditAmount,
        beginning_balance as beginningBalance,
kevin's avatar
kevin committed
98
        adjust_account as adjustAccount,
kevin's avatar
#  
kevin committed
99 100
        ending_balance as endingBalance,
        project_id  as projectId
kevin's avatar
kevin committed
101 102 103 104
        <if test="sql != null and sql != '' ">
            ${sql}
        </if>
    </select>
kevin's avatar
#  
kevin committed
105

106
</mapper>