|  |  |  | 
|---|
|  |  |  | c.order_no, | 
|---|
|  |  |  | c.order_money | 
|---|
|  |  |  | from shop_salesman_order a | 
|---|
|  |  |  | left join biz_user b on b.open_id=a.user_id | 
|---|
|  |  |  | left join sys_vip_info b on b.id=a.user_id | 
|---|
|  |  |  | left join shop_order c on a.order_id=c.id | 
|---|
|  |  |  | where | 
|---|
|  |  |  | a.sales_user_id=#{record.userId} | 
|---|
|  |  |  | 
|---|
|  |  |  | f.shop_name address, | 
|---|
|  |  |  | d.order_status orderState, | 
|---|
|  |  |  | b.nick_name custom, | 
|---|
|  |  |  | b.open_id customUserId, | 
|---|
|  |  |  | b.id customUserId, | 
|---|
|  |  |  | e.nick_name parentSale, | 
|---|
|  |  |  | a.revenue_type profitType, | 
|---|
|  |  |  | a.amount profitBalance, | 
|---|
|  |  |  | 
|---|
|  |  |  | g.su_name settler | 
|---|
|  |  |  | FROM | 
|---|
|  |  |  | shop_salesman_order a | 
|---|
|  |  |  | LEFT JOIN biz_user b on a.user_id = b.open_id | 
|---|
|  |  |  | LEFT JOIN sys_vip_info b on a.user_id = b.id | 
|---|
|  |  |  | LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id | 
|---|
|  |  |  | LEFT JOIN shop_order d on d.id = a.order_id | 
|---|
|  |  |  | LEFT JOIN biz_user e on a.sales_user_id = e.open_id | 
|---|
|  |  |  | LEFT JOIN sys_vip_info e on a.sales_user_id = e.id | 
|---|
|  |  |  | LEFT JOIN sys_shop_info f on f.id = d.store_id | 
|---|
|  |  |  | LEFT JOIN sys_users g on c.user_id = g.su_id | 
|---|
|  |  |  | <where> | 
|---|