<?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.muchinfo.mtp3interface.mapper.ITaaccountmarketMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.muchinfo.mtp3pojos.entity.Taaccountmarket">
        <id column="ACCOUNTID" property="accountid" />
        <result column="MARKETID" property="marketid" />
        <result column="MODIFYTIME" property="modifytime" />
        <result column="MODIFIERID" property="modifierid" />
        <result column="SPOTRIGHTTYPE" property="spotrighttype" />
        <result column="BUYSPOTRIGHTTYPE" property="buyspotrighttype" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ACCOUNTID, MARKETID, MODIFYTIME, MODIFIERID, SPOTRIGHTTYPE, BUYSPOTRIGHTTYPE
    </sql>

    <select id="selectByAccountId" resultType="com.muchinfo.mtp3pojos.vo.taaccount.TaAccountMarketVo"
            parameterType="java.lang.Long">
        select t.marketid marketId,
               m.marketname marketName,
               t.spotrighttype spotRightType,
               t.buyspotrighttype dType,
               m.trademode tradeMode,
               m.tradeproperty tradeProperty
        from taaccountmarket t,
             market m
        where t.marketid = m.marketid
          and m.marketstatus = 2
          and t.accountid = #{accountId}
    </select>

</mapper>
