<?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.copy.trade.dao.TraderDataMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.copy.trade.entity.po.TraderData">
    <result column="id" property="id" />
    <result column="created_time" property="createdTime" />
    <result column="updated_time" property="updatedTime" />
        <result column="trader_id" property="traderId" />
        <result column="day_yield_14" property="dayYield14" />
        <result column="day_yield_30" property="dayYield30" />
        <result column="win_rate_14" property="winRate14" />
        <result column="profit_amount" property="profitAmount" />
        <result column="follow_customer" property="followCustomer" />
        <result column="order_deal_14" property="orderDeal14" />
        <result column="retraction_rate_14" property="retractionRate14" />
        <result column="trading_days" property="tradingDays" />
        <result column="profit_days" property="profitDays" />
        <result column="current_month_follow" property="currentMonthFollow" />
    </resultMap>

    <resultMap id="yield14Map" type="com.copy.trade.entity.vo.YieldVo">
        <result column="date_time" property="dateTime" />
        <result column="day_yield_14" property="dayYield14" />
    </resultMap>

    <select id="yield14" resultMap="yield14Map">
        SELECT date_time,day_yield_14 FROM statistics_data WHERE customer_id = #{traderId} order by date_time desc limit 0,14
    </select>
</mapper>
