<?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.crm.ib.task.dao.mapper.CustomInfoDao">

    <update id="batchUpdateCustomUsdBalance" parameterType="com.crm.rely.backend.model.pojo.table.CustomInfoTable">
        <foreach collection="list" item="item" index="idx" open="" close="" separator=";">
            update custom_info
            <set>
                usd_amount = #{item.usdAmount} + ifnull(usd_amount,0)
            </set>
            where id=#{item.id}
        </foreach>
    </update>

    <select id="findAllCustomAgent" resultType="com.crm.rely.backend.model.pojo.table.CustomInfoTable">
        select id,ib_id
        from custom_info
        where ib_id is not null
    </select>

</mapper>