<?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="org.jeecg.modules.shop.user.mapper.PartnerUserMapper">

    <select id="customerList" resultType="org.jeecg.modules.shop.user.entity.vo.PageListCostomerVO">
        select a.name as customerName,
               a.country,
               b.co_code,
               b.money,
               b.state,
               a.create_time
            from partner_customer as a
         join partner_commission as b on a.id = b.customer_id
        where a.user_id = #{userId}
        and b.type = 0
    </select>
    <select id="orderList" resultType="org.jeecg.modules.shop.user.entity.vo.PageListCostomerVO">
        select a.name as customerName,
               a.country,
               c.co_code,
               c.money,
               c.state,
               a.create_time
        from partner_customer as a
            join partner_order as b on a.id = b.customer_id
                 join partner_commission as c on b.id = c.co_id
        where a.user_id = #{userId}
          and c.type = 1
    </select>
</mapper>