<?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.IAccounttradeconfigMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.muchinfo.mtp3pojos.entity.Accounttradeconfig">
        <id column="AUTOID" property="autoid" />
        <result column="ACCOUNTID" property="accountid" />
        <result column="USERID" property="userid" />
        <result column="MEMBERUSERID" property="memberuserid" />
        <result column="GOODSID" property="goodsid" />
        <result column="MARKETID" property="marketid" />
        <result column="RULETYPE" property="ruletype" />
        <result column="PARAMID" property="paramid" />
        <result column="FEEALGORITHM" property="feealgorithm" />
        <result column="PARAMVALUE" property="paramvalue" />
        <result column="CREATETIME" property="createtime" />
        <result column="CREATORID" property="creatorid" />
        <result column="TRADETYPE" property="tradetype" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        AUTOID, ACCOUNTID, USERID, MEMBERUSERID, GOODSID, MARKETID, RULETYPE, PARAMID, FEEALGORITHM, PARAMVALUE, CREATETIME, CREATORID, TRADETYPE
    </sql>


    <select id="getListForTree"  resultType="com.muchinfo.mtp3pojos.entity.Accounttradeconfig">
        select a.*,( select g.goodsname from goods g   where g.goodsid=a.goodsid ) goodsname from accounttradeconfig a
        <where>
            <if test="areauserid != null ">
                and memberuserid = #{areauserid}
            </if>
        </where>
        order by userid,goodsname asc
    </select>


</mapper>
