<?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.bailuntec.balancesheet.mapper.DcBalanceSheetMapper">
    <resultMap id="BaseResultMap" type="com.bailuntec.balancesheet.entity.DcBalanceSheet">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="company_value" jdbcType="INTEGER" property="companyValue"/>
        <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
        <result column="monetary_fund" jdbcType="DECIMAL" property="monetaryFund"/>
        <result column="bank_account_balance" jdbcType="DECIMAL" property="bankAccountBalance"/>
        <result column="withdraw_amount" jdbcType="DECIMAL" property="withdrawAmount"/>
        <result column="platform_balance" jdbcType="DECIMAL" property="platformBalance"/>
        <result column="accounts_receivable" jdbcType="DECIMAL" property="accountsReceivable"/>
        <result column="prepayment" jdbcType="DECIMAL" property="prepayment"/>
        <result column="logistics_prepayment" jdbcType="DECIMAL" property="logisticsPrepayment"/>
        <result column="finished_prepayment" jdbcType="DECIMAL" property="finishedPrepayment"/>
        <result column="semi_prepayment" jdbcType="DECIMAL" property="semiPrepayment"/>
        <result column="other_accounts_receivable" jdbcType="DECIMAL" property="otherAccountsReceivable"/>
        <result column="inventory_amount" jdbcType="DECIMAL" property="inventoryAmount"/>
        <result column="fba_inventory_amount" jdbcType="DECIMAL" property="fbaInventoryAmount"/>
        <result column="not_fba_inventory_amount" jdbcType="DECIMAL" property="notFbaInventoryAmount"/>
        <result column="fba_transfer_amount" jdbcType="DECIMAL" property="fbaTransferAmount"/>
        <result column="not_fba_transfer_amount" jdbcType="DECIMAL" property="notFbaTransferAmount"/>
        <result column="semi_inventory_amount" jdbcType="DECIMAL" property="semiInventoryAmount"/>
        <result column="semi_transfer_amount" jdbcType="DECIMAL" property="semiTransferAmount"/>
        <result column="fixed_assets" jdbcType="DECIMAL" property="fixedAssets"/>
        <result column="short_term_borrow" jdbcType="DECIMAL" property="shortTermBorrow"/>
        <result column="accounts_payable" jdbcType="DECIMAL" property="accountsPayable"/>
        <result column="logistics_accounts_payable" jdbcType="DECIMAL" property="logisticsAccountsPayable"/>
        <result column="finished_accounts_payable" jdbcType="DECIMAL" property="finishedAccountsPayable"/>
        <result column="semi_accounts_payable" jdbcType="DECIMAL" property="semiAccountsPayable"/>
        <result column="advance_received" jdbcType="DECIMAL" property="advanceReceived"/>
        <result column="payable_remuneration" jdbcType="DECIMAL" property="payableRemuneration"/>
        <result column="taxes_payable" jdbcType="DECIMAL" property="taxesPayable"/>
        <result column="other_accounts_payable" jdbcType="DECIMAL" property="otherAccountsPayable"/>
        <result column="long_term_accounts_payable" jdbcType="DECIMAL" property="longTermAccountsPayable"/>
        <result column="statistical_time" jdbcType="DATE" property="statisticalTime"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, company_value, company_name, monetary_fund, accounts_receivable, prepayment,
    other_accounts_receivable, inventory_amount, fixed_assets, short_term_borrow, accounts_payable,
    advance_received, payable_remuneration, taxes_payable, other_accounts_payable, long_term_accounts_payable,
    statistical_time, update_time
    </sql>
    <insert id="insertSelective" parameterType="com.bailuntec.balancesheet.entity.DcBalanceSheet">
        insert into dc_balance_sheet
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="companyValue != null">
                company_value,
            </if>
            <if test="companyName != null">
                company_name,
            </if>
            <if test="monetaryFund != null">
                monetary_fund,
            </if>
            <if test="accountsReceivable != null">
                accounts_receivable,
            </if>
            <if test="prepayment != null">
                prepayment,
            </if>
            <if test="otherAccountsReceivable != null">
                other_accounts_receivable,
            </if>
            <if test="inventoryAmount != null">
                inventory_amount,
            </if>
            <if test="fixedAssets != null">
                fixed_assets,
            </if>
            <if test="shortTermBorrow != null">
                short_term_borrow,
            </if>
            <if test="accountsPayable != null">
                accounts_payable,
            </if>
            <if test="advanceReceived != null">
                advance_received,
            </if>
            <if test="payableRemuneration != null">
                payable_remuneration,
            </if>
            <if test="taxesPayable != null">
                taxes_payable,
            </if>
            <if test="otherAccountsPayable != null">
                other_accounts_payable,
            </if>
            <if test="longTermAccountsPayable != null">
                long_term_accounts_payable,
            </if>
            <if test="statisticalTime != null">
                statistical_time,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="companyValue != null">
                #{companyValue,jdbcType=INTEGER},
            </if>
            <if test="companyName != null">
                #{companyName,jdbcType=VARCHAR},
            </if>
            <if test="monetaryFund != null">
                #{monetaryFund,jdbcType=DECIMAL},
            </if>
            <if test="accountsReceivable != null">
                #{accountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="prepayment != null">
                #{prepayment,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsReceivable != null">
                #{otherAccountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="inventoryAmount != null">
                #{inventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fixedAssets != null">
                #{fixedAssets,jdbcType=DECIMAL},
            </if>
            <if test="shortTermBorrow != null">
                #{shortTermBorrow,jdbcType=DECIMAL},
            </if>
            <if test="accountsPayable != null">
                #{accountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="advanceReceived != null">
                #{advanceReceived,jdbcType=DECIMAL},
            </if>
            <if test="payableRemuneration != null">
                #{payableRemuneration,jdbcType=DECIMAL},
            </if>
            <if test="taxesPayable != null">
                #{taxesPayable,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsPayable != null">
                #{otherAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="longTermAccountsPayable != null">
                #{longTermAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="statisticalTime != null">
                #{statisticalTime,jdbcType=DATE},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.balancesheet.entity.DcBalanceSheet">
        update dc_balance_sheet
        <set>
            <if test="companyValue != null">
                company_value = #{companyValue,jdbcType=INTEGER},
            </if>
            <if test="companyName != null">
                company_name = #{companyName,jdbcType=VARCHAR},
            </if>
            <if test="monetaryFund != null">
                monetary_fund = #{monetaryFund,jdbcType=DECIMAL},
            </if>
            <if test="bankAccountBalance != null">
                bank_account_balance = #{bankAccountBalance,jdbcType=DECIMAL},
            </if>
            <if test="withdrawAmount != null">
                withdraw_amount = #{withdrawAmount,jdbcType=DECIMAL},
            </if>
            <if test="platformBalance != null">
                platform_balance = #{platformBalance,jdbcType=DECIMAL},
            </if>
            <if test="accountsReceivable != null">
                accounts_receivable = #{accountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="prepayment != null">
                prepayment = #{prepayment,jdbcType=DECIMAL},
            </if>
            <if test="logisticsPrepayment != null">
                logistics_prepayment = #{logisticsPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="finishedPrepayment != null">
                finished_prepayment = #{finishedPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="semiPrepayment != null">
                semi_prepayment = #{semiPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsReceivable != null">
                other_accounts_receivable = #{otherAccountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="inventoryAmount != null">
                inventory_amount = #{inventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fbaInventoryAmount != null">
                fba_inventory_amount = #{fbaInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="notFbaInventoryAmount != null">
                not_fba_inventory_amount = #{notFbaInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fbaTransferAmount != null">
                fba_transfer_amount = #{fbaTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="notFbaTransferAmount != null">
                not_fba_transfer_amount = #{notFbaTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiInventoryAmount != null">
                semi_inventory_amount = #{semiInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiTransferAmount != null">
                semi_transfer_amount = #{semiTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="fixedAssets != null">
                fixed_assets = #{fixedAssets,jdbcType=DECIMAL},
            </if>
            <if test="shortTermBorrow != null">
                short_term_borrow = #{shortTermBorrow,jdbcType=DECIMAL},
            </if>
            <if test="accountsPayable != null">
                accounts_payable = #{accountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="logisticsAccountsPayable != null">
                logistics_accounts_payable = #{logisticsAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="finishedAccountsPayable != null">
                finished_accounts_payable = #{finishedAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="semiAccountsPayable != null">
                semi_accounts_payable = #{semiAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="advanceReceived != null">
                advance_received = #{advanceReceived,jdbcType=DECIMAL},
            </if>
            <if test="payableRemuneration != null">
                payable_remuneration = #{payableRemuneration,jdbcType=DECIMAL},
            </if>
            <if test="taxesPayable != null">
                taxes_payable = #{taxesPayable,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsPayable != null">
                other_accounts_payable = #{otherAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="longTermAccountsPayable != null">
                long_term_accounts_payable = #{longTermAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="statisticalTime != null">
                statistical_time = #{statisticalTime,jdbcType=DATE},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <update id="updateByCompanyAndDaySelective" parameterType="com.bailuntec.balancesheet.entity.DcBalanceSheet">
        update dc_balance_sheet
        <set>
            <if test="monetaryFund != null">
                monetary_fund = #{monetaryFund,jdbcType=DECIMAL},
            </if>
            <if test="bankAccountBalance != null">
                bank_account_balance = #{bankAccountBalance,jdbcType=DECIMAL},
            </if>
            <if test="withdrawAmount != null">
                withdraw_amount = #{withdrawAmount,jdbcType=DECIMAL},
            </if>
            <if test="platformBalance != null">
                platform_balance = #{platformBalance,jdbcType=DECIMAL},
            </if>
            <if test="accountsReceivable != null">
                accounts_receivable = #{accountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="amountBorrowed != null">
                amount_borrowed = #{amountBorrowed,jdbcType=DECIMAL},
            </if>
            <if test="prepayment != null">
                prepayment = #{prepayment,jdbcType=DECIMAL},
            </if>
            <if test="logisticsPrepayment != null">
                logistics_prepayment = #{logisticsPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="finishedPrepayment != null">
                finished_prepayment = #{finishedPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="semiPrepayment != null">
                semi_prepayment = #{semiPrepayment,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsReceivable != null">
                other_accounts_receivable = #{otherAccountsReceivable,jdbcType=DECIMAL},
            </if>
            <if test="inventoryAmount != null">
                inventory_amount = #{inventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fbaInventoryAmount != null">
                fba_inventory_amount = #{fbaInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="notFbaInventoryAmount != null">
                not_fba_inventory_amount = #{notFbaInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="notFbaHcInventoryAmount != null">
                not_fba_hc_inventory_amount = #{notFbaHcInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fbaTransferAmount != null">
                fba_transfer_amount = #{fbaTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="notFbaTransferAmount != null">
                not_fba_transfer_amount = #{notFbaTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="fbaTransferAllotAmount != null">
                fba_transfer_allot_amount = #{fbaTransferAllotAmount, jdbcType=DECIMAL},
            </if>
            <if test="notFbaTransferAllotAmount != null">
                not_fba_transfer_allot_amount = #{notFbaTransferAllotAmount, jdbcType=DECIMAL},
            </if>
            <if test="fbaTransferPlanAmount != null">
                fba_transfer_plan_amount = #{fbaTransferPlanAmount, jdbcType=DECIMAL},
            </if>
            <if test="notFbaTransferPlanAmount != null">
                not_fba_transfer_plan_amount = #{notFbaTransferPlanAmount, jdbcType=DECIMAL},
            </if>
            <if test="fbaPurchaseAmount != null">
                fba_purchase_amount = #{fbaPurchaseAmount, jdbcType=DECIMAL},
            </if>
            <if test="notFbaPurchaseAmount != null">
                not_fba_purchase_amount = #{notFbaPurchaseAmount, jdbcType=DECIMAL},
            </if>
            <if test="purchaseProAmount != null">
                purchase_pro_amount = #{purchaseProAmount, jdbcType=DECIMAL},
            </if>
            <if test="semiInventoryAmount != null">
                semi_inventory_amount = #{semiInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiBailunInventoryAmount != null">
                semi_bailun_inventory_amount = #{semiBailunInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiHaNiInventoryAmount != null">
                semi_hani_inventory_amount = #{semiHaNiInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiTransferAmount != null">
                semi_transfer_amount = #{semiTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiBailunTransferAmount != null">
                semi_bailun_transfer_amount = #{semiBailunTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiHaNiTransferAmount != null">
                semi_hani_transfer_amount = #{semiHaNiTransferAmount,jdbcType=DECIMAL},
            </if>
            <if test="semiProdInventoryAmount != null">
                semi_prod_inventory_amount = #{semiProdInventoryAmount,jdbcType=DECIMAL},
            </if>
            <if test="fixedAssets != null">
                fixed_assets = #{fixedAssets,jdbcType=DECIMAL},
            </if>
            <if test="shortTermBorrow != null">
                short_term_borrow = #{shortTermBorrow,jdbcType=DECIMAL},
            </if>
            <if test="accountsPayable != null">
                accounts_payable = #{accountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="logisticsAccountsPayable != null">
                logistics_accounts_payable = #{logisticsAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="finishedAccountsPayable != null">
                finished_accounts_payable = #{finishedAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="semiAccountsPayable != null">
                semi_accounts_payable = #{semiAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="advanceReceived != null">
                advance_received = #{advanceReceived,jdbcType=DECIMAL},
            </if>
            <if test="payableRemuneration != null">
                payable_remuneration = #{payableRemuneration,jdbcType=DECIMAL},
            </if>
            <if test="taxesPayable != null">
                taxes_payable = #{taxesPayable,jdbcType=DECIMAL},
            </if>
            <if test="otherAccountsPayable != null">
                other_accounts_payable = #{otherAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="longTermAccountsPayable != null">
                long_term_accounts_payable = #{longTermAccountsPayable,jdbcType=DECIMAL},
            </if>
            <if test="ncaDeferredTaxAssets != null">
                nca_deferred_tax_assets = #{ncaDeferredTaxAssets,jdbcType=DECIMAL},
            </if>
            <if test="accountsReceivableUpdate != null">
                accounts_receivable_update = #{accountsReceivableUpdate},
            </if>
            <if test="accountsReceivableImport != null">
                accounts_receivable_import = #{accountsReceivableImport},
            </if>
            <if test="otherAccountsReceivableImport != null">
                other_accounts_receivable_import = #{otherAccountsReceivableImport},
            </if>
            <if test="otherAccountsPayableImport != null">
                other_accounts_payable_import = #{otherAccountsPayableImport},
            </if>
            <if test="fixedAssetsImport != null">
                fixed_assets_import = #{fixedAssetsImport},
            </if>
            <if test="ncaDeferredTaxAssetsImport != null">
                nca_deferred_tax_assets_import = #{ncaDeferredTaxAssetsImport}
            </if>
        </set>
        where company_value = #{companyValue,jdbcType=INTEGER} and statistical_time = #{statisticalTime,jdbcType=DATE}
    </update>
</mapper>
