<?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.globex.dao.mapper.AccountInfoMapper">


    <select id="getAccountByLoginAndPlatform"
            resultType="com.crm.rely.backend.model.pojo.view.CustomLoginView">
        select account.LOGIN,account.NAME,account.LEVERAGE,account.BALANCE,account.EQUITY,
        account.floating,account.CREDIT,account.GROUP,account.registration,account.agent,
        account.commission,account.EMAIL,account.COMMENT,account.PHONE,account.COUNTRY,
        account.CITY,account.STATE,account.ADDRESS,account.identity,account.platform,
        agent.ib_no,ca.com_point
        from account_view_${platform} account
        left join custom_login ca on account.login = ca.login
        left join user_info agent on ca.agent_id = agent.id
        where account.login =#{login}
    </select>


    <select id="getAccountAmountByLoginAndPlatform"
            resultType="com.crm.rely.backend.model.pojo.view.CustomLoginView">
        select account.LOGIN,account.floating,account.BALANCE,account.EQUITY,account.floating,account.CREDIT
        from account_view_${platform} account
        where account.login =#{login}
    </select>
</mapper>