<?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.MTMapper">
    <select id="getOrder"
            resultType="Long">
        <if test="platform=='MT4'">
            SELECT ticket from mt4_trades where LOGIN=#{login} AND `COMMENT`=#{comment} limit 1;
        </if>
        <if test="platform=='MT5'">
            SELECT `order` from mt5_deals where LOGIN=#{login} AND `COMMENT`=#{comment} limit 1;
        </if>
    </select>

    <select id="getLogin"
            resultType="com.crm.rely.backend.model.pojo.view.AccountInfoView">
        SELECT *
        from account_view_${platform} account
        where LOGIN = #{login} limit 1;

    </select>
</mapper>