<?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="org.jeecg.ctop.finance.agent.mapper.CtopAccountTransactionDayMapper">
   <!-- 批量插入新增数据-->
    <insert id="saveAccountTransactionDay">
        insert  into ctop_account_transaction_day (advertiser_id,date,balance,cash_cost,cost,frozen,income,reward_cost,
        shared_wallet_cost,transfer_in,transfer_out,create_time) values
        <foreach collection="list" item="item" index="index" separator=",">
            (
            #{item.advertiserId},
            #{item.date},
            #{item.balance},
            #{item.cashCost},
            #{item.cost},
            #{item.frozen},
            #{item.income},
            #{item.rewardCost},
            #{item.sharedWalletCost},
            #{item.transferIn},
            #{item.transferOut},
            #{date}
            )
        </foreach>
    </insert>

    <select id="getAdvertiserIdByDate" parameterType="String" resultType="String">
        select t.advertiser_id from ctop_account_transaction_day t where t.date=#{date} and t.advertiser_id=#{advertiserId}
    </select>

</mapper>